diff --git a/includes/class.user.php b/includes/class.user.php index 369f28d5..e4a82fc5 100644 --- a/includes/class.user.php +++ b/includes/class.user.php @@ -50,13 +50,13 @@ class User { self::$id = $userId; - $ipBan = DB::Auth()->SelectRow('SELECT count, unbanDate AS unbanDateIP FROM ?_account_bannedIPs WHERE ip = ?s AND type = 0', + $ipBan = DB::Aowow()->SelectRow('SELECT count, unbanDate AS unbanDateIP FROM ?_account_bannedIPs WHERE ip = ?s AND type = 0', $_SERVER['REMOTE_ADDR'] ); // explicit " > "; incremented first, checked after self::$bannedIP = $ipBan && $ipBan['count'] > $GLOBALS['AoWoWconf']['loginFailCount'] && $ipBan['unbanDateIP'] > time(); - $query = !$userId ? null : DB::Auth()->SelectRow(' + $query = !$userId ? null : DB::Aowow()->SelectRow(' SELECT a.id, a.authId, a.user, a.passHash, a.displayName, a.email, a.lastIP, a.lastLogin, a.joindate, a.locale, a.avatar, a.description, a.userGroups, a.userPerms, a.timeout, ab.bannedBy, ab.banReason, ab.isActive, ab.unbanDate @@ -109,7 +109,7 @@ class User $loc = isset(Util::$localeStrings[$set]) ? $set : 0; if (self::$id) { - DB::Auth()->query('UPDATE ?_account SET locale = ? WHERE id = ?', + DB::Aowow()->query('UPDATE ?_account SET locale = ? WHERE id = ?', $loc, self::$id ); @@ -175,7 +175,7 @@ class User // return AUTH_TIMEDOUT; if (self::$timeout > 0) - DB::Auth()->query('UPDATE ?_account SET timeout = ?d WHERE id = ?d', + DB::Aowow()->query('UPDATE ?_account SET timeout = ?d WHERE id = ?d', time() + $GLOBALS['AoWoWconf']['sessionTimeout'], self::$id ); @@ -247,7 +247,7 @@ class User { self::$passHash = self::hashCrypt($pass); - DB::Auth()->query('UPDATE ?_account SET passHash = ?s WHERE id = ?d', + DB::Aowow()->query('UPDATE ?_account SET passHash = ?s WHERE id = ?d', self::$passHash, self::$id ); diff --git a/includes/utilities.php b/includes/utilities.php index ca84c903..e68ef1fc 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -395,13 +395,15 @@ trait spawnHelper class Lang { public static $main; - public static $search; + public static $account; public static $game; public static $error; - public static $account; - public static $achievement; + public static $search; public static $compare; + public static $talent; + + public static $achievement; public static $currency; public static $event; public static $item; @@ -411,7 +413,6 @@ class Lang public static $pet; public static $quest; public static $spell; - public static $talent; public static $title; public static $zone; @@ -765,7 +766,7 @@ class SmartyAoWoW extends Smarty case TYPE_CLASS: $jsg[TYPE_CLASS] = ['classes', []]; break; case TYPE_RACE: $jsg[TYPE_RACE] = ['races', []]; break; case TYPE_SKILL: $jsg[TYPE_SKILL] = ['skills', []]; break; - case TYPE_CURRENCY: $jsg[TYPE_CURRENCY] = ['curencies', []]; break; + case TYPE_CURRENCY: $jsg[TYPE_CURRENCY] = ['currencies', []]; break; } } @@ -970,10 +971,10 @@ class Util public static $dateFormatLong = "Y/m/d H:i:s"; public static $changeLevelString = '%s'; - public static $setRatingLevelString = '%s'; + public static $setRatingLevelString = '%s'; - public static $filterResultString = 'sprintf(%s, %s, %s) + LANG.dash + LANG.lvnote_tryfiltering.replace(\'\', \'\')'; - public static $narrowResultString = 'sprintf(%s, %s, %s) + LANG.dash + LANG.lvnote_trynarrowing'; + public static $filterResultString = '$WH.sprintf(%s, %s, %s) + LANG.dash + LANG.lvnote_tryfiltering.replace(\'\', \'\')'; + public static $narrowResultString = '$WH.sprintf(%s, %s, %s) + LANG.dash + LANG.lvnote_trynarrowing'; public static $setCriteriaString = "fi_setCriteria(%s, %s, %s);\n"; public static $dfnString = '%s'; @@ -1580,6 +1581,8 @@ class Util 'large' => 'style="background-image: url(%s/images/icons/large/%s.jpg)"', ); + public static $tcEncoding = '0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevElBCDFHJKOPQSUWXYZ123456789'; + private static $execTime = 0.0; public static function execTime($set = false) diff --git a/index.php b/index.php index e4608275..e31fa75e 100644 --- a/index.php +++ b/index.php @@ -62,8 +62,9 @@ switch ($pageCall) else $smarty->error(); break; - case 'talent': // tool: talent calculator case 'petcalc': // tool: pet talent calculator + $petCalc = true; + case 'talent': // tool: talent calculator require 'pages/talent.php'; break; /* called by script */ diff --git a/pages/account.php b/pages/account.php index 85cf2809..5f92411a 100644 --- a/pages/account.php +++ b/pages/account.php @@ -39,27 +39,27 @@ function signin() $remember = $_POST['remember_me'] == 'yes'; // handle login try limitation - $ipBan = DB::Auth()->selectRow('SELECT ip, count, UNIX_TIMESTAMP(unbanDate) as unbanDate FROM ?_account_bannedIPs WHERE type = 0 AND ip = ?s', + $ipBan = DB::Aowow()->selectRow('SELECT ip, count, UNIX_TIMESTAMP(unbanDate) as unbanDate FROM ?_account_bannedIPs WHERE type = 0 AND ip = ?s', $_SERVER['REMOTE_ADDR'] ); if (!$ipBan) // no entry exists; set count to 1 - DB::Auth()->query('INSERT INTO ?_account_bannedIPs VALUES (?s, 0, 1, FROM_UNIXTIME(?))', + DB::Aowow()->query('INSERT INTO ?_account_bannedIPs VALUES (?s, 0, 1, FROM_UNIXTIME(?))', $_SERVER['REMOTE_ADDR'], time() + $GLOBALS['AoWoWconf']['loginFailTime'] ); else if ($ipBan['unbanDate'] < time()) // ip has accumulated counts but time expired; reset count to 1 - DB::Auth()->query('INSERT IGNORE INTO ?_account_bannedIPs VALUES (?s, 0, 1, ?)', + DB::Aowow()->query('INSERT IGNORE INTO ?_account_bannedIPs VALUES (?s, 0, 1, ?)', $_SERVER['REMOTE_ADDR'], time() + $GLOBALS['AoWoWconf']['loginFailTime'] ); else // entry already exists; increment count - DB::Auth()->query('UPDATE ?_account_bannedIPs SET count = count + 1, unbanDate = FROM_UNIXTIME(?) WHERE ip = ?s', + DB::Aowow()->query('UPDATE ?_account_bannedIPs SET count = count + 1, unbanDate = FROM_UNIXTIME(?) WHERE ip = ?s', time() + $GLOBALS['AoWoWconf']['loginFailTime'], $_SERVER['REMOTE_ADDR'] ); - $id = DB::Auth()->SelectCell('SELECT id FROM ?_account WHERE user = ?', + $id = DB::Aowow()->SelectCell('SELECT id FROM ?_account WHERE user = ?', Util::sqlEscape($username) ); @@ -71,10 +71,10 @@ function signin() switch (User::Auth($password)) { case AUTH_OK: - DB::Auth()->query('DELETE FROM ?_account_bannedIPs WHERE type = 0 AND ip = ?s', + DB::Aowow()->query('DELETE FROM ?_account_bannedIPs WHERE type = 0 AND ip = ?s', $_SERVER['REMOTE_ADDR'] ); - DB::Auth()->query('UPDATE ?_account SET lastLogin = FROM_UNIXTIME(?), timeout = FROM_UNIXTIME(?) WHERE id = ?', + DB::Aowow()->query('UPDATE ?_account SET lastLogin = FROM_UNIXTIME(?), timeout = FROM_UNIXTIME(?) WHERE id = ?', time(), $remember ? 0 : time() + $GLOBALS['AoWoWconf']['sessionTimeout'], $id @@ -247,16 +247,15 @@ function recoverUser() { } -$page = array( +$smarty->updatePageVars(array( 'reqCSS' => array( - array('path' => 'template/css/Profiler.css', 'condition' => false), + ['path' => 'template/css/Profiler.css'], ), - 'reqJS' => array( - array('path' => 'template/js/user.js'), - array('path' => 'template/js/profile.js'), + 'reqJS' => array( + 'template/js/user.js', + 'template/js/profile.js', ), -); -$smarty->updatePageVars($page); +)); $smarty->assign('lang', array_merge(Lang::$main, Lang::$account)); diff --git a/pages/achievement.php b/pages/achievement.php index 09b63145..3abed4d6 100644 --- a/pages/achievement.php +++ b/pages/achievement.php @@ -387,6 +387,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData)) $smarty->saveCache($cacheKeyPage, $pageData); } + // menuId 9: Achievement g_initPath() // tabId 0: Database g_initHeader() $smarty->updatePageVars(array( @@ -396,7 +397,6 @@ $smarty->updatePageVars(array( 'type' => TYPE_ACHIEVEMENT, 'typeId' => $id )); - $smarty->assign('community', CommunityContent::getAll(TYPE_ACHIEVEMENT, $id)); // comments, screenshots, videos $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$achievement)); $smarty->assign('lvData', $pageData); diff --git a/pages/achievements.php b/pages/achievements.php index 928ab4e2..d4b28c4f 100644 --- a/pages/achievements.php +++ b/pages/achievements.php @@ -101,23 +101,26 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter)) $smarty->saveCache($cacheKey, $pageData, $filter); } -$page = array( - 'tab' => 0, // for g_initHeader($tab) - 'subCat' => $pageParam ? '='.$pageParam : '', - 'title' => implode(" - ", $title), - 'path' => "[".implode(", ", $path)."]", - 'reqJS' => array( - array('path' => 'template/js/filters.js', 'conditional' => false), - ), -); // sort for dropdown-menus asort(Lang::$game['si']); -$smarty->updatePageVars($page); +// menuId 9: Achievement g_initPath() +// tabId 0: Database g_initHeader() +$smarty->updatePageVars(array( + 'title' => implode(" - ", $title), + 'path' => "[".implode(", ", $path)."]", + 'tab' => 0, + 'subCat' => $pageParam ? '='.$pageParam : '', + 'reqJS' => array( + 'template/js/filters.js' + ) +)); $smarty->assign('filter', $filter); $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$achievement)); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('achievements.tpl'); ?> diff --git a/pages/classes.php b/pages/classes.php index 05751e26..562a02ed 100644 --- a/pages/classes.php +++ b/pages/classes.php @@ -20,15 +20,17 @@ if (!$smarty->loadCache($cacheKey, $pageData)) } -$page = array( - 'tab' => 0, // for g_initHeader($tab) +// menuId 12: Class g_initPath() +// tabId 0: Database g_initHeader() +$smarty->updatePageVars(array( 'title' => Util::ucFirst(Lang::$game['classes']), 'path' => "[0, 12]", -); - -$smarty->updatePageVars($page); + 'tab' => 0 +)); $smarty->assign('lang', Lang::$main); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('generic-no-filter.tpl'); ?> diff --git a/pages/compare.php b/pages/compare.php index c5eb8a80..802d8f09 100644 --- a/pages/compare.php +++ b/pages/compare.php @@ -53,23 +53,26 @@ if ($compareString) } +// tabId 1: Tools g_initHeader() $smarty->updatePageVars(array( 'title' => Lang::$compare['compare'], 'tab' => 1, 'reqCSS' => array( - array('path' => 'template/css/Summary.css', 'condition' => false), - array('path' => 'template/css/Summary_ie6.css', 'condition' => 'lte IE 6'), + ['path' => 'template/css/Summary.css'], + ['path' => 'template/css/Summary_ie6.css', 'ieCond' => 'lte IE 6'], ), 'reqJS' => array( - array('path' => 'template/js/Draggable.js'), - array('path' => 'template/js/filters.js'), - array('path' => 'template/js/Summary.js'), - array('path' => 'template/js/swfobject.js'), - array('path' => '?data=weight-presets.gems.enchants.itemsets'), + 'template/js/Draggable.js', + 'template/js/filters.js', + 'template/js/Summary.js', + 'template/js/swfobject.js', + '?data=weight-presets.gems.enchants.itemsets' ), )); $smarty->assign('lvData', $pageData); $smarty->assign('lang', array_merge(Lang::$main, Lang::$compare)); + +// load the page $smarty->display('compare.tpl'); ?> diff --git a/pages/currencies.php b/pages/currencies.php index 9f7fb5b1..302903ec 100644 --- a/pages/currencies.php +++ b/pages/currencies.php @@ -35,15 +35,17 @@ if (!$smarty->loadCache($cacheKey, $pageData)) } -$page = array( - 'tab' => 0, // for g_initHeader($tab) +// menuId 15: Currency g_initPath() +// tabId 0: Database g_initHeader() +$smarty->updatePageVars(array( + 'tab' => 0, 'title' => implode(" - ", $title), 'path' => "[".implode(", ", $path)."]" -); - -$smarty->updatePageVars($page); +)); $smarty->assign('lang', Lang::$main); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('generic-no-filter.tpl'); ?> diff --git a/pages/events.php b/pages/events.php index 20965971..bd09648e 100644 --- a/pages/events.php +++ b/pages/events.php @@ -78,15 +78,17 @@ foreach ($pageData['data'] as &$data) } -$page = array( - 'tab' => 0, // for g_initHeader($tab) +// menuId 11: Event g_initPath() +// tabId 0: Database g_initHeader() +$smarty->updatePageVars(array( 'title' => implode(" - ", $title), - 'path' => "[".implode(", ", $path)."]" -); - -$smarty->updatePageVars($page); + 'path' => "[".implode(", ", $path)."]", + 'tab' => 0 +)); $smarty->assign('lang', Lang::$main); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('generic-no-filter.tpl'); ?> diff --git a/pages/item.php b/pages/item.php index 36b458dd..cf1f27c7 100644 --- a/pages/item.php +++ b/pages/item.php @@ -809,6 +809,7 @@ if (!$smarty->loadCache($cacheKeyPage, $item)) $smarty->saveCache($cacheKeyPage, $pageData); } + // menuId 0: Item g_initPath() // tabId 0: Database g_initHeader() $smarty->updatePageVars(array( @@ -819,7 +820,6 @@ $smarty->updatePageVars(array( 'type' => TYPE_ITEM, 'typeid' => $id )); - $smarty->assign('community', CommunityContent::getAll(TYPE_ITEM, $id)); // comments, screenshots, videos $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$item, ['colon' => Lang::$colon])); $smarty->assign('lvData', $pageData); diff --git a/pages/itemset.php b/pages/itemset.php index 94838b1f..42b831fc 100644 --- a/pages/itemset.php +++ b/pages/itemset.php @@ -237,22 +237,25 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData)) $smarty->saveCache($cacheKeyPage, $pageData); } + +// menuId 2: Itemset g_initPath() +// tabId 0: Database g_initHeader() $smarty->updatePageVars(array( 'title' => $pageData['title']." - ".Util::ucfirst(Lang::$game['itemset']), 'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK), - 'tab' => 0, // for g_initHeader($tab) - 'type' => TYPE_ITEMSET, // 4:Itemset + 'tab' => 0, + 'type' => TYPE_ITEMSET, 'typeId' => $id, 'reqJS' => array( - array('path' => 'template/js/Summary.js', 'conditional' => false), - array('path' => 'template/js/swfobject.js', 'conditional' => false) + 'template/js/Summary.js', + 'template/js/swfobject.js' ) )); - - $smarty->assign('community', CommunityContent::getAll(TYPE_ITEMSET, $id)); // comments, screenshots, videos $smarty->assign('lang', array_merge(Lang::$main, Lang::$itemset)); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('itemset.tpl'); ?> diff --git a/pages/itemsets.php b/pages/itemsets.php index 3f9a254a..252fa46b 100644 --- a/pages/itemsets.php +++ b/pages/itemsets.php @@ -44,25 +44,27 @@ if (!$smarty->loadCache($cacheKey, $pageData)) } -$page = array( - 'tab' => 0, // for g_initHeader($tab) - 'subCat' => $pageParam ? '='.$pageParam : '', - 'title' => Util::ucFirst(Lang::$game['itemsets']), - 'path' => json_encode($path, JSON_NUMERIC_CHECK), - 'reqJS' => array( - array('path' => 'template/js/filters.js', 'conditional' => false), - array('path' => '?data=weight-presets', 'conditional' => false), - ) -); - // sort for dropdown-menus asort(Lang::$itemset['notes'], SORT_NATURAL); asort(Lang::$game['cl']); -$smarty->updatePageVars($page); +// menuId 2: Itemset g_initPath() +// tabId 0: Database g_initHeader() +$smarty->updatePageVars(array( + 'title' => Util::ucFirst(Lang::$game['itemsets']), + 'path' => json_encode($path, JSON_NUMERIC_CHECK), + 'tab' => 0, + 'subCat' => $pageParam ? '='.$pageParam : '', + 'reqJS' => array( + 'template/js/filters.js', + '?data=weight-presets' + ) +)); $smarty->assign('filter', $filter); $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$itemset, Lang::$item)); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('itemsets.tpl'); ?> diff --git a/pages/main.php b/pages/main.php index 98c83d55..58e30383 100644 --- a/pages/main.php +++ b/pages/main.php @@ -19,6 +19,8 @@ foreach ($rows as $i => $row) $smarty->assign('news', isset($rows) ? $rows : NULL); $smarty->assign('lang', Lang::$main); + +// load the page $smarty->display('main.tpl'); ?> diff --git a/pages/maps.php b/pages/maps.php index dc65bc28..27903abc 100644 --- a/pages/maps.php +++ b/pages/maps.php @@ -4,24 +4,24 @@ if (!defined('AOWOW_REVISION')) die('illegal access'); -$page = array( +// tabId 1: Tools g_initHeader() +$smarty->updatePageVars(array( + 'title' => Lang::$maps['maps'], + 'tab' => 1, 'reqCSS' => array( - array('string' => 'zone-picker { margin-left: 4px }'), - array('path' => 'template/css/Mapper.css', 'condition' => false), - array('path' => 'template/css/Mapper_ie6.css', 'condition' => 'lte IE 6'), + ['string' => 'zone-picker { margin-left: 4px }'], + ['path' => 'template/css/Mapper.css'], + ['path' => 'template/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6'] ), 'reqJS' => array( - array('path' => 'template/js/maps.js'), - array('path' => 'template/js/Mapper.js'), - array('path' => '?data=zones'), - ), - 'title' => Lang::$maps['maps'], - 'tab' => 1 -); - - -$smarty->updatePageVars($page); + 'template/js/maps.js', + 'template/js/Mapper.js', + '?data=zones' + ) +)); $smarty->assign('lang', array_merge(Lang::$main, Lang::$maps)); + +// load the page $smarty->display('maps.tpl'); ?> diff --git a/pages/npc.php b/pages/npc.php index a9c8c6f3..aebedf71 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -467,7 +467,8 @@ $rows_qe = $DB->select(' $smarty->saveCache($cacheKeyPage, $pageData); } -// menuId 4: Npc g_initPath() + +// menuId 4: NPC g_initPath() // tabId 0: Database g_initHeader() $smarty->updatePageVars(array( 'mapper' => true, @@ -477,7 +478,6 @@ $smarty->updatePageVars(array( 'type' => TYPE_NPC, 'typeId' => $id )); - $smarty->assign('community', CommunityContent::getAll(TYPE_NPC, $id)); // comments, screenshots, videos $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$npc, ['colon' => Lang::$colon])); $smarty->assign('lvData', $pageData); diff --git a/pages/pet.php b/pages/pet.php index 1f9a188c..9819e2db 100644 --- a/pages/pet.php +++ b/pages/pet.php @@ -6,9 +6,7 @@ if (!defined('AOWOW_REVISION')) require 'includes/class.community.php'; -$id = intVal($pageParam); -$petCalc = '0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevElBCDFHJKOPQSUWXYZ123456789'; - +$id = intVal($pageParam); $cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_PET, $id, -1, User::$localeId]); @@ -34,7 +32,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData)) 'title' => $pet->getField('name', true), 'path' => '[0, 8, '.$pet->getField('type').']', 'page' => array( - 'petCalc' => $petCalc[(int)($id / 10)] . $petCalc[(2 * ($id % 10) + ($pet->getField('exotic') ? 1 : 0))], + 'petCalc' => Util::$tcEncoding[(int)($id / 10)] . Util::$tcEncoding[(2 * ($id % 10) + ($pet->getField('exotic') ? 1 : 0))], 'name' => $pet->getField('name', true), 'id' => $id, 'icon' => $pet->getField('iconString'), @@ -165,21 +163,24 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData)) $smarty->saveCache($cacheKeyPage, $pageData); } + +// menuId 8: Pets g_initPath() +// tabid 0: Database g_initHeader() $smarty->updatePageVars(array( 'title' => $pageData['title']." - ".Util::ucfirst(Lang::$game['pet']), 'path' => $pageData['path'], - 'tab' => 0, // for g_initHeader($tab) - 'type' => TYPE_PET, // 9:Pets + 'tab' => 0, + 'type' => TYPE_PET, 'typeId' => $id, 'reqJS' => array( - array('path' => 'template/js/swfobject.js') + 'template/js/swfobject.js' ) )); - - $smarty->assign('community', CommunityContent::getAll(TYPE_PET, $id)); // comments, screenshots, videos $smarty->assign('lang', array_merge(Lang::$main, Lang::$game)); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('pet.tpl'); ?> diff --git a/pages/pets.php b/pages/pets.php index 5f9a5587..60c9a0fc 100644 --- a/pages/pets.php +++ b/pages/pets.php @@ -40,15 +40,17 @@ if (!$smarty->loadCache($cacheKey, $pageData)) } -$page = array( - 'tab' => 0, // for g_initHeader($tab) +// menuId 8: Pets g_initPath() +// tabid 0: Database g_initHeader() +$smarty->updatePageVars(array( 'title' => implode(" - ", $title), - 'path' => "[".implode(", ", $path)."]" -); - -$smarty->updatePageVars($page); + 'path' => "[".implode(", ", $path)."]", + 'tab' => 0 +)); $smarty->assign('lang', Lang::$main); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('generic-no-filter.tpl'); ?> diff --git a/pages/quest.php b/pages/quest.php index c8fcac71..511e5990 100644 --- a/pages/quest.php +++ b/pages/quest.php @@ -599,6 +599,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData)) $smarty->saveCache($cacheKeyPage, $pageData); } + // menuId 3: Quest g_initPath() // tabId 0: Database g_initHeader() $smarty->updatePageVars(array( diff --git a/pages/races.php b/pages/races.php index f6e34b3e..3c79bc7f 100644 --- a/pages/races.php +++ b/pages/races.php @@ -20,15 +20,17 @@ if (!$smarty->loadCache($cacheKey, $pageData)) } -$page = array( - 'tab' => 0, // for g_initHeader($tab) +// menuId 13: Race g_initPath() +// tabId 0: Database g_initHeader() +$smarty->updatePageVars(array( 'title' => Util::ucFirst(Lang::$game['races']), 'path' => "[0, 13]", -); - -$smarty->updatePageVars($page); + 'tab' => 0 +)); $smarty->assign('lang', Lang::$main); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('generic-no-filter.tpl'); ?> diff --git a/pages/spell.php b/pages/spell.php index a9b1619d..e6badb7c 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -921,6 +921,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData)) $smarty->saveCache($cacheKeyPage, $pageData); } + // menuId 1: Spell g_initPath() // tabId 0: Database g_initHeader() $smarty->updatePageVars(array( @@ -929,11 +930,10 @@ $smarty->updatePageVars(array( 'tab' => 0, 'type' => TYPE_SPELL, 'typeId' => $id, - 'reqJS' => array ( - array('path' => 'template/js/swfobject.js') + 'reqJS' => array( + 'template/js/swfobject.js' ) )); - $smarty->assign('community', CommunityContent::getAll(TYPE_SPELL, $id)); // comments, screenshots, videos $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$spell, ['colon' => Lang::$colon])); $smarty->assign('lvData', $pageData); diff --git a/pages/spells.php b/pages/spells.php index 3cc16252..910a1761 100644 --- a/pages/spells.php +++ b/pages/spells.php @@ -424,15 +424,6 @@ if (isset($filter['gl']) && !is_array($filter['gl'])) $path[] = $filter['gl']; } -$page = array( - 'tab' => 0, // for g_initHeader($tab) - 'subCat' => $pageParam !== null ? '='.$pageParam : '', - 'title' => implode(" - ", $title), - 'path' => "[".implode(", ", $path)."]", - 'reqJS' => array( - array('path' => 'template/js/filters.js', 'conditional' => false), - ), -); // sort for dropdown-menus asort(Lang::$game['ra']); @@ -441,10 +432,22 @@ asort(Lang::$game['sc']); asort(Lang::$game['me']); Lang::$game['race'] = Util::ucFirst(Lang::$game['race']); -$smarty->updatePageVars($page); +// menuId 1: Spell g_initPath() +// tabId 0: Database g_initHeader() +$smarty->updatePageVars(array( + 'title' => implode(" - ", $title), + 'path' => "[".implode(", ", $path)."]", + 'tab' => 0, + 'subCat' => $pageParam !== null ? '='.$pageParam : '', + 'reqJS' => array( + 'template/js/filters.js' + ) +)); $smarty->assign('filter', $filter); $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$achievement)); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('spells.tpl'); ?> diff --git a/pages/talent.php b/pages/talent.php index cdee2c15..80e348ab 100644 --- a/pages/talent.php +++ b/pages/talent.php @@ -4,37 +4,31 @@ if (!defined('AOWOW_REVISION')) die('illegal access'); -$petCalc = $pageCall == 'petcalc'; +if (!isset($petCalc)) + $petCalc = false; -$page = array( +// tabId 1: Tools g_initHeader() +$smarty->updatePageVars(array( + 'title' => $petCalc ? Lang::$talent['petCalc'] : Lang::$talent['talentCalc'], + 'tab' => 1, 'reqCSS' => array( - array('path' => 'template/css/TalentCalc.css', 'condition' => false), - array('path' => 'template/css/talent.css', 'condition' => false), - array('path' => 'template/css/TalentCalc_ie6.css', 'condition' => 'lte IE 6'), - array('path' => 'template/css/TalentCalc_ie67.css', 'condition' => 'lte IE 7') + ['path' => 'template/css/TalentCalc.css'], + ['path' => 'template/css/talent.css'], + ['path' => 'template/css/TalentCalc_ie6.css', 'ieCond' => 'lte IE 6'], + ['path' => 'template/css/TalentCalc_ie67.css', 'ieCond' => 'lte IE 7'], + $petCalc ? ['path' => 'template/css/petcalc.css'] : null ), 'reqJS' => array( - array('path' => '?data=glyphs'), - array('path' => 'template/js/talent.js'), - array('path' => 'template/js/TalentCalc.js') - ), - 'title' => Lang::$talent['talentCalc'], - 'tab' => 1, -); - -if ($petCalc) -{ - $page['reqCSS'][] = array('path' => 'template/css/petcalc.css', 'condition' => false); - $page['reqJS'][0] = array('path' => '?data=pet-talents.pets'); - $page['reqJS'][1] = array('path' => 'template/js/petcalc.js'); - $page['reqJS'][] = array('path' => 'template/js/swfobject.js'); - $page['title'] = Lang::$talent['petCalc']; -} - - -$smarty->updatePageVars($page); + 'template/js/TalentCalc.js', + $petCalc ? '?data=pet-talents.pets' : '?data=glyphs', + $petCalc ? 'template/js/petcalc.js' : 'template/js/talent.js', + $petCalc ? 'template/js/swfobject.js' : null + ) +)); $smarty->assign('tcType', $petCalc ? 'pc' : 'tc'); $smarty->assign('lang', array_merge(Lang::$main, Lang::$talent)); + +// load the page $smarty->display('talent.tpl'); ?> diff --git a/pages/title.php b/pages/title.php index 1704687b..6b2e0779 100644 --- a/pages/title.php +++ b/pages/title.php @@ -83,18 +83,21 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData)) $smarty->saveCache($cacheKeyPage, $pageData); } + +// menuId 10: Title g_initPath() +// tabId 0: Database g_initHeader() $smarty->updatePageVars(array( 'title' => $pageData['title']." - ".Util::ucfirst(Lang::$game['title']), 'path' => $pageData['path'], - 'tab' => 0, // for g_initHeader($tab) - 'type' => TYPE_TITLE, // 11:Titles + 'tab' => 0, + 'type' => TYPE_TITLE, 'typeId' => $id )); - - $smarty->assign('community', CommunityContent::getAll(TYPE_TITLE, $id)); // comments, screenshots, videos $smarty->assign('lang', array_merge(Lang::$main)); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('title.tpl'); ?> diff --git a/pages/titles.php b/pages/titles.php index b90c846a..59b0415d 100644 --- a/pages/titles.php +++ b/pages/titles.php @@ -38,15 +38,17 @@ if (!$smarty->loadCache($cacheKey, $pageData)) } -$page = array( - 'tab' => 0, // for g_initHeader($tab) +// menuId 10: Title g_initPath() +// tabId 0: Database g_initHeader() +$smarty->updatePageVars(array( 'title' => implode(" - ", $title), - 'path' => "[".implode(", ", $path)."]" -); - -$smarty->updatePageVars($page); + 'path' => "[".implode(", ", $path)."]", + 'tab' => 0 +)); $smarty->assign('lang', Lang::$main); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('generic-no-filter.tpl'); ?> diff --git a/pages/zones.php b/pages/zones.php index 22dd3570..460b232e 100644 --- a/pages/zones.php +++ b/pages/zones.php @@ -122,23 +122,26 @@ if (!$smarty->loadCache($cacheKey, $pageData)) $smarty->saveCache($cacheKey, $pageData); } -$page = array( - 'tab' => 0, // for g_initHeader($tab) + +// menuId 6: Zone g_initPath() +// tabId 0: Database g_initHeader() +$smarty->updatePageVars(array( 'title' => implode(' - ', $title), 'path' => json_encode($path, JSON_NUMERIC_CHECK), - 'reqJS' => array( - array('path' => 'template/js/Mapper.js', 'conditional' => false), - array('path' => 'template/js/ShowOnMap.js', 'conditional' => false), - ), + 'tab' => 0, 'reqCSS' => array( - array('path' => 'template/css/Mapper.css', 'condition' => false), - array('path' => 'template/css/Mapper_ie6.css', 'condition' => 'lte IE 6'), + ['path' => 'template/css/Mapper.css'], + ['path' => 'template/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6'] ), -); - -$smarty->updatePageVars($page); + 'reqJS' => array( + 'template/js/Mapper.js', + 'template/js/ShowOnMap.js' + ) +)); $smarty->assign('lang', Lang::$main); $smarty->assign('lvData', $pageData); + +// load the page $smarty->display('generic-no-filter.tpl'); ?> diff --git a/power/aowowPower.js b/power/aowowPower.js index 7cf29ac2..6de2c10c 100644 --- a/power/aowowPower.js +++ b/power/aowowPower.js @@ -63,12 +63,12 @@ if (typeof $WowheadPower == "undefined") { achievementcomplete: "Achievement earned by $1 on $2/$3/$4" }, LOOKUPS = { - 1 : [npcs, "npc", "NPC"], - 2 : [objects, "object", "Object"], - 3 : [items, "item", "Item"], - 5 : [quests, "quest", "Quest"], - 6 : [spells, "spell", "Spell"], - 10 : [achievements, "achievement", "Achievement"], + 1 : [npcs, "npc", "NPC"], + 2 : [objects, "object", "Object"], + 3 : [items, "item", "Item"], + 5 : [quests, "quest", "Quest"], + 6 : [spells, "spell", "Spell"], + 10 : [achievements, "achievement", "Achievement"], 100 : [profiles, "profile", "Profile"] }, LOCALES = { @@ -76,8 +76,7 @@ if (typeof $WowheadPower == "undefined") { 2 : "frfr", 3 : "dede", 6 : "eses", - 8 : "ruru", - 25 : "ptr" + 8 : "ruru" }, REDIRECTS = { wotlk: "www", @@ -455,7 +454,7 @@ if (typeof $WowheadPower == "undefined") { // custom start if ($WH.gc('compare_level') && window.location.href.match(/\?compare/i)) { - html = $WH.g_setTooltipItemLevel(html, gc('compare_level')); + html = $WH.g_setTooltipItemLevel(html, $WH.gc('compare_level')); } // custom end diff --git a/search.php b/search.php index 6a1bb269..6fda6e86 100644 --- a/search.php +++ b/search.php @@ -1020,13 +1020,15 @@ else /* if ($searchMask & SEARCH_TYPE_REGULAR) */ die(); } - $vars = array( - 'title' => $search.' - '.Lang::$search['search'], - 'tab' => 0, // tabId 0: Database for g_initHeader($tab) - 'reqJS' => [array('path' => 'template/js/swfobject.js', 'conditional' => false)] - ); - $smarty->updatePageVars($vars); + // tabId 0: Database g_initHeader() + $smarty->updatePageVars(array( + 'title' => $search.' - '.Lang::$search['search'], + 'tab' => 0, + 'reqJS' => array( + 'template/js/swfobject.js' + ) + )); $smarty->assign('lang', array_merge(Lang::$main, Lang::$search)); $smarty->assign('found', $found); $smarty->assign('lvData', $jsGlobals); diff --git a/template/achievement.tpl b/template/achievement.tpl index 8dc2b1da..54713dc3 100644 --- a/template/achievement.tpl +++ b/template/achievement.tpl @@ -64,7 +64,7 @@ {$lang.links}{$lang.links} @@ -108,7 +108,7 @@ @@ -124,7 +124,7 @@ {/foreach} @@ -148,7 +148,7 @@
| {$lvData.page.buff} | |