From c44bf4f575d12b54fd35972f9d9a600994ac3ee4 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Tue, 30 Dec 2025 02:55:43 +0100 Subject: [PATCH] Config/Misc * hardcode sql limits within their respective components instead of having them configurable * creating a new DBTypeList defaults it to being unlimited * SQL_LIMIT_NONE (0) > removed as it only existed for consistency * SQL_LIMIT_DEFAULT (300) > frontend / Listview::DEFAULT_SIZE * SQL_LIMIT_SEARCH (500) > Search::DEFAULT_MAX_RESULTS * SQL_LIMIT_QUICKSEARCH (10) > Search::SUGGESTIONS_MAX_RESULTS --- endpoints/achievements/achievements.php | 8 ++-- endpoints/areatriggers/areatriggers.php | 6 +-- endpoints/arena-teams/arena-teams.php | 6 +-- endpoints/class/class.php | 6 +-- endpoints/emotes/emotes.php | 2 +- endpoints/enchantment/enchantment.php | 2 +- endpoints/enchantments/enchantments.php | 6 +-- endpoints/event/event.php | 7 +-- endpoints/events/events.php | 2 +- endpoints/faction/faction.php | 19 ++++---- endpoints/factions/factions.php | 2 +- endpoints/guild/guild.php | 2 +- endpoints/guilds/guilds.php | 5 ++- endpoints/item/item.php | 4 +- endpoints/items/items.php | 6 +-- endpoints/itemsets/itemsets.php | 6 +-- endpoints/latest-comments/latest-comments.php | 4 +- .../latest-comments/latest-comments_rss.php | 2 +- .../latest-screenshots/latest-screenshots.php | 2 +- .../latest-screenshots_rss.php | 2 +- endpoints/latest-videos/latest-videos.php | 2 +- endpoints/latest-videos/latest-videos_rss.php | 2 +- endpoints/npcs/npcs.php | 6 +-- endpoints/object/object.php | 6 +-- endpoints/objects/objects.php | 6 +-- endpoints/pet/pet.php | 2 +- endpoints/pets/pets.php | 2 +- endpoints/profile/load.php | 6 +-- endpoints/profiles/profiles.php | 6 +-- endpoints/quests/quests.php | 6 +-- endpoints/races/races.php | 2 +- endpoints/search/search.php | 5 +-- endpoints/search/search_json.php | 5 +-- endpoints/search/search_open.php | 7 ++- endpoints/skill/skill.php | 25 ++++------- endpoints/skills/skills.php | 2 +- endpoints/sound/sound.php | 2 +- endpoints/sounds/sounds.php | 6 +-- endpoints/spell/spell.php | 6 +-- endpoints/spells/spells.php | 6 +-- endpoints/titles/titles.php | 2 +- endpoints/top-users/top-users.php | 4 +- .../unrated-comments/unrated-comments.php | 2 +- endpoints/user/user.php | 16 +++---- endpoints/zone/zone.php | 8 ++-- endpoints/zones/zones.php | 2 +- .../components/communitycontent.class.php | 43 +++++++------------ includes/components/dbtypelist.class.php | 14 +++--- .../components/frontend/listview.class.php | 14 +++--- .../response/baseresponse.class.php | 1 - .../response/templateresponse.class.php | 2 +- includes/components/screenshotmgr.class.php | 2 +- includes/components/search.class.php | 7 ++- includes/components/videomgr.class.php | 2 +- includes/dbtypes/arenateam.class.php | 8 ++-- includes/dbtypes/guild.class.php | 7 +-- includes/dbtypes/item.class.php | 2 +- includes/dbtypes/profile.class.php | 7 +-- includes/dbtypes/spell.class.php | 2 +- includes/game/loot/lootbycontainer.class.php | 2 +- includes/game/loot/lootbyitem.class.php | 9 ++-- includes/kernel.php | 2 +- setup/sql/02-db_initial_data.sql | 2 +- setup/sql/updates/1767051301_01.sql | 4 ++ setup/tools/filegen/enchants.ss.php | 4 +- setup/tools/filegen/gems.ss.php | 2 +- setup/tools/filegen/glyphs.ss.php | 2 +- setup/tools/filegen/profiler.ss.php | 17 +------- setup/tools/filegen/talentcalc.ss.php | 4 +- 69 files changed, 183 insertions(+), 219 deletions(-) create mode 100644 setup/sql/updates/1767051301_01.sql diff --git a/endpoints/achievements/achievements.php b/endpoints/achievements/achievements.php index 58830919..f127dad1 100644 --- a/endpoints/achievements/achievements.php +++ b/endpoints/achievements/achievements.php @@ -67,7 +67,7 @@ class AchievementsBaseResponse extends TemplateResponse implements ICache { $this->h1 = Util::ucFirst(Lang::game('achievements')); - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; @@ -118,7 +118,7 @@ class AchievementsBaseResponse extends TemplateResponse implements ICache if (!$acvList->getMatches() && $this->category) { // ToDo - we also branch into here if the filter prohibits results. That should be skipped. - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if ($fiCnd) $conditions[] = $fiCnd; if ($catList = DB::Aowow()->SelectCol('SELECT `id` FROM ?_achievementcategory WHERE `parentCat` IN (?a) OR `parentCat2` IN (?a) ', $this->category, $this->category)) @@ -143,9 +143,9 @@ class AchievementsBaseResponse extends TemplateResponse implements ICache $tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)'; // create note if search limit was exceeded - if ($acvList->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($acvList->getMatches() > Listview::DEFAULT_SIZE) { - $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT')); + $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), Listview::DEFAULT_SIZE); $tabData['_truncated'] = 1; } } diff --git a/endpoints/areatriggers/areatriggers.php b/endpoints/areatriggers/areatriggers.php index a2e03b2d..6914b642 100644 --- a/endpoints/areatriggers/areatriggers.php +++ b/endpoints/areatriggers/areatriggers.php @@ -73,7 +73,7 @@ class AreatriggersBaseResponse extends TemplateResponse implements ICache $this->redButtons[BUTTON_WOWHEAD] = false; - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if ($_ = $this->filter->getConditions()) $conditions[] = $_; @@ -84,9 +84,9 @@ class AreatriggersBaseResponse extends TemplateResponse implements ICache $tabData['data'] = $trigger->getListviewData(); // create note if search limit was exceeded; overwriting 'note' is intentional - if ($trigger->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($trigger->getMatches() > Listview::DEFAULT_SIZE) { - $tabData['note'] = sprintf(Util::$tryFilteringEntityString, $trigger->getMatches(), '"'.Lang::game('areatriggers').'"', Cfg::get('SQL_LIMIT_DEFAULT')); + $tabData['note'] = sprintf(Util::$tryFilteringEntityString, $trigger->getMatches(), '"'.Lang::game('areatriggers').'"', Listview::DEFAULT_SIZE); $tabData['_truncated'] = 1; } } diff --git a/endpoints/arena-teams/arena-teams.php b/endpoints/arena-teams/arena-teams.php index 5160833e..63b6415e 100644 --- a/endpoints/arena-teams/arena-teams.php +++ b/endpoints/arena-teams/arena-teams.php @@ -90,7 +90,7 @@ class ArenateamsBaseResponse extends TemplateResponse implements IProfilerList /* Main Content */ /****************/ - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = ['at.seasonGames', 0, '>']; @@ -129,12 +129,12 @@ class ArenateamsBaseResponse extends TemplateResponse implements IProfilerList $tabData['data'] = $teams->getListviewData(); // create note if search limit was exceeded - if ($this->filter->query && $teams->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($this->filter->query && $teams->getMatches() > Listview::DEFAULT_SIZE) { $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_arenateamsfound2', $this->sumSubjects, $teams->getMatches()); $tabData['_truncated'] = 1; } - else if ($teams->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + else if ($teams->getMatches() > Listview::DEFAULT_SIZE) $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_arenateamsfound', $this->sumSubjects, 0); } diff --git a/endpoints/class/class.php b/endpoints/class/class.php index 06f39eeb..cef7395e 100644 --- a/endpoints/class/class.php +++ b/endpoints/class/class.php @@ -164,8 +164,7 @@ class ClassBaseResponse extends TemplateResponse implements ICache 'OR', ['s.cuFlags', SPELL_CU_LAST_RANK, '&'], ['s.rankNo', 0] - ], - Cfg::get('SQL_LIMIT_NONE') + ] ); $genSpells = new SpellList($conditions); @@ -190,8 +189,7 @@ class ClassBaseResponse extends TemplateResponse implements ICache ['requiredClass', 0, '>'], ['requiredClass', $cl->toMask(), '&'], [['requiredClass', ChrClass::MASK_ALL, '&'], ChrClass::MASK_ALL, '!'], - ['itemset', 0], - Cfg::get('SQL_LIMIT_NONE') + ['itemset', 0] ); $items = new ItemList($conditions); diff --git a/endpoints/emotes/emotes.php b/endpoints/emotes/emotes.php index b303aa5f..d23a70e7 100644 --- a/endpoints/emotes/emotes.php +++ b/endpoints/emotes/emotes.php @@ -41,7 +41,7 @@ class EmotesBaseResponse extends TemplateResponse implements ICache /* Main Content */ /****************/ - $cnd = [Cfg::get('SQL_LIMIT_NONE')]; + $cnd = []; // don't limit, for we have no filter or category if (!User::isInGroup(U_GROUP_STAFF)) $cnd[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; diff --git a/endpoints/enchantment/enchantment.php b/endpoints/enchantment/enchantment.php index 52a38cc6..7efcee08 100644 --- a/endpoints/enchantment/enchantment.php +++ b/endpoints/enchantment/enchantment.php @@ -271,7 +271,7 @@ class EnchantmentBaseResponse extends TemplateResponse implements ICache foreach ($iet as $tplId => $data) $randIds[$ire[$data['ench']]['id'] > 0 ? $tplId : -$tplId] = $ire[$data['ench']]['id']; - $randItems = new ItemList(array(Cfg::get('SQL_LIMIT_NONE'), ['randomEnchant', array_keys($randIds)])); + $randItems = new ItemList(array(['randomEnchant', array_keys($randIds)])); if (!$randItems->error) { $data = $randItems->getListviewData(); diff --git a/endpoints/enchantments/enchantments.php b/endpoints/enchantments/enchantments.php index 2a2e80f0..3088f145 100644 --- a/endpoints/enchantments/enchantments.php +++ b/endpoints/enchantments/enchantments.php @@ -48,7 +48,7 @@ class EnchantmentsBaseResponse extends TemplateResponse implements ICache { $this->h1 = Util::ucFirst(Lang::game('enchantments')); - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; @@ -112,9 +112,9 @@ class EnchantmentsBaseResponse extends TemplateResponse implements ICache if (!$ench->hasSetFields('skillLine')) $tabData['hiddenCols'] = ['skill']; - if ($ench->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($ench->getMatches() > Listview::DEFAULT_SIZE) { - $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_enchantmentsfound', $ench->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT')); + $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_enchantmentsfound', $ench->getMatches(), Listview::DEFAULT_SIZE); $tabData['_truncated'] = 1; } diff --git a/endpoints/event/event.php b/endpoints/event/event.php index 61e13dd1..1985d086 100644 --- a/endpoints/event/event.php +++ b/endpoints/event/event.php @@ -201,7 +201,7 @@ class EventBaseResponse extends TemplateResponse implements ICache } } - $itemCnd = []; + $itemCnd = ['OR']; if ($_holidayId) { // tab: criteria-of @@ -224,10 +224,7 @@ class EventBaseResponse extends TemplateResponse implements ICache } } - $itemCnd = array( - 'OR', - ['eventId', $this->typeId], // direct requirement on item - ); + $itemCnd[] = ['eventId', $this->typeId]; // direct requirement on item // tab: quests (by table, go & creature) $quests = new QuestList(array(['eventId', $this->typeId])); diff --git a/endpoints/events/events.php b/endpoints/events/events.php index c724234f..2b614094 100644 --- a/endpoints/events/events.php +++ b/endpoints/events/events.php @@ -55,7 +55,7 @@ class EventsBaseResponse extends TemplateResponse implements ICache $this->redButtons[BUTTON_WOWHEAD] = true; - $condition = []; + $condition = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $condition[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; diff --git a/endpoints/faction/faction.php b/endpoints/faction/faction.php index cee5a79c..96b887d8 100644 --- a/endpoints/faction/faction.php +++ b/endpoints/faction/faction.php @@ -213,7 +213,7 @@ class FactionBaseResponse extends TemplateResponse implements ICache $this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"], 'tabsRelated', true); // tab: items - $items = new ItemList(array(['requiredFaction', $this->typeId]), ['calcTotal' => true]); + $items = new ItemList(array(Listview::DEFAULT_SIZE, ['requiredFaction', $this->typeId]), ['calcTotal' => true]); if (!$items->error) { $this->extendGlobalData($items->getJSGlobals(GLOBALINFO_SELF)); @@ -224,7 +224,7 @@ class FactionBaseResponse extends TemplateResponse implements ICache 'sort' => ['standing', 'name'] ); - if ($items->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($items->getMatches() > Listview::DEFAULT_SIZE) if (!is_null(ItemListFilter::getCriteriaIndex(17, $this->typeId))) $tabData['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$this->typeId.';crv=0'); @@ -246,7 +246,7 @@ class FactionBaseResponse extends TemplateResponse implements ICache if ($cRep) { - $killCreatures = new CreatureList(array(['id', array_keys($cRep)]), ['calcTotal' => true]); + $killCreatures = new CreatureList(array(Listview::DEFAULT_SIZE, ['id', array_keys($cRep)]), ['calcTotal' => true]); if (!$killCreatures->error) { $data = $killCreatures->getListviewData(); @@ -259,7 +259,7 @@ class FactionBaseResponse extends TemplateResponse implements ICache 'sort' => ['-reputation', 'name'] ); - if ($killCreatures->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($killCreatures->getMatches() > Listview::DEFAULT_SIZE) if (!is_null(CreatureListFilter::getCriteriaIndex(42, $this->typeId))) $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=42;crs='.$this->typeId.';crv=0'); @@ -272,7 +272,7 @@ class FactionBaseResponse extends TemplateResponse implements ICache // tab: members if ($_ = $this->subject->getField('templateIds')) { - $members = new CreatureList(array(['faction', $_]), ['calcTotal' => true]); + $members = new CreatureList(array(Listview::DEFAULT_SIZE, ['faction', $_]), ['calcTotal' => true]); if (!$members->error) { $tabData = array( @@ -281,7 +281,7 @@ class FactionBaseResponse extends TemplateResponse implements ICache 'name' => '$LANG.tab_members' ); - if ($members->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($members->getMatches() > Listview::DEFAULT_SIZE) if (!is_null(CreatureListFilter::getCriteriaIndex(3, $this->typeId))) $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=3;crs='.$this->typeId.';crv=0'); @@ -303,12 +303,13 @@ class FactionBaseResponse extends TemplateResponse implements ICache // tab: quests $conditions = array( + 'OR', + Listview::DEFAULT_SIZE, ['AND', ['rewardFactionId1', $this->typeId], ['rewardFactionValue1', 0, '>']], ['AND', ['rewardFactionId2', $this->typeId], ['rewardFactionValue2', 0, '>']], ['AND', ['rewardFactionId3', $this->typeId], ['rewardFactionValue3', 0, '>']], ['AND', ['rewardFactionId4', $this->typeId], ['rewardFactionValue4', 0, '>']], - ['AND', ['rewardFactionId5', $this->typeId], ['rewardFactionValue5', 0, '>']], - 'OR' + ['AND', ['rewardFactionId5', $this->typeId], ['rewardFactionValue5', 0, '>']] ); $quests = new QuestList($conditions, ['calcTotal' => true]); if (!$quests->error) @@ -320,7 +321,7 @@ class FactionBaseResponse extends TemplateResponse implements ICache 'extraCols' => '$_' ); - if ($quests->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($quests->getMatches() > Listview::DEFAULT_SIZE) if (!is_null(QuestListFilter::getCriteriaIndex(1, $this->typeId))) $tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=1;crs='.$this->typeId.';crv=0'); diff --git a/endpoints/factions/factions.php b/endpoints/factions/factions.php index bf21c587..d4839bbd 100644 --- a/endpoints/factions/factions.php +++ b/endpoints/factions/factions.php @@ -71,7 +71,7 @@ class FactionsBaseResponse extends TemplateResponse implements ICache $this->redButtons[BUTTON_WOWHEAD] = true; - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) // unlisted factions $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; diff --git a/endpoints/guild/guild.php b/endpoints/guild/guild.php index dff1e831..10a4e63c 100644 --- a/endpoints/guild/guild.php +++ b/endpoints/guild/guild.php @@ -133,7 +133,7 @@ class GuildBaseResponse extends TemplateResponse $this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"], 'tabsRelated'); // tab: members - $member = new LocalProfileList(array(['p.guild', $this->typeId], Cfg::get('SQL_LIMIT_NONE'))); + $member = new LocalProfileList(array(['p.guild', $this->typeId])); $this->lvTabs->addListviewTab(new Listview(array( 'data' => $member->getListviewData(PROFILEINFO_CHARACTER | PROFILEINFO_GUILD), 'sort' => [-15], diff --git a/endpoints/guilds/guilds.php b/endpoints/guilds/guilds.php index 99108173..8a1f1391 100644 --- a/endpoints/guilds/guilds.php +++ b/endpoints/guilds/guilds.php @@ -91,6 +91,7 @@ class GuildsBaseResponse extends TemplateResponse implements IProfilerList /****************/ $conditions = array( + Listview::DEFAULT_SIZE, ['c.deleteInfos_Account', null], ['c.level', MAX_LEVEL, '<='], // prevents JS errors [['c.extra_flags', Profiler::CHAR_GMFLAGS, '&'], 0] @@ -126,12 +127,12 @@ class GuildsBaseResponse extends TemplateResponse implements IProfilerList $tabData['data'] = $guilds->getListviewData(); // create note if search limit was exceeded - if ($this->filter->query && $guilds->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($this->filter->query && $guilds->getMatches() > Listview::DEFAULT_SIZE) { $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_guildsfound2', $this->sumSubjects, $guilds->getMatches()); $tabData['_truncated'] = 1; } - else if ($guilds->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + else if ($guilds->getMatches() > Listview::DEFAULT_SIZE) $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_guildsfound', $this->sumSubjects, 0); } diff --git a/endpoints/item/item.php b/endpoints/item/item.php index e2e59e9e..89859ce4 100644 --- a/endpoints/item/item.php +++ b/endpoints/item/item.php @@ -569,7 +569,7 @@ class ItemBaseResponse extends TemplateResponse implements ICache // tab: container can contain if ($this->subject->getField('slots') > 0) { - $contains = new ItemList(array(['bagFamily', $_bagFamily, '&'], ['slots', 1, '<'], Cfg::get('SQL_LIMIT_NONE'))); + $contains = new ItemList(array(['bagFamily', $_bagFamily, '&'], ['slots', 1, '<'])); if (!$contains->error) { $this->extendGlobalData($contains->getJSGlobals(GLOBALINFO_SELF)); @@ -590,7 +590,7 @@ class ItemBaseResponse extends TemplateResponse implements ICache // tab: can be contained in (except keys) else if ($_bagFamily != 0x0100) { - $contains = new ItemList(array(['bagFamily', $_bagFamily, '&'], ['slots', 0, '>'], Cfg::get('SQL_LIMIT_NONE'))); + $contains = new ItemList(array(['bagFamily', $_bagFamily, '&'], ['slots', 0, '>'])); if (!$contains->error) { $this->extendGlobalData($contains->getJSGlobals(GLOBALINFO_SELF)); diff --git a/endpoints/items/items.php b/endpoints/items/items.php index 569aee01..04931ef5 100644 --- a/endpoints/items/items.php +++ b/endpoints/items/items.php @@ -112,7 +112,7 @@ class ItemsBaseResponse extends TemplateResponse implements ICache { $this->h1 = Util::ucFirst(Lang::game('items')); - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; @@ -255,7 +255,7 @@ class ItemsBaseResponse extends TemplateResponse implements ICache $nameSource = []; $grouping = $fiForm['gb'] ?? ItemListFilter::GROUP_BY_NONE; $extraOpts = []; - $maxResults = Cfg::get('SQL_LIMIT_DEFAULT'); + $maxResults = Listview::DEFAULT_SIZE; $forceTabs = false; $tabs = []; @@ -435,7 +435,7 @@ class ItemsBaseResponse extends TemplateResponse implements ICache } else if ($items->getMatches() > $maxResults) { - $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT')); + $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), Listview::DEFAULT_SIZE); $tabData['_truncated'] = 1; } diff --git a/endpoints/itemsets/itemsets.php b/endpoints/itemsets/itemsets.php index eecae8a4..6dd79980 100644 --- a/endpoints/itemsets/itemsets.php +++ b/endpoints/itemsets/itemsets.php @@ -45,7 +45,7 @@ class ItemsetsBaseResponse extends TemplateResponse implements ICache { $this->h1 = Util::ucWords(Lang::game('itemsets')); - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; @@ -88,9 +88,9 @@ class ItemsetsBaseResponse extends TemplateResponse implements ICache $tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)'; // create note if search limit was exceeded - if ($itemsets->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($itemsets->getMatches() > Listview::DEFAULT_SIZE) { - $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT')); + $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), Listview::DEFAULT_SIZE); $tabData['_truncated'] = 1; } diff --git a/endpoints/latest-comments/latest-comments.php b/endpoints/latest-comments/latest-comments.php index da742f32..fbb809db 100644 --- a/endpoints/latest-comments/latest-comments.php +++ b/endpoints/latest-comments/latest-comments.php @@ -33,10 +33,10 @@ class LatestcommentsBaseResponse extends TemplateResponse $this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]); - $comments = CommunityContent::getCommentPreviews(['comments' => true, 'replies' => false]); + $comments = CommunityContent::getCommentPreviews(['comments' => true, 'replies' => false], resultLimit: Listview::DEFAULT_SIZE); $this->lvTabs->addListviewTab(new Listview(['data' => $comments], 'commentpreview')); - $replies = CommunityContent::getCommentPreviews(['comments' => false, 'replies' => true]); + $replies = CommunityContent::getCommentPreviews(['comments' => false, 'replies' => true], resultLimit: Listview::DEFAULT_SIZE); $this->lvTabs->addListviewTab(new Listview(['data' => $replies], 'replypreview')); parent::generate(); diff --git a/endpoints/latest-comments/latest-comments_rss.php b/endpoints/latest-comments/latest-comments_rss.php index 0176ec41..20b61fa5 100644 --- a/endpoints/latest-comments/latest-comments_rss.php +++ b/endpoints/latest-comments/latest-comments_rss.php @@ -16,7 +16,7 @@ class LatestcommentsRssResponse extends TextResponse { $now = new DateTime(); - foreach (CommunityContent::getCommentPreviews(['comments' => 1, 'replies' => 1], dateFmt: false) as $comment) + foreach (CommunityContent::getCommentPreviews(['comments' => 1, 'replies' => 1], dateFmt: false, resultLimit: 100) as $comment) { if (empty($comment['commentid'])) $url = Cfg::get('HOST_URL').'/?go-to-comment&id='.$comment['id']; diff --git a/endpoints/latest-screenshots/latest-screenshots.php b/endpoints/latest-screenshots/latest-screenshots.php index cc08465f..6e8ba355 100644 --- a/endpoints/latest-screenshots/latest-screenshots.php +++ b/endpoints/latest-screenshots/latest-screenshots.php @@ -33,7 +33,7 @@ class LatestscreenshotsBaseResponse extends TemplateResponse $this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]); - $data = CommunityContent::getScreenshots(); + $data = CommunityContent::getScreenshots(resultLimit: Listview::DEFAULT_SIZE); $this->lvTabs->addListviewTab(new Listview(['data' => $data], 'screenshot')); parent::generate(); diff --git a/endpoints/latest-screenshots/latest-screenshots_rss.php b/endpoints/latest-screenshots/latest-screenshots_rss.php index 78520b50..50e6f215 100644 --- a/endpoints/latest-screenshots/latest-screenshots_rss.php +++ b/endpoints/latest-screenshots/latest-screenshots_rss.php @@ -16,7 +16,7 @@ class LatestscreenshotsRssResponse extends TextResponse { $now = new DateTime(); - foreach (CommunityContent::getScreenshots(dateFmt: false) as $screenshot) + foreach (CommunityContent::getScreenshots(dateFmt: false, resultLimit: 100) as $screenshot) { $desc = ''; if ($screenshot['caption']) diff --git a/endpoints/latest-videos/latest-videos.php b/endpoints/latest-videos/latest-videos.php index 24406460..610552e3 100644 --- a/endpoints/latest-videos/latest-videos.php +++ b/endpoints/latest-videos/latest-videos.php @@ -33,7 +33,7 @@ class LatestvideosBaseResponse extends TemplateResponse $this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]); - $data = CommunityContent::getVideos(); + $data = CommunityContent::getVideos(resultLimit: Listview::DEFAULT_SIZE); $this->lvTabs->addListviewTab(new Listview(['data' => $data], 'video')); parent::generate(); diff --git a/endpoints/latest-videos/latest-videos_rss.php b/endpoints/latest-videos/latest-videos_rss.php index e35a5f94..5e3980ec 100644 --- a/endpoints/latest-videos/latest-videos_rss.php +++ b/endpoints/latest-videos/latest-videos_rss.php @@ -16,7 +16,7 @@ class LatestvideosRssResponse extends TextResponse { $now = new DateTime(); - foreach (CommunityContent::getvideos(dateFmt: false) as $video) + foreach (CommunityContent::getvideos(dateFmt: false, resultLimit: 100) as $video) { $desc = ''; if ($video['caption']) diff --git a/endpoints/npcs/npcs.php b/endpoints/npcs/npcs.php index 6984cb45..72649067 100644 --- a/endpoints/npcs/npcs.php +++ b/endpoints/npcs/npcs.php @@ -48,7 +48,7 @@ class NpcsBaseResponse extends TemplateResponse implements ICache { $this->h1 = Lang::game('npcs'); - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; @@ -109,9 +109,9 @@ class NpcsBaseResponse extends TemplateResponse implements ICache $tabData['hiddenCols'] = ['type']; // create note if search limit was exceeded - if ($npcs->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($npcs->getMatches() > Listview::DEFAULT_SIZE) { - $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_npcsfound', $npcs->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT')); + $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_npcsfound', $npcs->getMatches(), Listview::DEFAULT_SIZE); $tabData['_truncated'] = 1; } } diff --git a/endpoints/object/object.php b/endpoints/object/object.php index e1b88803..70e4a434 100644 --- a/endpoints/object/object.php +++ b/endpoints/object/object.php @@ -535,7 +535,7 @@ class ObjectBaseResponse extends TemplateResponse implements ICache // tab: Spell Focus for if ($sfId = $this->subject->getField('spellFocusId')) { - $focusSpells = new SpellList(array(['spellFocusObject', $sfId]), ['calcTotal' => true]); + $focusSpells = new SpellList(array(Listview::DEFAULT_SIZE, ['spellFocusObject', $sfId]), ['calcTotal' => true]); if (!$focusSpells->error) { $tabData = array( @@ -547,9 +547,9 @@ class ObjectBaseResponse extends TemplateResponse implements ICache $this->extendGlobalData($focusSpells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); // create note if search limit was exceeded - if ($focusSpells->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($focusSpells->getMatches() > Listview::DEFAULT_SIZE) { - $tabData['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_spellsfound', $focusSpells->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT')); + $tabData['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_spellsfound', $focusSpells->getMatches(), Listview::DEFAULT_SIZE); $tabData['_truncated'] = 1; } diff --git a/endpoints/objects/objects.php b/endpoints/objects/objects.php index 0c726548..487e806d 100644 --- a/endpoints/objects/objects.php +++ b/endpoints/objects/objects.php @@ -48,7 +48,7 @@ class ObjectsBaseResponse extends TemplateResponse implements ICache { $this->h1 = Util::ucFirst(Lang::game('objects')); - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; @@ -93,9 +93,9 @@ class ObjectsBaseResponse extends TemplateResponse implements ICache $tabData['visibleCols'] = ['skill']; // create note if search limit was exceeded - if ($objects->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($objects->getMatches() > Listview::DEFAULT_SIZE) { - $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_objectsfound', $objects->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT')); + $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_objectsfound', $objects->getMatches(), Listview::DEFAULT_SIZE); $tabData['_truncated'] = 1; } } diff --git a/endpoints/pet/pet.php b/endpoints/pet/pet.php index 63460f3e..30da1abd 100644 --- a/endpoints/pet/pet.php +++ b/endpoints/pet/pet.php @@ -142,7 +142,7 @@ class PetBaseResponse extends TemplateResponse implements ICache if ($mask & (1 << ($i - 1))) $list[] = $i; - $food = new ItemList(array(['i.subClass', [ITEM_SUBCLASS_FOOD, ITEM_SUBCLASS_MISC_CONSUMABLE]], ['i.FoodType', $list], Cfg::get('SQL_LIMIT_NONE'))); + $food = new ItemList(array(['i.subClass', [ITEM_SUBCLASS_FOOD, ITEM_SUBCLASS_MISC_CONSUMABLE]], ['i.FoodType', $list])); $this->extendGlobalData($food->getJSGlobals()); $this->lvTabs->addListviewTab(new Listview(array( diff --git a/endpoints/pets/pets.php b/endpoints/pets/pets.php index 7565805f..50ac423a 100644 --- a/endpoints/pets/pets.php +++ b/endpoints/pets/pets.php @@ -55,7 +55,7 @@ class PetsBaseResponse extends TemplateResponse implements ICache $this->redButtons[BUTTON_WOWHEAD] = true; - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; diff --git a/endpoints/profile/load.php b/endpoints/profile/load.php index 32370ee1..8c0d2e95 100644 --- a/endpoints/profile/load.php +++ b/endpoints/profile/load.php @@ -160,7 +160,7 @@ class ProfileLoadResponse extends TextResponse $profile['quests'] = []; if ($quests = DB::Aowow()->selectCol('SELECT `questId` FROM ?_profiler_completion_quests WHERE `id` = ?d', $pBase['id'])) { - $qList = new QuestList(array(['id', $quests], Cfg::get('SQL_LIMIT_NONE'))); + $qList = new QuestList(array(['id', $quests])); if (!$qList->error) foreach ($qList->iterate() as $id => $__) $profile['quests'][$id] = [$qList->getField('cat1'), $qList->getField('cat2')]; @@ -226,7 +226,7 @@ class ProfileLoadResponse extends TextResponse if ($items = DB::Aowow()->select('SELECT * FROM ?_profiler_items WHERE `id` = ?d', $pBase['id'])) { - $itemz = new ItemList(array(['id', array_column($items, 'item')], Cfg::get('SQL_LIMIT_NONE'))); + $itemz = new ItemList(array(['id', array_column($items, 'item')])); if (!$itemz->error) { $data = $itemz->getListviewData(ITEMINFO_JSON | ITEMINFO_SUBITEMS); @@ -255,7 +255,7 @@ class ProfileLoadResponse extends TextResponse // if ($au = $char->getField('auras')) // { - // $auraz = new SpellList(array(['id', $char->getField('auras')], Cfg::get('SQL_LIMIT_NONE'))); + // $auraz = new SpellList(array(['id', $char->getField('auras')])); // $dataz = $auraz->getListviewData(); // $modz = $auraz->getProfilerMods(); diff --git a/endpoints/profiles/profiles.php b/endpoints/profiles/profiles.php index 53d3c37b..065065fe 100644 --- a/endpoints/profiles/profiles.php +++ b/endpoints/profiles/profiles.php @@ -94,7 +94,7 @@ class ProfilesBaseResponse extends TemplateResponse implements IProfilerList /* Main Content */ /****************/ - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if ($_ = $this->filter->getConditions()) $conditions[] = $_; @@ -175,12 +175,12 @@ class ProfilesBaseResponse extends TemplateResponse implements IProfilerList $lvVisibleCols[] = 'guildrank'; // create note if search limit was exceeded - if ($this->filter->query && $profiles->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($this->filter->query && $profiles->getMatches() > Listview::DEFAULT_SIZE) { $lvNote = sprintf(Util::$tryFilteringString, 'LANG.lvnote_charactersfound2', $this->sumSubjects, $profiles->getMatches()); $lv_truncated = 1; } - else if ($profiles->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + else if ($profiles->getMatches() > Listview::DEFAULT_SIZE) $lvNote = sprintf(Util::$tryFilteringString, 'LANG.lvnote_charactersfound', $this->sumSubjects, 0); if ($this->filter->useLocalList) diff --git a/endpoints/quests/quests.php b/endpoints/quests/quests.php index 562132a2..8dcfe081 100644 --- a/endpoints/quests/quests.php +++ b/endpoints/quests/quests.php @@ -66,7 +66,7 @@ class QuestsBaseResponse extends TemplateResponse implements ICache { $this->h1 = Util::ucFirst(Lang::game('quests')); - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; @@ -125,9 +125,9 @@ class QuestsBaseResponse extends TemplateResponse implements ICache $tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)'; // create note if search limit was exceeded - if ($quests->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($quests->getMatches() > Listview::DEFAULT_SIZE) { - $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_questsfound', $quests->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT')); + $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_questsfound', $quests->getMatches(), Listview::DEFAULT_SIZE); $tabData['_truncated'] = 1; } else if (isset($this->category[1]) && $this->category[1] > 0) diff --git a/endpoints/races/races.php b/endpoints/races/races.php index b9ae8ecb..6a0733cd 100644 --- a/endpoints/races/races.php +++ b/endpoints/races/races.php @@ -35,7 +35,7 @@ class RacesBaseResponse extends TemplateResponse implements ICache $this->redButtons[BUTTON_WOWHEAD] = true; - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; diff --git a/endpoints/search/search.php b/endpoints/search/search.php index 7b5ec896..8da47402 100644 --- a/endpoints/search/search.php +++ b/endpoints/search/search.php @@ -35,12 +35,9 @@ class SearchBaseResponse extends TemplateResponse implements ICache $this->query = $this->_get['search']; // technically pageParam, but prepared - if ($limit = Cfg::get('SQL_LIMIT_SEARCH')) - $this->maxResults = $limit; - $this->searchMask = Search::TYPE_REGULAR | self::SEARCH_MODS_ALL; - $this->searchObj = new Search($this->query, $this->searchMask, $this->maxResults); + $this->searchObj = new Search($this->query, $this->searchMask); } protected function generate() : void diff --git a/endpoints/search/search_json.php b/endpoints/search/search_json.php index 61c6f754..1fbec2e8 100644 --- a/endpoints/search/search_json.php +++ b/endpoints/search/search_json.php @@ -52,16 +52,13 @@ class SearchJsonResponse extends TextResponse implements ICache if ($_ = array_filter($this->_get['slots'] ?? [])) $this->extraCnd[] = ['slot', $_]; - if ($limit = Cfg::get('SQL_LIMIT_SEARCH')) - $this->maxResults = $limit; - $this->searchMask = Search::TYPE_JSON; if ($this->_get['slots'] || $this->_get['type'] == Type::ITEM) $this->searchMask |= 1 << Search::MOD_ITEM; else if ($this->_get['type'] == Type::ITEMSET) $this->searchMask |= 1 << Search::MOD_ITEM | 1 << Search::MOD_ITEMSET; - $this->searchObj = new Search($this->query, $this->searchMask, $this->maxResults, $this->extraCnd, $this->extraOpts); + $this->searchObj = new Search($this->query, $this->searchMask, $this->extraCnd, $this->extraOpts); } // !note! dear reader, if you ever try to generate a string, that is to be evaled by JS, NEVER EVER terminate with a \n ..... $totalHoursWasted +=2; diff --git a/endpoints/search/search_open.php b/endpoints/search/search_open.php index ad154697..04e9198c 100644 --- a/endpoints/search/search_open.php +++ b/endpoints/search/search_open.php @@ -53,6 +53,8 @@ class SearchOpenResponse extends TextResponse implements ICache 1 << Search::MOD_ZONE | 1 << Search::MOD_OBJECT | 1 << Search::MOD_FACTION | 1 << Search::MOD_SKILL | 1 << Search::MOD_PET; + private int $maxResults = Search::SUGGESTIONS_MAX_RESULTS; + protected string $contentType = MIME_TYPE_OPENSEARCH; protected int $cacheType = CACHE_TYPE_SEARCH; @@ -66,12 +68,9 @@ class SearchOpenResponse extends TextResponse implements ICache $this->query = $this->_get['search']; // technically pageParam, but prepared - if ($limit = Cfg::get('SQL_LIMIT_QUICKSEARCH')) - $this->maxResults = $limit; - $this->searchMask = Search::TYPE_OPEN | self::SEARCH_MODS_OPEN; - $this->searchObj = new Search($this->query, $this->searchMask, $this->maxResults); + $this->searchObj = new Search($this->query, $this->searchMask, maxResults: $this->maxResults); } protected function generate() : void diff --git a/endpoints/skill/skill.php b/endpoints/skill/skill.php index d68936e0..40b5133a 100644 --- a/endpoints/skill/skill.php +++ b/endpoints/skill/skill.php @@ -115,8 +115,7 @@ class SkillBaseResponse extends TemplateResponse implements ICache // tab: recipes [spells] (crafted) $condition = array( ['OR', ['s.reagent1', 0, '>'], ['s.reagent2', 0, '>'], ['s.reagent3', 0, '>'], ['s.reagent4', 0, '>'], ['s.reagent5', 0, '>'], ['s.reagent6', 0, '>'], ['s.reagent7', 0, '>'], ['s.reagent8', 0, '>']], - ['OR', ['s.skillLine1', $this->typeId], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $this->typeId]]], - Cfg::get('SQL_LIMIT_NONE') + ['OR', ['s.skillLine1', $this->typeId], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $this->typeId]]] ); $recipes = new SpellList($condition); // also relevant for 3 @@ -136,8 +135,7 @@ class SkillBaseResponse extends TemplateResponse implements ICache $filterRecipe = [null, SKILL_LEATHERWORKING, SKILL_TAILORING, SKILL_ENGINEERING, SKILL_BLACKSMITHING, SKILL_COOKING, SKILL_ALCHEMY, SKILL_FIRST_AID, SKILL_ENCHANTING, SKILL_FISHING, SKILL_JEWELCRAFTING, SKILL_INSCRIPTION, SKILL_MINING, SKILL_HERBALISM]; $conditions = array( ['requiredSkill', $this->typeId], - ['class', ITEM_CLASS_RECIPE], - Cfg::get('SQL_LIMIT_NONE') + ['class', ITEM_CLASS_RECIPE] ); $recipeItems = new ItemList($conditions); @@ -166,7 +164,7 @@ class SkillBaseResponse extends TemplateResponse implements ICache if ($created) { - $created = new ItemList(array(['i.id', $created], Cfg::get('SQL_LIMIT_NONE'))); + $created = new ItemList(array(['i.id', $created])); if (!$created->error) { $this->extendGlobalData($created->getJSGlobals(GLOBALINFO_SELF)); @@ -187,8 +185,7 @@ class SkillBaseResponse extends TemplateResponse implements ICache // tab: required by [item] $conditions = array( ['requiredSkill', $this->typeId], - ['class', ITEM_CLASS_RECIPE, '!'], - Cfg::get('SQL_LIMIT_NONE') + ['class', ITEM_CLASS_RECIPE, '!'] ); $reqBy = new ItemList($conditions); @@ -209,12 +206,7 @@ class SkillBaseResponse extends TemplateResponse implements ICache } // tab: required by [itemset] - $conditions = array( - ['skillId', $this->typeId], - Cfg::get('SQL_LIMIT_NONE') - ); - - $reqBy = new ItemsetList($conditions); + $reqBy = new ItemsetList(array(['skillId', $this->typeId])); if (!$reqBy->error) { $this->extendGlobalData($reqBy->getJSGlobals(GLOBALINFO_SELF)); @@ -252,8 +244,7 @@ class SkillBaseResponse extends TemplateResponse implements ICache $reqRace = 0x0; $condition = array( ['AND', ['s.reagent1', 0], ['s.reagent2', 0], ['s.reagent3', 0], ['s.reagent4', 0], ['s.reagent5', 0], ['s.reagent6', 0], ['s.reagent7', 0], ['s.reagent8', 0]], - ['OR', ['s.skillLine1', $this->typeId], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $this->typeId]]], - Cfg::get('SQL_LIMIT_NONE') + ['OR', ['s.skillLine1', $this->typeId], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $this->typeId]]] ); foreach (Game::$skillLineMask as $line1 => $sets) @@ -310,7 +301,7 @@ class SkillBaseResponse extends TemplateResponse implements ICache $list = $spellIds ? DB::World()->selectCol('SELECT cdt.`CreatureId` FROM creature_default_trainer cdt JOIN trainer_spell ts ON ts.`TrainerId` = cdt.`TrainerId` WHERE ts.`SpellID` IN (?a)', $spellIds) : []; if ($list) { - $trainer = new CreatureList(array(Cfg::get('SQL_LIMIT_NONE'), ['ct.id', $list], ['s.guid', NULL, '!'], ['ct.npcflag', 0x10, '&'])); + $trainer = new CreatureList(array(['ct.id', $list], ['s.guid', NULL, '!'], ['ct.npcflag', 0x10, '&'])); if (!$trainer->error) { @@ -346,7 +337,7 @@ class SkillBaseResponse extends TemplateResponse implements ICache if ($sort) { - $quests = new QuestList(array(['zoneOrSort', -$sort], Cfg::get('SQL_LIMIT_NONE'))); + $quests = new QuestList(array(['zoneOrSort', -$sort])); if (!$quests->error) { $this->extendGlobalData($quests->getJSGlobals()); diff --git a/endpoints/skills/skills.php b/endpoints/skills/skills.php index f60076d7..fc4f1afc 100644 --- a/endpoints/skills/skills.php +++ b/endpoints/skills/skills.php @@ -43,7 +43,7 @@ class SkillsBaseResponse extends TemplateResponse implements ICache $this->redButtons[BUTTON_WOWHEAD] = true; - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; diff --git a/endpoints/sound/sound.php b/endpoints/sound/sound.php index b88da8ef..aa79fe73 100644 --- a/endpoints/sound/sound.php +++ b/endpoints/sound/sound.php @@ -286,7 +286,7 @@ class SoundBaseResponse extends TemplateResponse implements ICache if ($creatureIds || $displayIds) { $extra = []; - $cnds = [Cfg::get('SQL_LIMIT_NONE'), &$extra]; + $cnds = [&$extra]; if (!User::isInGroup(U_GROUP_STAFF)) $cnds[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; diff --git a/endpoints/sounds/sounds.php b/endpoints/sounds/sounds.php index d9f3e7f5..164b3840 100644 --- a/endpoints/sounds/sounds.php +++ b/endpoints/sounds/sounds.php @@ -47,7 +47,7 @@ class SoundsBaseResponse extends TemplateResponse implements ICache { $this->h1 = Util::ucFirst(Lang::game('sounds')); - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; @@ -92,9 +92,9 @@ class SoundsBaseResponse extends TemplateResponse implements ICache $tabData['data'] = $sounds->getListviewData(); // create note if search limit was exceeded; overwriting 'note' is intentional - if ($sounds->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($sounds->getMatches() > Listview::DEFAULT_SIZE) { - $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_soundsfound', $sounds->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT')); + $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_soundsfound', $sounds->getMatches(), Listview::DEFAULT_SIZE); $tabData['_truncated'] = 1; } } diff --git a/endpoints/spell/spell.php b/endpoints/spell/spell.php index a3b4b143..bd3e7117 100644 --- a/endpoints/spell/spell.php +++ b/endpoints/spell/spell.php @@ -1007,7 +1007,7 @@ class SpellBaseResponse extends TemplateResponse implements ICache if ($trainers) { - $tbTrainer = new CreatureList(array(Cfg::get('SQL_LIMIT_NONE'), ['ct.id', array_keys($trainers)], ['s.guid', null, '!'], ['ct.npcflag', NPC_FLAG_TRAINER, '&'])); + $tbTrainer = new CreatureList(array(['ct.id', array_keys($trainers)], ['s.guid', null, '!'], ['ct.npcflag', NPC_FLAG_TRAINER, '&'])); if (!$tbTrainer->error) { $this->extendGlobalData($tbTrainer->getJSGlobals()); @@ -1185,7 +1185,7 @@ class SpellBaseResponse extends TemplateResponse implements ICache if ($lockIds) { // objects - $lockedObj = new GameObjectList(array(Cfg::get('SQL_LIMIT_NONE'), ['lockId', $lockIds])); + $lockedObj = new GameObjectList(array(['lockId', $lockIds])); if (!$lockedObj->error) { $this->addDataLoader('zones'); @@ -1197,7 +1197,7 @@ class SpellBaseResponse extends TemplateResponse implements ICache ), GameObjectList::$brickFile)); } - $lockedItm = new ItemList(array(Cfg::get('SQL_LIMIT_NONE'), ['lockId', $lockIds])); + $lockedItm = new ItemList(array(['lockId', $lockIds])); if (!$lockedItm->error) { $this->extendGlobalData($lockedItm->getJSGlobals(GLOBALINFO_SELF)); diff --git a/endpoints/spells/spells.php b/endpoints/spells/spells.php index 968e9897..023a0bf9 100644 --- a/endpoints/spells/spells.php +++ b/endpoints/spells/spells.php @@ -112,7 +112,7 @@ class SpellsBaseResponse extends TemplateResponse implements ICache { $this->h1 = Util::ucFirst(Lang::game('spells')); - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; @@ -484,9 +484,9 @@ class SpellsBaseResponse extends TemplateResponse implements ICache $visibleCols[] = 'source'; // create note if search limit was exceeded; overwriting 'note' is intentional - if ($spells->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($spells->getMatches() > Listview::DEFAULT_SIZE) { - $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_spellsfound', $spells->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT')); + $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_spellsfound', $spells->getMatches(), Listview::DEFAULT_SIZE); $tabData['_truncated'] = 1; } diff --git a/endpoints/titles/titles.php b/endpoints/titles/titles.php index 61e4dba3..198b2271 100644 --- a/endpoints/titles/titles.php +++ b/endpoints/titles/titles.php @@ -43,7 +43,7 @@ class TitlesBaseResponse extends TemplateResponse implements ICache $this->redButtons[BUTTON_WOWHEAD] = true; - $conditions = []; + $conditions = [Listview::DEFAULT_SIZE]; if (!User::isInGroup(U_GROUP_EMPLOYEE)) // hide unused titles $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; diff --git a/endpoints/top-users/top-users.php b/endpoints/top-users/top-users.php index b342baa1..038fd699 100644 --- a/endpoints/top-users/top-users.php +++ b/endpoints/top-users/top-users.php @@ -8,6 +8,8 @@ if (!defined('AOWOW_REVISION')) class TopusersBaseResponse extends TemplateResponse { + private const /* int */ MAX_RESULTS = 500; + protected string $template = 'list-page-generic'; protected string $pageName = 'top-users'; protected ?int $activeTab = parent::TAB_COMMUNITY; @@ -57,7 +59,7 @@ class TopusersBaseResponse extends TemplateResponse ORDER BY reputation DESC LIMIT ?d', SITEREP_ACTION_COMMENT, SITEREP_ACTION_SUBMIT_SCREENSHOT, SITEREP_ACTION_GOOD_REPORT, - $time ?: DBSIMPLE_SKIP, Cfg::get('SQL_LIMIT_SEARCH') + $time ?: DBSIMPLE_SKIP, self::MAX_RESULTS ); $data = []; diff --git a/endpoints/unrated-comments/unrated-comments.php b/endpoints/unrated-comments/unrated-comments.php index bd0027e8..2b7fefc5 100644 --- a/endpoints/unrated-comments/unrated-comments.php +++ b/endpoints/unrated-comments/unrated-comments.php @@ -31,7 +31,7 @@ class UnratedcommentsBaseResponse extends TemplateResponse $this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]); - $data = CommunityContent::getCommentPreviews(['unrated' => true, 'comments' => true]); + $data = CommunityContent::getCommentPreviews(['unrated' => true, 'comments' => true], resultLimit: Listview::DEFAULT_SIZE); $this->lvTabs->addListviewTab(new Listview(['data' => $data], 'commentpreview')); parent::generate(); diff --git a/endpoints/user/user.php b/endpoints/user/user.php index d18a968f..f1b01a12 100644 --- a/endpoints/user/user.php +++ b/endpoints/user/user.php @@ -158,7 +158,7 @@ class UserBaseResponse extends TemplateResponse } // Comments - if ($_ = CommunityContent::getCommentPreviews(['user' => $this->user['id'], 'comments' => true], $nFound)) + if ($_ = CommunityContent::getCommentPreviews(['user' => $this->user['id'], 'comments' => true], $nFound, resultLimit: Listview::DEFAULT_SIZE)) { $tabData = array( 'data' => $_, @@ -167,7 +167,7 @@ class UserBaseResponse extends TemplateResponse '_totalCount' => $nFound ); - if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($nFound > Listview::DEFAULT_SIZE) { $tabData['name'] = '$LANG.tab_latestcomments'; $tabData['note'] = '$$WH.sprintf(LANG.lvnote_usercomments, '.$nFound.')'; @@ -177,7 +177,7 @@ class UserBaseResponse extends TemplateResponse } // Comment Replies - if ($_ = CommunityContent::getCommentPreviews(['user' => $this->user['id'], 'replies' => true], $nFound)) + if ($_ = CommunityContent::getCommentPreviews(['user' => $this->user['id'], 'replies' => true], $nFound, resultLimit: Listview::DEFAULT_SIZE)) { $tabData = array( 'data' => $_, @@ -186,7 +186,7 @@ class UserBaseResponse extends TemplateResponse '_totalCount' => $nFound ); - if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($nFound > Listview::DEFAULT_SIZE) { $tabData['name'] = '$LANG.tab_latestreplies'; $tabData['note'] = '$$WH.sprintf(LANG.lvnote_userreplies, '.$nFound.')'; @@ -196,14 +196,14 @@ class UserBaseResponse extends TemplateResponse } // Screenshots - if ($_ = CommunityContent::getScreenshots(-$this->user['id'], 0, $nFound)) + if ($_ = CommunityContent::getScreenshots(-$this->user['id'], 0, $nFound, resultLimit: Listview::DEFAULT_SIZE)) { $tabData = array( 'data' => $_, '_totalCount' => $nFound ); - if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($nFound > Listview::DEFAULT_SIZE) { $tabData['name'] = '$LANG.tab_latestscreenshots'; $tabData['note'] = '$$WH.sprintf(LANG.lvnote_userscreenshots, '.$nFound.')'; @@ -213,14 +213,14 @@ class UserBaseResponse extends TemplateResponse } // Videos - if ($_ = CommunityContent::getVideos(-$this->user['id'], 0, $nFound)) + if ($_ = CommunityContent::getVideos(-$this->user['id'], 0, $nFound, resultLimit: Listview::DEFAULT_SIZE)) { $tabData = array( 'data' => $_, '_totalCount' => $nFound ); - if ($nFound > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($nFound > Listview::DEFAULT_SIZE) { $tabData['name'] = '$LANG.tab_latestvideos'; $tabData['note'] = '$$WH.sprintf(LANG.lvnote_uservideos, '.$nFound.')'; diff --git a/endpoints/zone/zone.php b/endpoints/zone/zone.php index 653211bf..d7d11ced 100644 --- a/endpoints/zone/zone.php +++ b/endpoints/zone/zone.php @@ -240,7 +240,7 @@ class ZoneBaseResponse extends TemplateResponse implements ICache $cSpawns = DB::Aowow()->select('SELECT * FROM ?_spawns WHERE `areaId` = ?d AND `type` = ?d AND `posX` > 0 AND `posY` > 0', $this->typeId, Type::NPC); $aSpawns = User::isInGroup(U_GROUP_STAFF) ? DB::Aowow()->select('SELECT * FROM ?_spawns WHERE `areaId` = ?d AND `type` = ?d AND `posX` > 0 AND `posY` > 0', $this->typeId, Type::AREATRIGGER) : []; - $conditions = [Cfg::get('SQL_LIMIT_NONE'), ['s.areaId', $this->typeId]]; + $conditions = [['s.areaId', $this->typeId]]; if (!User::isInGroup(U_GROUP_STAFF)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; @@ -574,7 +574,7 @@ class ZoneBaseResponse extends TemplateResponse implements ICache { // Issue 1 - if the bosses drop items that are also sold by vendors moreZoneId will be 0 as vendor location and boss location are likely in conflict with each other // Issue 2 - if the boss/chest isn't spawned the loot will not show up - $items = new ItemList(array(Cfg::get('SQL_LIMIT_NONE'), ['src.moreZoneId', $this->typeId], ['src.src2', 0, '>'], ['quality', ITEM_QUALITY_UNCOMMON, '>=']), ['calcTotal' => true]); + $items = new ItemList(array(['src.moreZoneId', $this->typeId], ['src.src2', 0, '>'], ['quality', ITEM_QUALITY_UNCOMMON, '>=']), ['calcTotal' => true]); $data = $items->getListviewData(); $subTabs = false; foreach ($items->iterate() as $id => $__) @@ -619,7 +619,7 @@ class ZoneBaseResponse extends TemplateResponse implements ICache if (!is_null(CreatureListFilter::getCriteriaIndex(6, $this->typeId))) $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=6;crs='.$this->typeId.';crv=0'); - if ($creatureSpawns->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($creatureSpawns->getMatches() > Listview::DEFAULT_SIZE) $tabData['_truncated'] = 1; $this->extendGlobalData($creatureSpawns->getJSGlobals(GLOBALINFO_SELF)); @@ -635,7 +635,7 @@ class ZoneBaseResponse extends TemplateResponse implements ICache if (!is_null(GameObjectListFilter::getCriteriaIndex(1, $this->typeId))) $tabData['note'] = sprintf(Util::$filterResultString, '?objects&filter=cr=1;crs='.$this->typeId.';crv=0'); - if ($objectSpawns->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) + if ($objectSpawns->getMatches() > Listview::DEFAULT_SIZE) $tabData['_truncated'] = 1; $this->extendGlobalData($objectSpawns->getJSGlobals(GLOBALINFO_SELF)); diff --git a/endpoints/zones/zones.php b/endpoints/zones/zones.php index 925486fc..cc2e6d63 100644 --- a/endpoints/zones/zones.php +++ b/endpoints/zones/zones.php @@ -60,7 +60,7 @@ class ZonesBaseResponse extends TemplateResponse implements ICache $this->redButtons[BUTTON_WOWHEAD] = true; - $conditions = [Cfg::get('SQL_LIMIT_NONE')]; + $conditions = []; // do not limit $visibleCols = []; $hiddenCols = []; diff --git a/includes/components/communitycontent.class.php b/includes/components/communitycontent.class.php index 8b04d7d5..5a2fd7fc 100644 --- a/includes/components/communitycontent.class.php +++ b/includes/components/communitycontent.class.php @@ -108,7 +108,7 @@ class CommunityContent if (!$_) continue; - $obj = Type::newList($type, [Cfg::get('SQL_LIMIT_NONE'), ['id', $_]]); + $obj = Type::newList($type, [['id', $_]]); if (!$obj) continue; @@ -117,7 +117,7 @@ class CommunityContent } } - public static function getCommentPreviews(array $opt = [], ?int &$nFound = 0, bool $dateFmt = true) : array + public static function getCommentPreviews(array $opt = [], ?int &$nFound = 0, bool $dateFmt = true, int $resultLimit = 0) : array { /* purged:0, <- doesnt seem to be used anymore @@ -149,7 +149,7 @@ class CommunityContent CC_FLAG_DELETED, User::$id, User::isInGroup(U_GROUP_COMMENTS_MODERATOR), - Cfg::get('SQL_LIMIT_DEFAULT') + $resultLimit ?: DBSIMPLE_SKIP ); if (!$comments) @@ -295,17 +295,17 @@ class CommunityContent return $comments; } - public static function getVideos(int $typeOrUser = 0, int $typeId = 0, ?int &$nFound = 0, bool $dateFmt = true) : array + public static function getVideos(int $typeOrUser = 0, int $typeId = 0, ?int &$nFound = 0, bool $dateFmt = true, int $resultLimit = 0) : array { $videos = DB::Aowow()->select(self::$viQuery, CC_FLAG_STICKY, - $typeOrUser < 0 ? -$typeOrUser : DBSIMPLE_SKIP, - $typeOrUser > 0 ? $typeOrUser : DBSIMPLE_SKIP, - $typeOrUser > 0 ? $typeId : DBSIMPLE_SKIP, + $typeOrUser < 0 ? -$typeOrUser : DBSIMPLE_SKIP, + $typeOrUser > 0 ? $typeOrUser : DBSIMPLE_SKIP, + $typeOrUser > 0 ? $typeId : DBSIMPLE_SKIP, CC_FLAG_APPROVED, CC_FLAG_DELETED, - !$typeOrUser ? 'date' : 'pos', - !$typeOrUser ? Cfg::get('SQL_LIMIT_SEARCH') : DBSIMPLE_SKIP + !$typeOrUser ? 'date' : 'pos', + $resultLimit ?: DBSIMPLE_SKIP ); if (!$videos) @@ -354,17 +354,17 @@ class CommunityContent return array_values($videos); } - public static function getScreenshots(int $typeOrUser = 0, int $typeId = 0, ?int &$nFound = 0, bool $dateFmt = true) : array + public static function getScreenshots(int $typeOrUser = 0, int $typeId = 0, ?int &$nFound = 0, bool $dateFmt = true, int $resultLimit = 0) : array { $screenshots = DB::Aowow()->select(self::$ssQuery, CC_FLAG_STICKY, - $typeOrUser < 0 ? -$typeOrUser : DBSIMPLE_SKIP, - $typeOrUser > 0 ? $typeOrUser : DBSIMPLE_SKIP, - $typeOrUser > 0 ? $typeId : DBSIMPLE_SKIP, + $typeOrUser < 0 ? -$typeOrUser : DBSIMPLE_SKIP, + $typeOrUser > 0 ? $typeOrUser : DBSIMPLE_SKIP, + $typeOrUser > 0 ? $typeId : DBSIMPLE_SKIP, CC_FLAG_APPROVED, CC_FLAG_DELETED, - !$typeOrUser ? 'date' : DBSIMPLE_SKIP, - !$typeOrUser ? Cfg::get('SQL_LIMIT_SEARCH') : DBSIMPLE_SKIP + !$typeOrUser ? 'date' : DBSIMPLE_SKIP, + $resultLimit ?: DBSIMPLE_SKIP ); if (!$screenshots) @@ -412,19 +412,6 @@ class CommunityContent return array_values($screenshots); } - public static function getAll(int $type, int $typeId, array &$jsg) : array - { - $result = array( - 'vi' => self::getVideos($type, $typeId), - 'ss' => self::getScreenshots($type, $typeId), - 'co' => self::getComments($type, $typeId) - ); - - Util::mergeJsGlobals($jsg, self::$jsGlobals); - - return $result; - } - public static function getJSGlobals() : array { return self::$jsGlobals; diff --git a/includes/components/dbtypelist.class.php b/includes/components/dbtypelist.class.php index d4a8439a..ec51e07f 100644 --- a/includes/components/dbtypelist.class.php +++ b/includes/components/dbtypelist.class.php @@ -59,9 +59,9 @@ abstract class DBTypeList */ public function __construct(array $conditions = [], array $miscData = []) { - $where = []; - $linking = ' AND '; - $limit = Cfg::get('SQL_LIMIT_DEFAULT'); + $where = []; + $linking = ' AND '; + $limit = 0; $calcTotal = false; $totalQuery = ''; @@ -205,10 +205,10 @@ abstract class DBTypeList break; case 'string': case 'integer': - if (is_string($c)) - $linking = $c == 'AND' ? ' AND ' : ' OR '; + if (is_numeric($c)) + $limit = max(0, (int)$c); else - $limit = $c > 0 ? $c : 0; + $linking = $c == 'AND' ? ' AND ' : ' OR '; default: unset($conditions[$i]); } @@ -925,7 +925,7 @@ trait sourceHelper $buff[$_curTpl['moreType']][] = $_curTpl['moreTypeId']; foreach ($buff as $type => $ids) - $this->sourceMore[$type] = Type::newList($type, [Cfg::get('SQL_LIMIT_NONE'), ['id', $ids]]); + $this->sourceMore[$type] = Type::newList($type, [['id', $ids]]); } $s = array_keys($this->sources[$this->id]); diff --git a/includes/components/frontend/listview.class.php b/includes/components/frontend/listview.class.php index 3f9adf6e..0c6da5c8 100644 --- a/includes/components/frontend/listview.class.php +++ b/includes/components/frontend/listview.class.php @@ -8,12 +8,14 @@ if (!defined('AOWOW_REVISION')) class Listview implements \JsonSerializable { - public const MODE_DEFAULT = 0; - public const MODE_CHECKBOX = 1; - public const MODE_DIV = 2; - public const MODE_TILED = 3; - public const MODE_CALENDAR = 4; - public const MODE_FLEXGRID = 5; + public const /* int */ MODE_DEFAULT = 0; + public const /* int */ MODE_CHECKBOX = 1; + public const /* int */ MODE_DIV = 2; + public const /* int */ MODE_TILED = 3; + public const /* int */ MODE_CALENDAR = 4; + public const /* int */ MODE_FLEXGRID = 5; + + public const /* int */ DEFAULT_SIZE = 300; private const TEMPLATES = array( 'achievement' => ['template' => 'achievement', 'id' => 'achievements', 'name' => '$LANG.tab_achievements' ], diff --git a/includes/components/response/baseresponse.class.php b/includes/components/response/baseresponse.class.php index 7afdc72d..98e4bb71 100644 --- a/includes/components/response/baseresponse.class.php +++ b/includes/components/response/baseresponse.class.php @@ -316,7 +316,6 @@ trait TrCache trait TrSearch { - private int $maxResults = 500; private string $query = ''; // sanitized search string private int $searchMask = 0; // what to search for private Search $searchObj; diff --git a/includes/components/response/templateresponse.class.php b/includes/components/response/templateresponse.class.php index 9e7da1b3..f97db6b4 100644 --- a/includes/components/response/templateresponse.class.php +++ b/includes/components/response/templateresponse.class.php @@ -349,7 +349,7 @@ class TemplateResponse extends BaseResponse $this->initJSGlobal($type); - $obj = Type::newList($type, [Cfg::get('SQL_LIMIT_NONE'), ['id', array_unique($ids, SORT_NUMERIC)]]); + $obj = Type::newList($type, [['id', array_unique($ids, SORT_NUMERIC)]]); if (!$obj) continue; diff --git a/includes/components/screenshotmgr.class.php b/includes/components/screenshotmgr.class.php index 5a5ff4a1..49beb62a 100644 --- a/includes/components/screenshotmgr.class.php +++ b/includes/components/screenshotmgr.class.php @@ -198,7 +198,7 @@ class ScreenshotMgr extends ImageUpload if (!$ids) continue; - $obj = Type::newList($t, [Cfg::get('SQL_LIMIT_NONE'), ['id', $ids]]); + $obj = Type::newList($t, [['id', $ids]]); if (!$obj || $obj->error) continue; diff --git a/includes/components/search.class.php b/includes/components/search.class.php index 6aa8f6fd..474252ee 100644 --- a/includes/components/search.class.php +++ b/includes/components/search.class.php @@ -8,6 +8,9 @@ if (!defined('AOWOW_REVISION')) class Search { + public const /* int */ DEFAULT_MAX_RESULTS = 500; + public const /* int */ SUGGESTIONS_MAX_RESULTS = 10; + public const /* int */ MOD_CLASS = 0; public const /* int */ MOD_RACE = 1; public const /* int */ MOD_TITLE = 2; @@ -81,7 +84,7 @@ class Search public array $invalid = []; - public function __construct(private string $query, private int $moduleMask = -1, private int $maxResults = 500, private array $extraCnd = [], private array $extraOpts = []) + public function __construct(private string $query, private int $moduleMask = -1, private array $extraCnd = [], private array $extraOpts = [], private int $maxResults = self::DEFAULT_MAX_RESULTS) { $this->tokenizeQuery(); @@ -467,7 +470,7 @@ class Search { if (!empty($shared['pcsToSet'])) { - $cnd = [['i.id', array_keys($shared['pcsToSet'])], Cfg::get('SQL_LIMIT_NONE')]; + $cnd = [['i.id', array_keys($shared['pcsToSet'])]]; $miscData = ['pcsToSet' => $shared['pcsToSet']]; } else diff --git a/includes/components/videomgr.class.php b/includes/components/videomgr.class.php index a9b6e07f..c43ee1fa 100644 --- a/includes/components/videomgr.class.php +++ b/includes/components/videomgr.class.php @@ -197,7 +197,7 @@ class VideoMgr if (!$ids) continue; - $obj = Type::newList($t, [Cfg::get('SQL_LIMIT_NONE'), ['id', $ids]]); + $obj = Type::newList($t, [['id', $ids]]); if (!$obj || $obj->error) continue; diff --git a/includes/dbtypes/arenateam.class.php b/includes/dbtypes/arenateam.class.php index a5947644..545e8332 100644 --- a/includes/dbtypes/arenateam.class.php +++ b/includes/dbtypes/arenateam.class.php @@ -177,11 +177,11 @@ class RemoteArenaTeamList extends ArenaTeamList ); // equalize subject distribution across realms + $limit = 0; foreach ($conditions as $c) - if (is_int($c)) - $limit = $c; + if (is_numeric($c)) + $limit = max(0, (int)$c); - $limit ??= Cfg::get('SQL_LIMIT_DEFAULT'); if (!$limit) // int:0 means unlimited, so skip early return; @@ -219,7 +219,7 @@ class RemoteArenaTeamList extends ArenaTeamList foreach ($teams as $team) $gladiators = array_merge($gladiators, array_keys($team)); - $profiles[$realmId] = new RemoteProfileList(array(['c.guid', $gladiators], Cfg::get('SQL_LIMIT_NONE')), ['sv' => $realmId]); + $profiles[$realmId] = new RemoteProfileList(array(['c.guid', $gladiators]), ['sv' => $realmId]); if (!$profiles[$realmId]->error) $profiles[$realmId]->initializeLocalEntries(); diff --git a/includes/dbtypes/guild.class.php b/includes/dbtypes/guild.class.php index b58e288c..623f6ee5 100644 --- a/includes/dbtypes/guild.class.php +++ b/includes/dbtypes/guild.class.php @@ -190,11 +190,12 @@ class RemoteGuildList extends GuildList $distrib[$curTpl['realm']]++; } + // equalize subject distribution across realms + $limit = 0; foreach ($conditions as $c) - if (is_int($c)) - $limit = $c; + if (is_numeric($c)) + $limit = max(0, (int)$c); - $limit ??= Cfg::get('SQL_LIMIT_DEFAULT'); if (!$limit) // int:0 means unlimited, so skip early return; diff --git a/includes/dbtypes/item.class.php b/includes/dbtypes/item.class.php index b1038688..1073f666 100644 --- a/includes/dbtypes/item.class.php +++ b/includes/dbtypes/item.class.php @@ -1581,7 +1581,7 @@ class ItemList extends DBTypeList array_column($randEnchants, 'enchantId5') )); - $enchants = new EnchantmentList(array(['id', $enchIds], Cfg::get('SQL_LIMIT_NONE'))); + $enchants = new EnchantmentList(array(['id', $enchIds])); foreach ($enchants->iterate() as $eId => $_) { $this->rndEnchIds[$eId] = array( diff --git a/includes/dbtypes/profile.class.php b/includes/dbtypes/profile.class.php index 98819401..f3a4b1f8 100644 --- a/includes/dbtypes/profile.class.php +++ b/includes/dbtypes/profile.class.php @@ -535,11 +535,12 @@ class RemoteProfileList extends ProfileList $talentSpells = DB::Aowow()->select('SELECT `spell` AS ARRAY_KEY, `tab`, `rank` FROM ?_talents WHERE `class` IN (?a)', array_unique($talentSpells)); + // equalize subject distribution across realms + $limit = 0; foreach ($conditions as $c) - if (is_int($c)) - $limit = $c; + if (is_numeric($c)) + $limit = max(0, (int)$c); - $limit ??= Cfg::get('SQL_LIMIT_DEFAULT'); if (!$limit) // int:0 means unlimited, so skip process $distrib = []; diff --git a/includes/dbtypes/spell.class.php b/includes/dbtypes/spell.class.php index 9ab553a8..6ee9b373 100644 --- a/includes/dbtypes/spell.class.php +++ b/includes/dbtypes/spell.class.php @@ -177,7 +177,7 @@ class SpellList extends DBTypeList } if ($foo) - $this->relItems = new ItemList(array(['i.id', array_unique($foo)], Cfg::get('SQL_LIMIT_NONE'))); + $this->relItems = new ItemList(array(['i.id', array_unique($foo)])); } // required for item-comparison diff --git a/includes/game/loot/lootbycontainer.class.php b/includes/game/loot/lootbycontainer.class.php index 1889aa68..6d9962c7 100644 --- a/includes/game/loot/lootbycontainer.class.php +++ b/includes/game/loot/lootbycontainer.class.php @@ -169,7 +169,7 @@ class LootByContainer extends Loot if (!$lootRows) continue; - $items = new ItemList(array(['i.id', $itemIds], Cfg::get('SQL_LIMIT_NONE'))); + $items = new ItemList(array(['i.id', $itemIds])); $this->storeJSGlobals($items->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); $itemRows = $items->getListviewData(); diff --git a/includes/game/loot/lootbyitem.class.php b/includes/game/loot/lootbyitem.class.php index 0564950b..f6387a36 100644 --- a/includes/game/loot/lootbyitem.class.php +++ b/includes/game/loot/lootbyitem.class.php @@ -149,14 +149,11 @@ class LootByItem extends Loot * @param array $lootTableList [optional] limit lookup to provided loot template table names * @return bool success */ - public function getByItem(int $maxResults = -1, array $lootTableList = []) : bool + public function getByItem(int $maxResults = Listview::DEFAULT_SIZE, array $lootTableList = []) : bool { if (!$this->entry) return false; - if ($maxResults < 0) - $maxResults = Cfg::get('SQL_LIMIT_DEFAULT'); - $refResults = []; /* @@ -271,7 +268,7 @@ class LootByItem extends Loot [$type, &$data, , , &$extraCols, ,] = $this->listviewTabs[$tabId]; - $srcObj = Type::newList($type, array([$dbField, $ids])); + $srcObj = Type::newList($type, [[$dbField, $ids]]); if (!$srcObj || $srcObj->error) return false; @@ -342,7 +339,7 @@ class LootByItem extends Loot 'OR', ['AND', ['effect1CreateItemId', $this->entry], ['OR', ['effect1Id', SpellList::EFFECTS_ITEM_CREATE], ['effect1AuraId', SpellList::AURAS_ITEM_CREATE]]], ['AND', ['effect2CreateItemId', $this->entry], ['OR', ['effect2Id', SpellList::EFFECTS_ITEM_CREATE], ['effect2AuraId', SpellList::AURAS_ITEM_CREATE]]], - ['AND', ['effect3CreateItemId', $this->entry], ['OR', ['effect3Id', SpellList::EFFECTS_ITEM_CREATE], ['effect3AuraId', SpellList::AURAS_ITEM_CREATE]]], + ['AND', ['effect3CreateItemId', $this->entry], ['OR', ['effect3Id', SpellList::EFFECTS_ITEM_CREATE], ['effect3AuraId', SpellList::AURAS_ITEM_CREATE]]] ); if ($ids) $conditions[] = ['id', $ids]; diff --git a/includes/kernel.php b/includes/kernel.php index 003da12e..a4a0420e 100644 --- a/includes/kernel.php +++ b/includes/kernel.php @@ -7,7 +7,7 @@ mb_substitute_character('none'); // drop invalid char error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR); -define('AOWOW_REVISION', 44); +define('AOWOW_REVISION', 45); define('OS_WIN', substr(PHP_OS, 0, 3) == 'WIN'); // OS_WIN as per compile info of php define('CLI', PHP_SAPI === 'cli'); define('CLI_HAS_E', CLI && // WIN10 and later usually support ANSI escape sequences diff --git a/setup/sql/02-db_initial_data.sql b/setup/sql/02-db_initial_data.sql index ba45539a..654f06fd 100644 --- a/setup/sql/02-db_initial_data.sql +++ b/setup/sql/02-db_initial_data.sql @@ -61,7 +61,7 @@ UNLOCK TABLES; LOCK TABLES `aowow_config` WRITE; /*!40000 ALTER TABLE `aowow_config` DISABLE KEYS */; -INSERT INTO `aowow_config` VALUES ('acc_allow_register','1','1',3,132,'allow/disallow account creation (requires AUTH_MODE: aowow)'),('acc_auth_mode','0','0',3,1425,'source to auth against - 0:AoWoW, 1:TC auth-table, 2:External script (config/extAuth.php)'),('acc_create_save_decay','604800','604800',3,129,'time in wich an unconfirmed account cannot be overwritten by new registrations'),('acc_ext_create_url','',NULL,3,136,'if auth mode is not self; link to external account creation'),('acc_ext_recover_url','',NULL,3,136,'if auth mode is not self; link to external account recovery'),('acc_failed_auth_block','900','15 * 60',3,129,'how long an account is closed after exceeding FAILED_AUTH_COUNT (in seconds)'),('acc_failed_auth_count','5','5',3,129,'how often invalid passwords are tolerated'),('acc_max_avatar_uploads','10','10',3,129,'premium users may upload this many avatars'),('acc_recovery_decay','300','300',3,129,'time to recover your account and new recovery requests are blocked'),('acc_rename_decay','2592000','30 * 24 * 60 * 60',3,129,'delay between username changes'),('battlegroup','Pure Pwnage',NULL,1,136,'pretend, we belong to a battlegroup to satisfy profiler-related javascripts'),('board_url','http://www.wowhead.com/forums?board=',NULL,1,136,'another halfbaked javascript thing..'),('cache_decay','25200','60 * 60 * 7',2,129,'time to keep cache in seconds'),('cache_dir','','cache/template',2,136,'generated pages are saved here (requires CACHE_MODE: filecache)'),('cache_mode','1','1',2,1185,'set cache method - 0:filecache, 1:memcached'),('contact_email','feedback@aowow.org',NULL,1,136,'displayed sender for auth-mails, ect'),('debug','0','0',1,145,'disable cache, enable error_reporting - 0:None, 1:Error, 2:Warning, 3:Info'),('default_charset','utf-8',NULL,0,72,''),('force_ssl','0','0',1,132,'enforce SSL, if auto-detect fails'),('gtag_measurement_id','',NULL,6,136,'enter your Google Tag measurement ID here to track site stats'),('locales','349','0x15D',1,1441,'allowed locales - 0:English, 2:French, 3:German, 4:Chinese, 6:Spanish, 8:Russian'),('maintenance','1','0',1,132,'display brb gnomes and block access for non-staff'),('memory_limit','1500M','1500M',0,200,'parsing spell.dbc is quite intense'),('name','Aowow Database Viewer (ADV)',NULL,1,136,'website title'),('name_short','Aowow',NULL,1,136,'feed title'),('profiler_enable','0','0',7,1412,'enable/disable profiler feature'),('profiler_queue_delay','3000','3000',7,129,'min. delay between queue cycles (in ms)'),('profiler_resync_delay','3600','1 * 60 * 60',7,129,'how often a character can be refreshed (in sec)'),('profiler_resync_ping','5000','5000',7,129,'how often the javascript asks for for updates, when queued (in ms)'),('rep_req_border_epic','15000','15000',5,129,'required reputation for epic quality avatar border'),('rep_req_border_legendary','25000','25000',5,129,'required reputation for legendary quality avatar border'),('rep_req_border_rare','10000','10000',5,129,'required reputation for rare quality avatar border'),('rep_req_border_uncommon','5000','5000',5,129,'required reputation for uncommon quality avatar border'),('rep_req_comment','75','75',5,129,'required reputation to write a comment'),('rep_req_downvote','250','250',5,129,'required reputation to downvote comments'),('rep_req_ext_links','150','150',5,129,'required reputation to link to external sites'),('rep_req_premium','25000','25000',5,129,'required reputation for premium status through reputation'),('rep_req_reply','75','75',5,129,'required reputation to write a reply'),('rep_req_supervote','2500','2500',5,129,'required reputation for double vote effect'),('rep_req_upvote','125','125',5,129,'required reputation to upvote comments'),('rep_req_votemore_add','250','250',5,129,'required reputation per additional vote past threshold'),('rep_req_votemore_base','2000','2000',5,129,'gains more votes past this threshold'),('rep_reward_article','100','100',5,129,'submitted an approved article/guide'),('rep_reward_bad_report','0','0',5,129,'filed a rejected report'),('rep_reward_comment','1','1',5,129,'created a comment (not a reply)'),('rep_reward_dailyvisit','5','5',5,129,'daily visit'),('rep_reward_downvoted','0','0',5,129,'comment received downvote'),('rep_reward_good_report','10','10',5,129,'filed an accepted report'),('rep_reward_register','100','100',5,129,'activated an account'),('rep_reward_submit_screenshot','10','10',5,129,'uploaded screenshot was approved'),('rep_reward_suggest_video','10','10',5,129,'suggested video was approved'),('rep_reward_upvoted','5','5',5,129,'comment received upvote'),('rep_reward_user_suspended','-200','-200',5,129,'moderator revoked rights'),('rep_reward_user_warned','-50','-50',5,129,'moderator imposed a warning'),('screenshot_min_size','200','200',1,1153,'minimum dimensions of uploaded screenshots in px (yes, it\'s square, no it cant go below 200)'),('serialize_precision','5',NULL,0,65,''),('session_cache_dir','',NULL,4,136,'php sessions are saved here. Leave empty to use php default directory.'),('session_timeout_delay','3600','60 * 60',4,129,'non-permanent session times out in time() + X'),('session.gc_divisor','100','100',4,200,'probability to remove session data on garbage collection'),('session.gc_maxlifetime','604800','7 * 24 * 60 * 60',4,200,'lifetime of session data'),('session.gc_probability','1','0',4,200,'probability to remove session data on garbage collection'),('site_host','',NULL,1,904,'points js to executable files'),('sql_limit_default','300','300',1,129,'max results for listviews'),('sql_limit_none','0','0',1,129,'unlimited results (i wouldn\'t change that mate)'),('sql_limit_quicksearch','10','10',1,129,'max results for suggestions'),('sql_limit_search','500','500',1,129,'max results for search'),('static_host','',NULL,1,904,'points js to images & scripts'),('ttl_rss','60','60',1,129,'time to live for RSS (in seconds)'),('ua_measurement_key','',NULL,6,136,'[DEPRECATED ?] Enter your Google Universal Analytics key here to track site stats'),('user_max_votes','50','50',1,129,'vote limit per day'); +INSERT INTO `aowow_config` VALUES ('acc_allow_register','1','1',3,132,'allow/disallow account creation (requires AUTH_MODE: aowow)'),('acc_auth_mode','0','0',3,1425,'source to auth against - 0:AoWoW, 1:TC auth-table, 2:External script (config/extAuth.php)'),('acc_create_save_decay','604800','604800',3,129,'time in wich an unconfirmed account cannot be overwritten by new registrations'),('acc_ext_create_url','',NULL,3,136,'if auth mode is not self; link to external account creation'),('acc_ext_recover_url','',NULL,3,136,'if auth mode is not self; link to external account recovery'),('acc_failed_auth_block','900','15 * 60',3,129,'how long an account is closed after exceeding FAILED_AUTH_COUNT (in seconds)'),('acc_failed_auth_count','5','5',3,129,'how often invalid passwords are tolerated'),('acc_max_avatar_uploads','10','10',3,129,'premium users may upload this many avatars'),('acc_recovery_decay','300','300',3,129,'time to recover your account and new recovery requests are blocked'),('acc_rename_decay','2592000','30 * 24 * 60 * 60',3,129,'delay between username changes'),('battlegroup','Pure Pwnage',NULL,1,136,'pretend, we belong to a battlegroup to satisfy profiler-related javascripts'),('board_url','http://www.wowhead.com/forums?board=',NULL,1,136,'another halfbaked javascript thing..'),('cache_decay','25200','60 * 60 * 7',2,129,'time to keep cache in seconds'),('cache_dir','','cache/template',2,136,'generated pages are saved here (requires CACHE_MODE: filecache)'),('cache_mode','1','1',2,1185,'set cache method - 0:filecache, 1:memcached'),('contact_email','feedback@aowow.org',NULL,1,136,'displayed sender for auth-mails, ect'),('debug','0','0',1,145,'disable cache, enable error_reporting - 0:None, 1:Error, 2:Warning, 3:Info'),('default_charset','utf-8',NULL,0,72,''),('force_ssl','0','0',1,132,'enforce SSL, if auto-detect fails'),('gtag_measurement_id','',NULL,6,136,'enter your Google Tag measurement ID here to track site stats'),('locales','349','0x15D',1,1441,'allowed locales - 0:English, 2:French, 3:German, 4:Chinese, 6:Spanish, 8:Russian'),('maintenance','1','0',1,132,'display brb gnomes and block access for non-staff'),('memory_limit','1500M','1500M',0,200,'parsing spell.dbc is quite intense'),('name','Aowow Database Viewer (ADV)',NULL,1,136,'website title'),('name_short','Aowow',NULL,1,136,'feed title'),('profiler_enable','0','0',7,1412,'enable/disable profiler feature'),('profiler_queue_delay','3000','3000',7,129,'min. delay between queue cycles (in ms)'),('profiler_resync_delay','3600','1 * 60 * 60',7,129,'how often a character can be refreshed (in sec)'),('profiler_resync_ping','5000','5000',7,129,'how often the javascript asks for for updates, when queued (in ms)'),('rep_req_border_epic','15000','15000',5,129,'required reputation for epic quality avatar border'),('rep_req_border_legendary','25000','25000',5,129,'required reputation for legendary quality avatar border'),('rep_req_border_rare','10000','10000',5,129,'required reputation for rare quality avatar border'),('rep_req_border_uncommon','5000','5000',5,129,'required reputation for uncommon quality avatar border'),('rep_req_comment','75','75',5,129,'required reputation to write a comment'),('rep_req_downvote','250','250',5,129,'required reputation to downvote comments'),('rep_req_ext_links','150','150',5,129,'required reputation to link to external sites'),('rep_req_premium','25000','25000',5,129,'required reputation for premium status through reputation'),('rep_req_reply','75','75',5,129,'required reputation to write a reply'),('rep_req_supervote','2500','2500',5,129,'required reputation for double vote effect'),('rep_req_upvote','125','125',5,129,'required reputation to upvote comments'),('rep_req_votemore_add','250','250',5,129,'required reputation per additional vote past threshold'),('rep_req_votemore_base','2000','2000',5,129,'gains more votes past this threshold'),('rep_reward_article','100','100',5,129,'submitted an approved article/guide'),('rep_reward_bad_report','0','0',5,129,'filed a rejected report'),('rep_reward_comment','1','1',5,129,'created a comment (not a reply)'),('rep_reward_dailyvisit','5','5',5,129,'daily visit'),('rep_reward_downvoted','0','0',5,129,'comment received downvote'),('rep_reward_good_report','10','10',5,129,'filed an accepted report'),('rep_reward_register','100','100',5,129,'activated an account'),('rep_reward_submit_screenshot','10','10',5,129,'uploaded screenshot was approved'),('rep_reward_suggest_video','10','10',5,129,'suggested video was approved'),('rep_reward_upvoted','5','5',5,129,'comment received upvote'),('rep_reward_user_suspended','-200','-200',5,129,'moderator revoked rights'),('rep_reward_user_warned','-50','-50',5,129,'moderator imposed a warning'),('screenshot_min_size','200','200',1,1153,'minimum dimensions of uploaded screenshots in px (yes, it\'s square, no it cant go below 200)'),('serialize_precision','5',NULL,0,65,''),('session_cache_dir','',NULL,4,136,'php sessions are saved here. Leave empty to use php default directory.'),('session_timeout_delay','3600','60 * 60',4,129,'non-permanent session times out in time() + X'),('session.gc_divisor','100','100',4,200,'probability to remove session data on garbage collection'),('session.gc_maxlifetime','604800','7 * 24 * 60 * 60',4,200,'lifetime of session data'),('session.gc_probability','1','0',4,200,'probability to remove session data on garbage collection'),('site_host','',NULL,1,904,'points js to executable files'),('static_host','',NULL,1,904,'points js to images & scripts'),('ttl_rss','60','60',1,129,'time to live for RSS (in seconds)'),('ua_measurement_key','',NULL,6,136,'[DEPRECATED ?] Enter your Google Universal Analytics key here to track site stats'),('user_max_votes','50','50',1,129,'vote limit per day'); /*!40000 ALTER TABLE `aowow_config` ENABLE KEYS */; UNLOCK TABLES; diff --git a/setup/sql/updates/1767051301_01.sql b/setup/sql/updates/1767051301_01.sql new file mode 100644 index 00000000..1e13478c --- /dev/null +++ b/setup/sql/updates/1767051301_01.sql @@ -0,0 +1,4 @@ +DELETE FROM aowow_config WHERE `key` = 'sql_limit_default'; +DELETE FROM aowow_config WHERE `key` = 'sql_limit_none'; +DELETE FROM aowow_config WHERE `key` = 'sql_limit_quicksearch'; +DELETE FROM aowow_config WHERE `key` = 'sql_limit_search'; diff --git a/setup/tools/filegen/enchants.ss.php b/setup/tools/filegen/enchants.ss.php index fd2e6304..a33f0b7a 100644 --- a/setup/tools/filegen/enchants.ss.php +++ b/setup/tools/filegen/enchants.ss.php @@ -83,7 +83,7 @@ CLISetup::registerSetup("build", new class extends SetupScript $enchIds = array_column($enchantSpells, 'effect1MiscValue'); - $enchantments = new EnchantmentList(array(['id', $enchIds], Cfg::get('SQL_LIMIT_NONE'))); + $enchantments = new EnchantmentList(array(['id', $enchIds])); if ($enchantments->error) { CLI::write('[enchants] Required table ?_itemenchantment seems to be empty!', CLI::LOG_ERROR); @@ -91,7 +91,7 @@ CLISetup::registerSetup("build", new class extends SetupScript return false; } - $castItems = new ItemList(array(['spellId1', array_keys($enchantSpells)], ['src.typeId', null, '!'], Cfg::get('SQL_LIMIT_NONE'))); + $castItems = new ItemList(array(['spellId1', array_keys($enchantSpells)], ['src.typeId', null, '!'])); if ($castItems->error) { CLI::write('[enchants] Required table ?_items seems to be empty!', CLI::LOG_ERROR); diff --git a/setup/tools/filegen/gems.ss.php b/setup/tools/filegen/gems.ss.php index 85dac421..db85ef53 100644 --- a/setup/tools/filegen/gems.ss.php +++ b/setup/tools/filegen/gems.ss.php @@ -53,7 +53,7 @@ CLISetup::registerSetup("build", new class extends SetupScript EXP_BC, EXP_WOTLK ); - $enchantments = new EnchantmentList(array(['id', array_column($gems, 'enchId')], Cfg::get('SQL_LIMIT_NONE'))); + $enchantments = new EnchantmentList(array(['id', array_column($gems, 'enchId')])); if ($enchantments->error) { CLI::write('[gems] Required table ?_itemenchantment seems to be empty!', CLI::LOG_ERROR); diff --git a/setup/tools/filegen/glyphs.ss.php b/setup/tools/filegen/glyphs.ss.php index 479a641b..dc2b03b2 100644 --- a/setup/tools/filegen/glyphs.ss.php +++ b/setup/tools/filegen/glyphs.ss.php @@ -52,7 +52,7 @@ CLISetup::registerSetup("build", new class extends SetupScript WHERE i.classBak = ?d', ITEM_CLASS_GLYPH); - $glyphSpells = new SpellList(array(['s.id', array_keys($glyphList)], Cfg::get('SQL_LIMIT_NONE'))); + $glyphSpells = new SpellList(array(['s.id', array_keys($glyphList)])); foreach (CLISetup::$locales as $loc) { diff --git a/setup/tools/filegen/profiler.ss.php b/setup/tools/filegen/profiler.ss.php index 576d057b..03ffa0c3 100644 --- a/setup/tools/filegen/profiler.ss.php +++ b/setup/tools/filegen/profiler.ss.php @@ -56,7 +56,6 @@ CLISetup::registerSetup("build", new class extends SetupScript $questorder = []; $questtotal = []; $condition = [ - Cfg::get('SQL_LIMIT_NONE'), 'AND', [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW | CUSTOM_UNAVAILABLE | CUSTOM_DISABLED, '&'], 0], [['flags', QUEST_FLAG_DAILY | QUEST_FLAG_WEEKLY | QUEST_FLAG_REPEATABLE | QUEST_FLAG_AUTO_REWARDED, '&'], 0], @@ -125,11 +124,7 @@ CLISetup::registerSetup("build", new class extends SetupScript private function titles(): void { - $condition = array( - Cfg::get('SQL_LIMIT_NONE'), - [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0], - ); - $titlez = new TitleList($condition); + $titlez = new TitleList(array([['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0])); // get titles for exclusion foreach ($titlez->iterate() as $id => $__) @@ -161,7 +156,6 @@ CLISetup::registerSetup("build", new class extends SetupScript private function mounts() : void { $condition = array( - Cfg::get('SQL_LIMIT_NONE'), [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0], ['typeCat', -5], ['castTime', 0, '!'] @@ -210,7 +204,6 @@ CLISetup::registerSetup("build", new class extends SetupScript private function companions() : void { $condition = array( - Cfg::get('SQL_LIMIT_NONE'), [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0], ['typeCat', -6] ); @@ -246,11 +239,7 @@ CLISetup::registerSetup("build", new class extends SetupScript private function factions() : void { - $condition = array( - Cfg::get('SQL_LIMIT_NONE'), - [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0] - ); - $factionz = new FactionList($condition); + $factionz = new FactionList(array([['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0])); foreach (CLISetup::$locales as $loc) { @@ -279,7 +268,6 @@ CLISetup::registerSetup("build", new class extends SetupScript ); $baseCnd = array( - Cfg::get('SQL_LIMIT_NONE'), [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0], // Inscryption Engineering ['effect1Id', [SPELL_EFFECT_APPLY_AURA, SPELL_EFFECT_TRADE_SKILL, SPELL_EFFECT_PROSPECTING, SPELL_EFFECT_OPEN_LOCK, SPELL_EFFECT_MILLING, SPELL_EFFECT_DISENCHANT, SPELL_EFFECT_SUMMON, SPELL_EFFECT_SKINNING], '!'], @@ -340,7 +328,6 @@ CLISetup::registerSetup("build", new class extends SetupScript private function achievements() : void { $condition = array( - Cfg::get('SQL_LIMIT_NONE'), [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0], [['flags', 1, '&'], 0], // no statistics ); diff --git a/setup/tools/filegen/talentcalc.ss.php b/setup/tools/filegen/talentcalc.ss.php index aac14bc7..cb43833f 100644 --- a/setup/tools/filegen/talentcalc.ss.php +++ b/setup/tools/filegen/talentcalc.ss.php @@ -49,12 +49,12 @@ CLISetup::registerSetup("build", new class extends SetupScript // my neighbour is noisy as fuck and my head hurts, so .. $this->petFamIcons = ['Ability_Druid_KingoftheJungle', 'Ability_Druid_DemoralizingRoar', 'Ability_EyeOfTheOwl']; // .. i've no idea where to fetch these from - $this->spellMods = (new SpellList(array(['typeCat', -2], Cfg::get('SQL_LIMIT_NONE'))))->getProfilerMods(); + $this->spellMods = (new SpellList(array(['typeCat', -2])))->getProfilerMods(); $petIcons = Util::toJSON(DB::Aowow()->SelectCol('SELECT `id` AS ARRAY_KEY, LOWER(SUBSTRING_INDEX(`iconString`, "\\\\", -1)) AS "iconString" FROM dbc_creaturefamily WHERE `petTalentType` IN (0, 1, 2)')); $tSpellIds = DB::Aowow()->selectCol('SELECT `rank1` FROM dbc_talent UNION SELECT `rank2` FROM dbc_talent UNION SELECT `rank3` FROM dbc_talent UNION SELECT `rank4` FROM dbc_talent UNION SELECT `rank5` FROM dbc_talent'); - $this->tSpells = new SpellList(array(['s.id', $tSpellIds], Cfg::get('SQL_LIMIT_NONE'))); + $this->tSpells = new SpellList(array(['s.id', $tSpellIds])); foreach (CLISetup::$locales as $loc) {