From bf42973c00cc6fe88b37b69ec62ac772f9cba852 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Wed, 28 Mar 2018 20:34:18 +0200 Subject: [PATCH] Profiler * further optimize search - use achievement 4496 as shortcut for everything based around total achievement points - get talent distribution separately - get total profiler-items found separately - opt to not sort found results * fixed Profiles with zero Achievement Points * added cache key genrator i forgot :< * fixed typos --- includes/basetype.class.php | 14 +++++- includes/types/profile.class.php | 75 +++++++++++++++----------------- pages/achievement.php | 2 +- pages/achievements.php | 2 +- pages/arenateam.php | 2 + pages/arenateams.php | 2 + pages/class.php | 2 +- pages/classes.php | 2 +- pages/currencies.php | 2 +- pages/currency.php | 2 +- pages/emote.php | 2 +- pages/emotes.php | 2 +- pages/enchantment.php | 2 +- pages/enchantments.php | 2 +- pages/event.php | 2 +- pages/events.php | 2 +- pages/faction.php | 2 +- pages/factions.php | 2 +- pages/genericPage.class.php | 14 +++++- pages/guild.php | 2 + pages/guilds.php | 2 + pages/icon.php | 2 +- pages/icons.php | 2 +- pages/item.php | 2 +- pages/items.php | 2 +- pages/itemset.php | 2 +- pages/itemsets.php | 2 +- pages/npc.php | 2 +- pages/npcs.php | 2 +- pages/object.php | 2 +- pages/objects.php | 2 +- pages/pet.php | 2 +- pages/pets.php | 2 +- pages/profile.php | 6 ++- pages/profiles.php | 4 +- pages/quest.php | 2 +- pages/quests.php | 2 +- pages/race.php | 2 +- pages/races.php | 2 +- pages/skill.php | 2 +- pages/skills.php | 2 +- pages/sound.php | 2 +- pages/sounds.php | 2 +- pages/spell.php | 2 +- pages/spells.php | 2 +- pages/title.php | 2 +- pages/titles.php | 2 +- pages/zones.php | 2 +- static/js/global.js | 4 +- 49 files changed, 117 insertions(+), 86 deletions(-) diff --git a/includes/basetype.class.php b/includes/basetype.class.php index f5b1acab..5e9e9f0c 100644 --- a/includes/basetype.class.php +++ b/includes/basetype.class.php @@ -257,12 +257,24 @@ abstract class BaseType // execute query (finally) $mtch = 0; + $rows = []; // this is purely because of multiple realms per server foreach ($this->dbNames as $dbIdx => $n) { $query = str_replace('DB_IDX', $dbIdx, $this->queryBase); - if ($rows = DB::{$n}($dbIdx)->SelectPage($mtch, $query)) + if (key($this->dbNames) === 0) + { + if ($rows = DB::{$n}($dbIdx)->select($query)) + { + $mtchQry = preg_replace('/SELECT .*? FROM/', 'SELECT count(1) FROM', $this->queryBase); + $mtch = DB::{$n}($dbIdx)->selectCell($mtchQry); + } + } + else + $rows = DB::{$n}($dbIdx)->SelectPage($mtch, $query); + + if ($rows) { $this->matches += $mtch; foreach ($rows as $id => $row) diff --git a/includes/types/profile.class.php b/includes/types/profile.class.php index c72bd575..8c7d4169 100644 --- a/includes/types/profile.class.php +++ b/includes/types/profile.class.php @@ -35,7 +35,7 @@ class ProfileList extends BaseType 'talenttree3' => $this->getField('talenttree3'), 'talentspec' => $this->getField('activespec') + 1, // 0 => 1; 1 => 2 'achievementpoints' => $this->getField('achievementpoints'), - 'guild' => '$"'.str_replace ('"', '', $this->curTpl['name']).'"', // force this to be a string + 'guild' => '$"'.str_replace ('"', '', $this->curTpl['guildname']).'"',// force this to be a string 'guildrank' => $this->getField('guildrank'), 'realm' => Profiler::urlize($this->getField('realmName')), 'realmname' => $this->getField('realmName'), @@ -181,7 +181,7 @@ class ProfileListFilter extends Filter protected $genericFilter = array( // misc (bool): _NUMERIC => useFloat; _STRING => localized; _FLAG => match Value; _BOOLEAN => stringSet 2 => [FILTER_CR_NUMERIC, 'gearscore', NUM_CAST_INT ], // gearscore [num] - 3 => [FILTER_CR_NUMERIC, 'achievementpoints', NUM_CAST_INT ], // achievementpoints [num] + 3 => [FILTER_CR_CALLBACK, 'cbAchievs', null, null], // achievementpoints [num] 5 => [FILTER_CR_NUMERIC, 'talenttree1', NUM_CAST_INT ], // talenttree1 [num] 6 => [FILTER_CR_NUMERIC, 'talenttree2', NUM_CAST_INT ], // talenttree2 [num] 7 => [FILTER_CR_NUMERIC, 'talenttree3', NUM_CAST_INT ], // talenttree3 [num] @@ -245,7 +245,7 @@ class ProfileListFilter extends Filter parent::__construct($fromPOST, $opts); if (!empty($this->fiData['c']['cr'])) - if (array_intersect($this->fiData['c']['cr'], [2, 3, 5, 6, 7, 21])) + if (array_intersect($this->fiData['c']['cr'], [2, 5, 6, 7, 21])) $this->useLocalList = true; } @@ -435,6 +435,17 @@ class ProfileListFilter extends Filter return ['AND', ['at.type', $this->enums[-1][$cr[0]]], ['at.rating', $cr[2], $cr[1]]]; } + + protected function cbAchievs($cr) + { + if (!Util::checkNumeric($cr[2], NUM_CAST_INT) || !$this->int2Op($cr[1])) + return false; + + if ($this->useLocalList) + return ['p.achievementpoints', $cr[2], $cr[1]]; + else + return ['cap.counter', $cr[2], $cr[1]]; + } } @@ -442,9 +453,8 @@ class RemoteProfileList extends ProfileList { protected $queryBase = 'SELECT `c`.*, `c`.`guid` AS ARRAY_KEY FROM characters c'; protected $queryOpts = array( - 'c' => [['gm', 'g', 'ca', 'ct'], 'g' => 'ARRAY_KEY', 'o' => 'level DESC, name ASC'], - 'ca' => ['j' => ['character_achievement ca ON ca.guid = c.guid', true], 's' => ', GROUP_CONCAT(DISTINCT ca.achievement SEPARATOR " ") AS _acvs'], - 'ct' => ['j' => ['character_talent ct ON ct.guid = c.guid AND ct.spec = c.activespec', true], 's' => ', GROUP_CONCAT(DISTINCT ct.spell SEPARATOR " ") AS _talents'], + 'c' => [['gm', 'g', 'cap']], // 12698: use criteria of Achievement 4496 as shortcut to get total achievement points + 'cap' => ['j' => ['character_achievement_progress cap ON cap.guid = c.guid AND cap.criteria = 12698', true], 's' => ', IFNULL(cap.counter, 0) AS achievementpoints'], 'gm' => ['j' => ['guild_member gm ON gm.guid = c.guid', true], 's' => ', gm.rank AS guildrank'], 'g' => ['j' => ['guild g ON g.guildid = gm.guildid', true], 's' => ', g.guildid AS guild, g.name AS guildname'], 'atm' => ['j' => ['arena_team_member atm ON atm.guid = c.guid', true], 's' => ', atm.personalRating AS rating'], @@ -466,14 +476,12 @@ class RemoteProfileList extends ProfileList return; reset($this->dbNames); // only use when querying single realm - $realmId = key($this->dbNames); - $realms = Profiler::getRealms(); - $acvCache = []; - $talentCache = []; - $atCache = []; - $distrib = null; - $talentData = []; - $limit = CFG_SQL_LIMIT_DEFAULT; + $realmId = key($this->dbNames); + $realms = Profiler::getRealms(); + $talentSpells = []; + $talentLookup = []; + $distrib = null; + $limit = CFG_SQL_LIMIT_DEFAULT; foreach ($conditions as $c) if (is_int($c)) @@ -486,7 +494,7 @@ class RemoteProfileList extends ProfileList $curTpl['battlegroup'] = CFG_BATTLEGROUP; // realm - $r = explode(':', $guid)[0]; + list($r, $g) = explode(':', $guid); if (!empty($realms[$r])) { $curTpl['realm'] = $r; @@ -503,17 +511,9 @@ class RemoteProfileList extends ProfileList // temp id $curTpl['id'] = 0; - // achievement points pre - if ($acvs = explode(' ', $curTpl['_acvs'])) - foreach ($acvs as $a) - if ($a && !isset($acvCache[$a])) - $acvCache[$a] = $a; - // talent points pre - if ($talents = explode(' ', $curTpl['_talents'])) - foreach ($talents as $t) - if ($t && !isset($talentCache[$t])) - $talentCache[$t] = $t; + $talentLookup[$r][$g] = []; + $talentSpells[] = $curTpl['class']; // equalize distribution if ($limit != CFG_SQL_LIMIT_NONE) @@ -527,8 +527,10 @@ class RemoteProfileList extends ProfileList $curTpl['cuFlags'] = 0; } - if ($talentCache) - $talentData = DB::Aowow()->select('SELECT spell AS ARRAY_KEY, tab, rank FROM ?_talents WHERE spell IN (?a)', $talentCache); + foreach ($talentLookup as $realm => $chars) + $talentLookup[$realm] = DB::Characters($realm)->selectCol('SELECT guid AS ARRAY_KEY, spell AS ARRAY_KEY2, spec FROM character_talent ct WHERE guid IN (?a)', array_keys($chars)); + + $talentSpells = DB::Aowow()->select('SELECT spell AS ARRAY_KEY, tab, rank FROM ?_talents WHERE class IN (?a)', array_unique($talentSpells)); if ($distrib !== null) { @@ -537,9 +539,6 @@ class RemoteProfileList extends ProfileList $d = ceil($limit * $d / $total); } - if ($acvCache) - $acvCache = DB::Aowow()->selectCol('SELECT id AS ARRAY_KEY, points FROM ?_achievement WHERE id IN (?a)', $acvCache); - foreach ($this->iterate() as $guid => &$curTpl) { if ($distrib !== null) @@ -554,22 +553,18 @@ class RemoteProfileList extends ProfileList $limit--; } - - $a = explode(' ', $curTpl['_acvs']); - $t = explode(' ', $curTpl['_talents']); - unset($curTpl['_acvs']); - unset($curTpl['_talents']); - - // achievement points post - $curTpl['achievementpoints'] = array_sum(array_intersect_key($acvCache, array_combine($a, $a))); + list($r, $g) = explode(':', $guid); // talent points post $curTpl['talenttree1'] = 0; $curTpl['talenttree2'] = 0; $curTpl['talenttree3'] = 0; - foreach ($talentData as $spell => $data) - if (in_array($spell, $t)) + if (!empty($talentLookup[$r][$g])) + { + $talents = array_filter($talentLookup[$r][$g], function($v) use ($curTpl) { return $curTpl['activespec'] == $v; } ); + foreach (array_intersect_key($talentSpells, $talents) as $spell => $data) $curTpl['talenttree'.($data['tab'] + 1)] += $data['rank']; + } } } diff --git a/pages/achievement.php b/pages/achievement.php index adb57d02..b04a2f9c 100644 --- a/pages/achievement.php +++ b/pages/achievement.php @@ -23,7 +23,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class AchievementPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_ACHIEVEMENT; protected $typeId = 0; diff --git a/pages/achievements.php b/pages/achievements.php index f1cde8e0..ce65a26e 100644 --- a/pages/achievements.php +++ b/pages/achievements.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class AchievementsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_ACHIEVEMENT; protected $tpl = 'achievements'; diff --git a/pages/arenateam.php b/pages/arenateam.php index 24ec0f99..29833051 100644 --- a/pages/arenateam.php +++ b/pages/arenateam.php @@ -12,6 +12,8 @@ class ArenaTeamPage extends GenericPage protected $lvTabs = []; + protected $type = TYPE_ARENA_TEAM; + protected $tabId = 1; protected $path = [1, 5, 3]; protected $tpl = 'roster'; diff --git a/pages/arenateams.php b/pages/arenateams.php index e72f2f59..5bde8627 100644 --- a/pages/arenateams.php +++ b/pages/arenateams.php @@ -10,6 +10,8 @@ class ArenaTeamsPage extends GenericPage { use TrProfiler; + protected $type = TYPE_ARENA_TEAM; + protected $tabId = 1; protected $path = [1, 5, 3]; protected $tpl = 'arena-teams'; diff --git a/pages/class.php b/pages/class.php index a890119b..0775831b 100644 --- a/pages/class.php +++ b/pages/class.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class ClassPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_CLASS; protected $typeId = 0; diff --git a/pages/classes.php b/pages/classes.php index 9b8a2448..838fd5cb 100644 --- a/pages/classes.php +++ b/pages/classes.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class ClassesPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_CLASS; protected $tpl = 'list-page-generic'; diff --git a/pages/currencies.php b/pages/currencies.php index 33179b6a..0534f4db 100644 --- a/pages/currencies.php +++ b/pages/currencies.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class CurrenciesPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_CURRENCY; protected $tpl = 'list-page-generic'; diff --git a/pages/currency.php b/pages/currency.php index beea3502..4fe68ed0 100644 --- a/pages/currency.php +++ b/pages/currency.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class CurrencyPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_CURRENCY; protected $typeId = 0; diff --git a/pages/emote.php b/pages/emote.php index d70a0c80..26d3bbb3 100644 --- a/pages/emote.php +++ b/pages/emote.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabid 0: Database g_initHeader() class EmotePage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_EMOTE; protected $typeId = 0; diff --git a/pages/emotes.php b/pages/emotes.php index 753dcd62..6720fe40 100644 --- a/pages/emotes.php +++ b/pages/emotes.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabid 0: Database g_initHeader() class EmotesPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_EMOTE; protected $tpl = 'list-page-generic'; diff --git a/pages/enchantment.php b/pages/enchantment.php index 6dcf65f0..f3e8b502 100644 --- a/pages/enchantment.php +++ b/pages/enchantment.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class EnchantmentPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_ENCHANTMENT; protected $typeId = 0; diff --git a/pages/enchantments.php b/pages/enchantments.php index 5f14e89c..a35cb354 100644 --- a/pages/enchantments.php +++ b/pages/enchantments.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class EnchantmentsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_ENCHANTMENT; protected $tpl = 'enchantments'; diff --git a/pages/event.php b/pages/event.php index 66b17f75..b2e87498 100644 --- a/pages/event.php +++ b/pages/event.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class EventPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_WORLDEVENT; protected $typeId = 0; diff --git a/pages/events.php b/pages/events.php index 1b9a9330..c8b25867 100644 --- a/pages/events.php +++ b/pages/events.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class EventsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_WORLDEVENT; protected $tpl = 'list-page-generic'; diff --git a/pages/faction.php b/pages/faction.php index d52cf613..292f7322 100644 --- a/pages/faction.php +++ b/pages/faction.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class FactionPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_FACTION; protected $typeId = 0; diff --git a/pages/factions.php b/pages/factions.php index e25b32f9..bb8bba39 100644 --- a/pages/factions.php +++ b/pages/factions.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class FactionsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_FACTION; protected $tpl = 'list-page-generic'; diff --git a/pages/genericPage.class.php b/pages/genericPage.class.php index 99036841..65337489 100644 --- a/pages/genericPage.class.php +++ b/pages/genericPage.class.php @@ -4,7 +4,7 @@ if (!defined('AOWOW_REVISION')) die('illegal access'); -trait DetailPage +trait TrDetailPage { protected $hasComContent = true; protected $category = null; // not used on detail pages @@ -48,7 +48,7 @@ trait DetailPage } -trait ListPage +trait TrListPage { protected $category = null; protected $filter = []; @@ -85,6 +85,16 @@ trait TrProfiler protected $doResync = null; + protected function generateCacheKey($withStaff = true) + { + $staff = intVal($withStaff && User::isInGroup(U_GROUP_EMPLOYEE)); + + // mode, type, typeId, employee-flag, localeId, category, filter + $key = [$this->mode, $this->type, $this->subject->getField('id'), $staff, User::$localeId, '-1', '-1']; + + return implode('_', $key); + } + protected function getSubjectFromUrl($str) { if (!$str) diff --git a/pages/guild.php b/pages/guild.php index 8ba18176..7696e99b 100644 --- a/pages/guild.php +++ b/pages/guild.php @@ -12,6 +12,8 @@ class GuildPage extends GenericPage protected $lvTabs = []; + protected $type = TYPE_GUILD; + protected $tabId = 1; protected $path = [1, 5, 2]; protected $tpl = 'roster'; diff --git a/pages/guilds.php b/pages/guilds.php index cee61f76..7e3175f8 100644 --- a/pages/guilds.php +++ b/pages/guilds.php @@ -10,6 +10,8 @@ class GuildsPage extends GenericPage { use TrProfiler; + protected $type = TYPE_GUILD; + protected $tabId = 1; protected $path = [1, 5, 2]; protected $tpl = 'guilds'; diff --git a/pages/icon.php b/pages/icon.php index 2c5d3677..c3872fe9 100644 --- a/pages/icon.php +++ b/pages/icon.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class IconPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_ICON; protected $typeId = 0; diff --git a/pages/icons.php b/pages/icons.php index c20f7580..4ebdc164 100644 --- a/pages/icons.php +++ b/pages/icons.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class IconsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_ICON; protected $tpl = 'icons'; diff --git a/pages/item.php b/pages/item.php index fa65ac21..1d238e6e 100644 --- a/pages/item.php +++ b/pages/item.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class ItemPage extends genericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_ITEM; protected $typeId = 0; diff --git a/pages/items.php b/pages/items.php index a40eaa16..12e58d1d 100644 --- a/pages/items.php +++ b/pages/items.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class ItemsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_ITEM; protected $tpl = 'items'; diff --git a/pages/itemset.php b/pages/itemset.php index fd6b7990..263e4c02 100644 --- a/pages/itemset.php +++ b/pages/itemset.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class ItemsetPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_ITEMSET; protected $typeId = 0; diff --git a/pages/itemsets.php b/pages/itemsets.php index 80d9553a..1bbf059f 100644 --- a/pages/itemsets.php +++ b/pages/itemsets.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class ItemsetsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_ITEMSET; protected $tpl = 'itemsets'; diff --git a/pages/npc.php b/pages/npc.php index b0947a27..9aea7ef7 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class NpcPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_NPC; protected $typeId = 0; diff --git a/pages/npcs.php b/pages/npcs.php index 161cc4e6..a90ffd30 100644 --- a/pages/npcs.php +++ b/pages/npcs.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class NpcsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_NPC; protected $tpl = 'npcs'; diff --git a/pages/object.php b/pages/object.php index 86203277..e68c3200 100644 --- a/pages/object.php +++ b/pages/object.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class ObjectPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_OBJECT; protected $typeId = 0; diff --git a/pages/objects.php b/pages/objects.php index 27717b14..5f6fd68b 100644 --- a/pages/objects.php +++ b/pages/objects.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class ObjectsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_OBJECT; protected $tpl = 'objects'; diff --git a/pages/pet.php b/pages/pet.php index daa5edd1..a6d9e933 100644 --- a/pages/pet.php +++ b/pages/pet.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabid 0: Database g_initHeader() class PetPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_PET; protected $typeId = 0; diff --git a/pages/pets.php b/pages/pets.php index a3d1b814..f1686033 100644 --- a/pages/pets.php +++ b/pages/pets.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabid 0: Database g_initHeader() class PetsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_PET; protected $tpl = 'list-page-generic'; diff --git a/pages/profile.php b/pages/profile.php index 8cc81fde..b596832f 100644 --- a/pages/profile.php +++ b/pages/profile.php @@ -11,7 +11,9 @@ class ProfilePage extends GenericPage use TrProfiler; protected $gDataKey = true; - protected $mode = CACHE_TYPE_PAGE; + protected $mode = CACHE_TYPE_PAGE; + + protected $type = TYPE_PROFILE; protected $tabId = 1; protected $path = [1, 5, 1]; @@ -125,7 +127,7 @@ class ProfilePage extends GenericPage /* Onyxia */ /* ony */ 10184, /* Flame Levi, Ignis, Razorscale, XT-002, Kologarn, Auriaya, Freya, Hodir, Mimiron, Thorim, Vezaxx, Yogg, Algalon */ -/* uld */ 33113, 33118, 33186, 33293, 32930 33515, 32906, 32845, 33350, 32864, 33271, 33288, 32871 +/* uld */ 33113, 33118, 33186, 33293, 32930, 33515, 32906, 32845, 33350, 32864, 33271, 33288, 32871, /* Anub, Faerlina, Maexxna, Noth, Heigan, Loatheb, Razuvious, Gothik, Patchwerk, Grobbulus, Gluth, Thaddius, Sapphiron, Kel'Thuzad */ /* nax */ 15956, 15953, 15952, 15954, 15936, 16011, 16061, 16060, 16028, 15931, 15932, 15928, 15989, 15990 ); diff --git a/pages/profiles.php b/pages/profiles.php index 3cd64741..da76266a 100644 --- a/pages/profiles.php +++ b/pages/profiles.php @@ -12,6 +12,8 @@ class ProfilesPage extends GenericPage protected $roster = 0; // $_GET['roster'] = 1|2|3|4 .. 2,3,4 arenateam-size (4 => 5-man), 1 guild .. it puts a resync button on the lv... + protected $type = TYPE_PROFILE; + protected $tabId = 1; protected $path = [1, 5, 0]; protected $tpl = 'profiles'; @@ -34,7 +36,7 @@ class ProfilesPage extends GenericPage if ($this->realm && $r['name'] != $this->realm) continue; - $this->sumSubjects += DB::Characters($idx)->selectCell('SELECT count(*) FROM characters WHERE deleteInfos_Name IS NULL'); + $this->sumSubjects += DB::Characters($idx)->selectCell('SELECT count(*) FROM characters WHERE deleteInfos_Name IS NULL AND level <= ?d AND (extra_flags & ?) = 0', MAX_LEVEL, Profiler::CHAR_GMFLAGS); $realms[] = $idx; } diff --git a/pages/quest.php b/pages/quest.php index 0d37b261..b06a1317 100644 --- a/pages/quest.php +++ b/pages/quest.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class QuestPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_QUEST; protected $typeId = 0; diff --git a/pages/quests.php b/pages/quests.php index 478c1072..9d25ad0a 100644 --- a/pages/quests.php +++ b/pages/quests.php @@ -7,7 +7,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class QuestsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_QUEST; protected $tpl = 'quests'; diff --git a/pages/race.php b/pages/race.php index d21d0a33..e8be0958 100644 --- a/pages/race.php +++ b/pages/race.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class RacePage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_RACE; protected $typeId = 0; diff --git a/pages/races.php b/pages/races.php index ce1ccac2..9a11d86d 100644 --- a/pages/races.php +++ b/pages/races.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class RacesPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_RACE; protected $tpl = 'list-page-generic'; diff --git a/pages/skill.php b/pages/skill.php index 595643a2..86f35075 100644 --- a/pages/skill.php +++ b/pages/skill.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class SkillPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_SKILL; protected $typeId = 0; diff --git a/pages/skills.php b/pages/skills.php index 377f2471..5ecdf59d 100644 --- a/pages/skills.php +++ b/pages/skills.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class SkillsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_SKILL; protected $tpl = 'list-page-generic'; diff --git a/pages/sound.php b/pages/sound.php index 17ccfdb2..9ec120e7 100644 --- a/pages/sound.php +++ b/pages/sound.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class SoundPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_SOUND; protected $tpl = 'sound'; diff --git a/pages/sounds.php b/pages/sounds.php index b778c329..14111aee 100644 --- a/pages/sounds.php +++ b/pages/sounds.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class SoundsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_SOUND; protected $tpl = 'sounds'; diff --git a/pages/spell.php b/pages/spell.php index 486592fe..26f47a86 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class SpellPage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_SPELL; protected $typeId = 0; diff --git a/pages/spells.php b/pages/spells.php index 241131fb..fa2e0dd0 100644 --- a/pages/spells.php +++ b/pages/spells.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class SpellsPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_SPELL; protected $tpl = 'spells'; diff --git a/pages/title.php b/pages/title.php index 66f61181..b12804a9 100644 --- a/pages/title.php +++ b/pages/title.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class TitlePage extends GenericPage { - use DetailPage; + use TrDetailPage; protected $type = TYPE_TITLE; protected $typeId = 0; diff --git a/pages/titles.php b/pages/titles.php index ed41c6ea..e0904b24 100644 --- a/pages/titles.php +++ b/pages/titles.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class TitlesPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_TITLE; protected $tpl = 'list-page-generic'; diff --git a/pages/zones.php b/pages/zones.php index 5ceba164..5b1ff2e9 100644 --- a/pages/zones.php +++ b/pages/zones.php @@ -8,7 +8,7 @@ if (!defined('AOWOW_REVISION')) // tabId 0: Database g_initHeader() class ZonesPage extends GenericPage { - use ListPage; + use TrListPage; protected $type = TYPE_ZONE; protected $tpl = 'list-page-generic'; diff --git a/static/js/global.js b/static/js/global.js index ccc6e3d6..5e9081b3 100644 --- a/static/js/global.js +++ b/static/js/global.js @@ -9692,7 +9692,9 @@ Listview.funcBox = { } } - if (achievementPoints > 0) { + // aowow: changed because legitemately passing zero APs from the profiler is a thing + // (achievementPoints > 0) { + if (typeof achievementPoints == 'number') { if (ns) { $WH.ae(d, $WH.ct(' ')); }