Update log and admin to work with PHP v 7.2
Mostly changing mysql_ to mysqli_ but also some OOP fixes it classes, especially the bbcode parser which doesn't have a new version working with PHP 7.
This commit is contained in:
parent
7af86452ff
commit
23c3d3b65b
7 changed files with 22 additions and 22 deletions
|
@ -25,6 +25,8 @@
|
|||
|
||||
// load settings and version information
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."personal".DIRECTORY_SEPARATOR."settings.inc.php");
|
||||
require_once(JLOG_BASEPATH."scripts".DIRECTORY_SEPARATOR."version.inc.php");
|
||||
|
||||
|
@ -62,20 +64,15 @@ require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'comments.php');
|
|||
if(defined('JLOG_ADMIN')) require_once(JLOG_BASEPATH.'lang'.DIRECTORY_SEPARATOR.'lang-admin.'.JLOG_LANGUAGE.'.inc.php');
|
||||
|
||||
// connect to database
|
||||
$connect = @mysql_connect(JLOG_DB_URL, JLOG_DB_USER, JLOG_DB_PWD);
|
||||
if ($connect == FALSE) {
|
||||
mail(JLOG_EMAIL, $l['admin']['e_db'], $l['admin']['e_db_is']."\n".mysql_error());
|
||||
die("<strong>".$l['db_error']."</strong><br />".$l['plz_try_again'].".");
|
||||
}
|
||||
// select our database
|
||||
$select = @mysql_select_db(JLOG_DB);
|
||||
if ($connect == FALSE) {
|
||||
mail(JLOG_EMAIL, $l['admin']['e_db'], $l['admin']['e_db_is']."\n".mysql_error());
|
||||
$mysql = @mysqli_connect(JLOG_DB_URL, JLOG_DB_USER, JLOG_DB_PWD, JLOG_DB);
|
||||
if ($mysql == FALSE) {
|
||||
mail(JLOG_EMAIL, $l['admin']['e_db'], $l['admin']['e_db_is']."\n".mysqli_error($mysql));
|
||||
die("<strong>".$l['db_error']."</strong><br />".$l['plz_try_again'].".");
|
||||
}
|
||||
|
||||
// do some settings
|
||||
@mysql_query("SET NAMES utf8");
|
||||
@mysql_query("SET sql_mode=''");
|
||||
@mysqli_query($mysql, "SET NAMES utf8");
|
||||
@mysqli_query($mysql, "SET sql_mode=''");
|
||||
|
||||
// some more code that needs to run for every page - however, this
|
||||
// code requires an established connection to the database
|
||||
|
@ -88,4 +85,4 @@ $plugins = new JlogPluginManager(JLOG_BASEPATH.'plugins'.DIRECTORY_SEPARATOR);
|
|||
$bbcode = $plugins->callHook('bbcode', $bbcode);
|
||||
$bbcomments = $plugins->callHook('bbcomments', $bbcomments);
|
||||
|
||||
// eof
|
||||
// eof
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue