diff --git a/includes/libs/DbSimple/Mysqli.php b/includes/libs/DbSimple/Mysqli.php index 2329e607..6b67dd14 100644 --- a/includes/libs/DbSimple/Mysqli.php +++ b/includes/libs/DbSimple/Mysqli.php @@ -30,7 +30,7 @@ class DbSimple_Mysqli extends DbSimple_Database * constructor(string $dsn) * Connect to MySQL server. */ - function DbSimple_Mysqli($dsn) + function __construct($dsn) { if (!is_callable("mysqli_connect")) @@ -178,7 +178,7 @@ class DbSimple_Mysqli extends DbSimple_Database protected function _performFetch($result) { $row = mysqli_fetch_assoc($result); - if (mysql_error()) return $this->_setDbError($this->_lastQuery); + if (mysqli_error($this->link)) return $this->_setDbError($this->_lastQuery); if ($row === false) return null; return $row; } diff --git a/pages/achievement.php b/pages/achievement.php index 6d870f89..26a98e33 100644 --- a/pages/achievement.php +++ b/pages/achievement.php @@ -466,10 +466,10 @@ class AchievementPage extends GenericPage die($tt); } - public function notFound() + public function notFound($title = '', $msg = '') { if ($this->mode != CACHE_TYPE_TOOLTIP) - return parent::notFound(Lang::game('achievement'), Lang::achievement('notFound')); + return parent::notFound($title ?: Lang::game('achievement'), $msg ?: Lang::achievement('notFound')); header('Content-type: application/x-javascript; charset=utf-8'); echo $this->generateTooltip(true); diff --git a/pages/currency.php b/pages/currency.php index 1b23f449..2e4510f8 100644 --- a/pages/currency.php +++ b/pages/currency.php @@ -29,7 +29,7 @@ class CurrencyPage extends GenericPage $this->subject = new CurrencyList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::game('currency'), Lang::currency('notFound')); + $this->notFound(); $this->name = $this->subject->getField('name', true); } @@ -259,10 +259,10 @@ class CurrencyPage extends GenericPage die($tt); } - public function notFound() + public function notFound($title = '', $msg = '') { if ($this->mode != CACHE_TYPE_TOOLTIP) - return parent::notFound(Lang::game('currency'), Lang::currency('notFound')); + return parent::notFound($title ?: Lang::game('currency'), $msg ?: Lang::currency('notFound')); header('Content-type: application/x-javascript; charset=utf-8'); echo $this->generateTooltip(true); diff --git a/pages/event.php b/pages/event.php index a904abfc..5a6b570d 100644 --- a/pages/event.php +++ b/pages/event.php @@ -32,7 +32,7 @@ class EventPage extends GenericPage $this->subject = new WorldEventList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::game('event'), Lang::event('notFound')); + $this->notFound(); $this->hId = $this->subject->getField('holidayId'); $this->eId = $this->typeId; @@ -358,10 +358,10 @@ class EventPage extends GenericPage die(sprintf($tt, $start, $end)); } - public function notFound() + public function notFound($title = '', $msg = '') { if ($this->mode != CACHE_TYPE_TOOLTIP) - return parent::notFound(Lang::game('event'), Lang::event('notFound')); + return parent::notFound($title ?: Lang::game('event'), $msg ?: Lang::event('notFound')); header('Content-type: application/x-javascript; charset=utf-8'); echo $this->generateTooltip(true); diff --git a/pages/item.php b/pages/item.php index b6c5223c..1466dd4d 100644 --- a/pages/item.php +++ b/pages/item.php @@ -1182,7 +1182,7 @@ class ItemPage extends genericPage return parent::display($override); } - public function notFound() + public function notFound($title = '', $msg = '') { if ($this->mode == CACHE_TYPE_TOOLTIP) { @@ -1197,7 +1197,7 @@ class ItemPage extends genericPage exit(); } else - return parent::notFound(Lang::game('item'), Lang::item('notFound')); + return parent::notFound($title ?: Lang::game('item'), $msg ?: Lang::item('notFound')); } } diff --git a/pages/itemset.php b/pages/itemset.php index 52e19699..ea046c61 100644 --- a/pages/itemset.php +++ b/pages/itemset.php @@ -33,7 +33,7 @@ class ItemsetPage extends GenericPage $this->subject = new ItemsetList(array(['id', $this->typeId])); if ($this->subject->error) - $this->notFound(Lang::game('itemset'), Lang::itemset('notFound')); + $this->notFound(); $this->name = $this->subject->getField('name', true); $this->extendGlobalData($this->subject->getJSGlobals()); @@ -260,10 +260,10 @@ class ItemsetPage extends GenericPage die($tt); } - public function notFound() + public function notFound($title = '', $msg = '') { if ($this->mode != CACHE_TYPE_TOOLTIP) - return parent::notFound(Lang::game('itemset'), Lang::itemset('notFound')); + return parent::notFound($title ?: Lang::game('itemset'), $msg ?: Lang::itemset('notFound')); header('Content-type: application/x-javascript; charset=utf-8'); echo $this->generateTooltip(true); diff --git a/pages/npc.php b/pages/npc.php index 17d34173..48283a4f 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -817,10 +817,10 @@ class NpcPage extends GenericPage die($tt); } - public function notFound() + public function notFound($title = '', $msg = '') { if ($this->mode != CACHE_TYPE_TOOLTIP) - return parent::notFound(Lang::game('npc'), Lang::npc('notFound')); + return parent::notFound($title ?: Lang::game('npc'), $msg ?: Lang::npc('notFound')); header('Content-type: application/x-javascript; charset=utf-8'); echo $this->generateTooltip(true); diff --git a/pages/object.php b/pages/object.php index 1a51f2fd..e93e42eb 100644 --- a/pages/object.php +++ b/pages/object.php @@ -498,10 +498,10 @@ class ObjectPage extends GenericPage die($tt); } - public function notFound() + public function notFound($title = '', $msg = '') { if ($this->mode != CACHE_TYPE_TOOLTIP) - return parent::notFound(Lang::game('object'), Lang::gameObject('notFound')); + return parent::notFound($title ?: Lang::game('object'), $msg ?: Lang::gameObject('notFound')); header('Content-type: application/x-javascript; charset=utf-8'); echo $this->generateTooltip(true); diff --git a/pages/profile.php b/pages/profile.php index c348f4ac..b702a716 100644 --- a/pages/profile.php +++ b/pages/profile.php @@ -122,10 +122,10 @@ class ProfilePage extends GenericPage die($this->generateTooltip()); } - public function notFound() + public function notFound($title = '', $msg = '') { if ($this->mode != CACHE_TYPE_TOOLTIP) - return parent::notFound(Util::ucFirst(Lang::game('profile')), '[NNF]profile or char doesn\'t exist'); + return parent::notFound($title ?: Util::ucFirst(Lang::game('profile')), $msg ?: '[NNF]profile or char doesn\'t exist'); header('Content-type: application/x-javascript; charset=utf-8'); echo $this->generateTooltip(true); diff --git a/pages/quest.php b/pages/quest.php index f152cb04..844bd00a 100644 --- a/pages/quest.php +++ b/pages/quest.php @@ -696,10 +696,10 @@ class QuestPage extends GenericPage die($tt); } - public function notFound() + public function notFound($title = '', $msg = '') { if ($this->mode != CACHE_TYPE_TOOLTIP) - return parent::notFound(Lang::game('quest'), Lang::quest('notFound')); + return parent::notFound($title ?: Lang::game('quest'), $msg ?: Lang::quest('notFound')); header('Content-type: application/x-javascript; charset=utf-8'); echo $this->generateTooltip(true); diff --git a/pages/search.php b/pages/search.php index 408d2fb8..1615cbf4 100644 --- a/pages/search.php +++ b/pages/search.php @@ -196,7 +196,7 @@ class SearchPage extends GenericPage $this->performSearch(); } - public function notFound() + public function notFound($title = '', $msg = '') { if ($this->searchMask & SEARCH_TYPE_REGULAR) { diff --git a/pages/spell.php b/pages/spell.php index af7c182e..c638ba6c 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -1211,10 +1211,10 @@ class SpellPage extends GenericPage die($tt); } - public function notFound() + public function notFound($title = '', $msg = '') { if ($this->mode != CACHE_TYPE_TOOLTIP) - return parent::notFound(Lang::game('spell'), Lang::spell('notFound')); + return parent::notFound($title ?: Lang::game('spell'), $msg ?: Lang::spell('notFound')); header('Content-type: application/x-javascript; charset=utf-8'); echo $this->generateTooltip(true); diff --git a/setup/tools/clisetup/firstrun.func.php b/setup/tools/clisetup/firstrun.func.php index 5478219a..853cdb6f 100644 --- a/setup/tools/clisetup/firstrun.func.php +++ b/setup/tools/clisetup/firstrun.func.php @@ -110,7 +110,7 @@ function firstrun() fclose($h); }; - $testDB = function(&$error) + function testDB(&$error) { require 'config/config.php'; @@ -133,9 +133,9 @@ function firstrun() } return empty($error); - }; + } - $testSelf = function(&$error) + function testSelf(&$error) { $error = []; $test = function($url, &$rCode) @@ -171,13 +171,13 @@ function firstrun() $error[] = ' * STATIC_HOST is empty'; return empty($error); - }; + } - $testAcc = function(&$error) + function testAcc(&$error) { $error = []; return !!DB::Aowow()->selectCell('SELECT id FROM ?_account WHERE userPerms = 1'); - }; + } function endSetup() { @@ -243,7 +243,7 @@ function firstrun() // check script result if ($step[2]) { - if (!$$step[2]($errors)) + if (!$step[2]($errors)) { CLISetup::log($step[4], CLISetup::LOG_ERROR); foreach ($errors as $e) diff --git a/setup/tools/fileGen.class.php b/setup/tools/fileGen.class.php index a10a5abd..f9042d0b 100644 --- a/setup/tools/fileGen.class.php +++ b/setup/tools/fileGen.class.php @@ -210,7 +210,7 @@ class FileGen // check for required auxiliary DBC files foreach ($reqDBC as $req) if (!CLISetup::loadDBC($req)) - continue 2; + continue; // must generate content // PH format: /*setup:*/