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
This commit is contained in:
Sarjuuk 2025-12-30 02:55:43 +01:00
parent b9d888ab3a
commit c44bf4f575
69 changed files with 183 additions and 219 deletions

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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);
}

View file

@ -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);

View file

@ -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];

View file

@ -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();

View file

@ -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;
}

View file

@ -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]));

View file

@ -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];

View file

@ -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');

View file

@ -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];

View file

@ -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],

View file

@ -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);
}

View file

@ -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));

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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();

View file

@ -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&amp;id='.$comment['id'];

View file

@ -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();

View file

@ -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 = '<a href="'.Cfg::get('HOST_URL').'/?'.Type::getFileString($screenshot['type']).'='.$screenshot['typeId'].'#screenshots:id='.$screenshot['id'].'"><img src="'.Cfg::get('STATIC_URL').'/uploads/screenshots/thumb/'.$screenshot['id'].'.jpg" alt="" /></a>';
if ($screenshot['caption'])

View file

@ -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();

View file

@ -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 = '<a href="'.Cfg::get('HOST_URL').'/?'.Type::getFileString($video['type']).'='.$video['typeId'].'#videos:id='.$video['id'].'"><img src="//i3.ytimg.com/vi/'.$video['videoId'].'/default.jpg" alt="" /></a>';
if ($video['caption'])

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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;
}
}

View file

@ -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(

View file

@ -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];

View file

@ -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();

View file

@ -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)

View file

@ -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)

View file

@ -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];

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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());

View file

@ -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];

View file

@ -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];

View file

@ -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;
}
}

View file

@ -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));

View file

@ -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;
}

View file

@ -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];

View file

@ -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 = [];

View file

@ -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();

View file

@ -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.')';

View file

@ -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));

View file

@ -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 = [];

View file

@ -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;

View file

@ -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]);

View file

@ -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' ],

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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();

View file

@ -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;

View file

@ -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(

View file

@ -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 = [];

View file

@ -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

View file

@ -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();

View file

@ -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];

View file

@ -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

File diff suppressed because one or more lines are too long

View file

@ -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';

View file

@ -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);

View file

@ -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);

View file

@ -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)
{

View file

@ -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
);

View file

@ -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)
{