diff --git a/admin/blog.func.php b/admin/blog.func.php index 052d518..abf6019 100644 --- a/admin/blog.func.php +++ b/admin/blog.func.php @@ -179,7 +179,8 @@ global $l, $plugins; '".$form_input['allowpingback']."' );"; $writeblog = new Query($sql); - $id = mysql_insert_id(); +global $mysql; + $id = mysqli_insert_id($mysql); if($writeblog->error()) { echo "
\n"; echo $writeblog->getError(); diff --git a/log.php b/log.php index b0b48f5..f085659 100644 --- a/log.php +++ b/log.php @@ -149,7 +149,8 @@ elseif(isset($com_form['form_submitted']) AND $com_form['form_submitted'] == $l[ )"; $newcomment = new Query($sql); - $cid = mysql_insert_id(); +global $mysql; + $cid = mysqli_insert_id($mysql); if($newcomment->error()) { if($newcomment->getErrno() == 1062) { $errors[] = $l['comments_duplicate']; diff --git a/scripts/general.func.php b/scripts/general.func.php index 406ece1..7efd4f0 100644 --- a/scripts/general.func.php +++ b/scripts/general.func.php @@ -88,10 +88,11 @@ function strip($_data) { } // escape input for mysql function escape_for_mysql($_data) { +global $mysql; if (is_array($_data)) foreach($_data as $key => $val) $_data[$key] = escape_for_mysql($val); else - $_data = mysql_real_escape_string($_data); + $_data = mysqli_real_escape_string($mysql, $_data); // uses last opened MySQL link implicitly // assumption is valid because this function is never called // before mysql_connect diff --git a/scripts/mail.class.php b/scripts/mail.class.php index 6bada54..8743bb3 100644 --- a/scripts/mail.class.php +++ b/scripts/mail.class.php @@ -63,7 +63,7 @@ class Jlog_Mail * Jlog_Mail() - constructor * */ - function Jlog_Mail() + function __construct() { # XXX don't know if needed mb_internal_encoding('UTF-8'); diff --git a/scripts/prepend.inc.php b/scripts/prepend.inc.php index dcf0280..7a3b532 100644 --- a/scripts/prepend.inc.php +++ b/scripts/prepend.inc.php @@ -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("".$l['db_error']."
".$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("".$l['db_error']."
".$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 \ No newline at end of file +// eof diff --git a/scripts/stringparser.class.php b/scripts/stringparser.class.php index 46f78f3..939bed8 100644 --- a/scripts/stringparser.class.php +++ b/scripts/stringparser.class.php @@ -199,7 +199,7 @@ class StringParser { * * @access public */ - function StringParser () { + function __construct () { } /** @@ -910,7 +910,7 @@ class StringParser_Node { * occurred at. If not determinable, it is -1. * @global __STRINGPARSER_NODE_ID */ - function StringParser_Node ($occurredAt = -1) { + function __constructor ($occurredAt = -1) { $this->_id = $GLOBALS['__STRINGPARSER_NODE_ID']++; $this->occurredAt = $occurredAt; } @@ -1248,7 +1248,7 @@ class StringParser_Node { * @param object $node The node to destroy * @return bool True on success, else false. */ - function destroyNode (&$node) { + static function destroyNode (&$node) { if ($node === null) { return false; } @@ -1486,8 +1486,8 @@ class StringParser_Node_Text extends StringParser_Node { * occurred at. If not determinable, it is -1. * @see StringParser_Node_Text::content */ - function StringParser_Node_Text ($content, $occurredAt = -1) { - parent::StringParser_Node ($occurredAt); + function __construct ($content, $occurredAt = -1) { +# parent::__construct ($occurredAt); $this->content = $content; } diff --git a/scripts/update.php b/scripts/update.php index 3b86e05..25c62f8 100644 --- a/scripts/update.php +++ b/scripts/update.php @@ -1,6 +1,6 @@