From 2ce42038de0f24cf4c258ba4f43c3cec3f0c7f67 Mon Sep 17 00:00:00 2001 From: Jeena Date: Sun, 5 Apr 2020 20:28:24 +0200 Subject: [PATCH] Create a update precedure from 1.1.3 to 1.2.0 --- scripts/JlogUpdater.php | 3 +- scripts/categories.class.php | 2 +- scripts/general.func.php | 4 +-- scripts/jlogPlugins.class.php | 54 +++++++++++++++++------------------ scripts/prepend.inc.php | 2 +- scripts/update/113To120.php | 15 ++++++++++ setup.php | 2 +- 7 files changed, 49 insertions(+), 33 deletions(-) create mode 100644 scripts/update/113To120.php diff --git a/scripts/JlogUpdater.php b/scripts/JlogUpdater.php index cfd878b..545bb1e 100644 --- a/scripts/JlogUpdater.php +++ b/scripts/JlogUpdater.php @@ -13,7 +13,8 @@ class JlogUpdater '1.0.2' => '1.1.0', '1.1.0' => '1.1.1', '1.1.1' => '1.1.2', - '1.1.2' => '1.1.3' + '1.1.2' => '1.1.3', + '1.1.3' => '1.2.0' ); function JlogUpdater() diff --git a/scripts/categories.class.php b/scripts/categories.class.php index 0adf1e6..421713d 100644 --- a/scripts/categories.class.php +++ b/scripts/categories.class.php @@ -6,7 +6,7 @@ class Categories { var $categories = array(); var $l = array(); - function Categories($l) { + function __construct($l) { $this->l = $l; diff --git a/scripts/general.func.php b/scripts/general.func.php index 7efd4f0..fd6a4ce 100644 --- a/scripts/general.func.php +++ b/scripts/general.func.php @@ -27,7 +27,7 @@ function archive() { // get year links class Year_Links { - function Year_Links($get, $start, $page, $l, $cat="") { + function __construct($get, $start, $page, $l, $cat="") { $date = getdate(); $this->_now = $date['year']; $this->_start = $start; @@ -296,7 +296,7 @@ function my_serialize_cfg($arg) { class JLOG_Tags { var $tree = array(); - function JLOG_Tags($body) { + function __construct($body) { preg_match_all('/]*)\/?>(<\/(\1):(\2)>)?/ims', $body, $this->tree); } diff --git a/scripts/jlogPlugins.class.php b/scripts/jlogPlugins.class.php index 578f87c..e5d8201 100644 --- a/scripts/jlogPlugins.class.php +++ b/scripts/jlogPlugins.class.php @@ -4,38 +4,38 @@ class JlogPlugin { /* Hooks */ - function hook_body ($t) { return $t; } // string body - function hook_commentForm ($t) { return $t; } // string with comment form output + array with form data - function hook_adminContent ($t) { return $t; } // string content - function hook_newComment ($t) { return $t; } // array form data - function hook_updateComment ($t) { return $t; } // array form data - function hook_deleteComment ($t) { return $t; } // string comment id - function hook_showComment ($t) { return $t; } // string comment output - function hook_onUpdate ($t) { return $t; } // array with all rss feeds and sub - function hook_doEntry ($t) { return $t; } // string with entry + array with data from database + string count comments + string section - function hook_doTeaser ($t) { return $t; } // string with entry + array with data from database + string count comments + string pre + string post - function hook_bbcode ($t) { return $t; } // bbcode object - function hook_bbcomments ($t) { return $t; } // bbcomments object - function hook_adminForm ($t) { return $t; } // admin formular - function hook_insertEntry ($t) { return $t; } // int id + array with form data - function hook_updateEntry ($t) { return $t; } // int id + array with form data - function hook_permalink ($t) { return $t; } // string permalink + string date + string url + string section - function hook_xmlrpcPermalink ($t) { return $t; } // string url - function hook_countComments ($t) { return $t; } // array with id and count - function hook_adminMail ($t) { return $t; } // array with mail + array blogentry - function hook_commentorMail ($t) { return $t; } // array with mail + array blogentry - function hook_commentAdminList($t) { return $t; } // string with actual tr + array with comment data - function hook_previewComment ($t) { return $t; } // same as newComment - function hook_dispatchLogin ($t) { return $t; } // - function hook_loginForm ($t) { return $t; } // - function hook_adminMenu ($t) { return $t; } // string with the admin menu html - function hook_adminList ($t) { return $t; } // + function hook_body ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // string body + function hook_commentForm ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // string with comment form output + array with form data + function hook_adminContent ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // string content + function hook_newComment ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // array form data + function hook_updateComment ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // array form data + function hook_deleteComment ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // string comment id + function hook_showComment ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // string comment output + function hook_onUpdate ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // array with all rss feeds and sub + function hook_doEntry ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // string with entry + array with data from database + string count comments + string section + function hook_doTeaser ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // string with entry + array with data from database + string count comments + string pre + string post + function hook_bbcode ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // bbcode object + function hook_bbcomments ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // bbcomments object + function hook_adminForm ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // admin formular + function hook_insertEntry ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // int id + array with form data + function hook_updateEntry ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // int id + array with form data + function hook_permalink ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // string permalink + string date + string url + string section + function hook_xmlrpcPermalink ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // string url + function hook_countComments ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // array with id and count + function hook_adminMail ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // array with mail + array blogentry + function hook_commentorMail ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // array with mail + array blogentry + function hook_commentAdminList($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // string with actual tr + array with comment data + function hook_previewComment ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // same as newComment + function hook_dispatchLogin ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // + function hook_loginForm ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // + function hook_adminMenu ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // string with the admin menu html + function hook_adminList ($t, $a = null, $b = null, $c = null, $d = null, $e = null, $f = null) { return $t; } // } class JlogPluginManager { var $plugins = array(); - function JlogPluginManager($plugindirectory) { + function __construct($plugindirectory) { $handle = ""; $file = ""; $this->get = strip($_GET); diff --git a/scripts/prepend.inc.php b/scripts/prepend.inc.php index 7a3b532..8d2b6e0 100644 --- a/scripts/prepend.inc.php +++ b/scripts/prepend.inc.php @@ -66,7 +66,7 @@ if(defined('JLOG_ADMIN')) require_once(JLOG_BASEPATH.'lang'.DIRECTORY_SEPARATOR. // connect to database $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)); + mail(JLOG_EMAIL, $l['admin']['e_db'], $l['admin']['e_db_is']."\n".mysqli_connect_error()); die("".$l['db_error']."
".$l['plz_try_again']."."); } diff --git a/scripts/update/113To120.php b/scripts/update/113To120.php new file mode 100644 index 0000000..0372d7b --- /dev/null +++ b/scripts/update/113To120.php @@ -0,0 +1,15 @@ +Bitte beachten Sie, dass nach Durchführung dieses Updates eventuell einzelne Plugins nicht mehr funktionieren.
' + . 'Kontaktieren Sie in einem solchen Fall den Plugin-Autor bzzgl. eines Updates für das Plugin.

'; + } + + function performUpdate($l, $settings) + { + return true; + } +} diff --git a/setup.php b/setup.php index 08a4d2d..2f1cf57 100644 --- a/setup.php +++ b/setup.php @@ -177,7 +177,7 @@ global $l; global $mysql; - if(!($mysql = @mysqli_connect($data['jlog_db_url'], $data['jlog_db_user'], $data['jlog_db_pwd'], $data['jlog_db']))) $errors[] = "Falsche Zugangsdaten | ".mysqli_error($mysql); + if(!($mysql = @mysqli_connect($data['jlog_db_url'], $data['jlog_db_user'], $data['jlog_db_pwd'], $data['jlog_db']))) $errors[] = "Falsche Zugangsdaten | ".mysqli_connect_error(); elseif(!@mysqli_select_db($mysql, $data['jlog_db'])) $errors[] = "Datenbank ".$data['jlog_db']." extistiert nicht".mysqli_error($connect); elseif(!version_compare(mysqli_get_server_info($mysql), JLOG_MYSQLV, ">=") == 1) $errors[] = $l['admin']['s_mysqlv_tolow']; else {