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:
parent
b9d888ab3a
commit
c44bf4f575
69 changed files with 183 additions and 219 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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]));
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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'];
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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'])
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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'])
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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 = [];
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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.')';
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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 = [];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue