mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
- plus food and talents, minus zones (those are just madning) - also addes some bc/classic information on pet scaling * mucked about the modelviewer, always uses high quality version .. should muck about some more to add animation-info and remove the java-option * fixed some minor issues in spell maxaffectedtaregs in spell is displayed properly and erronous adding all classes/races to globals if none where selected * created own table for creatures which unifies creature_template, locales_creature, creature_template_addon and some creatureDisplayInfo.dbc information * more work against listviews and general structure in global.js .. should probably split this file by class and reassemble it for use
126 lines
4.2 KiB
PHP
126 lines
4.2 KiB
PHP
<?php
|
|
|
|
if (!defined('AOWOW_REVISION'))
|
|
die('illegal access');
|
|
|
|
|
|
require 'includes/class.filter.php';
|
|
|
|
$cats = Util::extractURLParams($pageParam);
|
|
$path = [0, 9];
|
|
$title = [];
|
|
$filter = [];
|
|
$filterHash = !empty($_GET['filter']) ? '#'.sha1(serialize($_GET['filter'])) : null;
|
|
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_ACHIEVEMENT, -1, implode('.', $cats).$filterHash, User::$localeId]);
|
|
$validCats = array(
|
|
92 => true,
|
|
96 => [14861, 14862, 14863],
|
|
97 => [14777, 14778, 14779, 14780],
|
|
95 => [165, 14801, 14802, 14803, 14804, 14881, 14901, 15003],
|
|
168 => [14808, 14805, 14806, 14921, 14922, 14923, 14961, 14962, 15001, 15002, 15041, 15042],
|
|
169 => [170, 171, 172],
|
|
201 => [14864, 14865, 14866],
|
|
155 => [160, 187, 159, 163, 161, 162, 158, 14981, 156, 14941],
|
|
81 => true,
|
|
1 => array (
|
|
130 => [140, 145, 147, 191],
|
|
141 => true,
|
|
128 => [135, 136, 137],
|
|
122 => [123, 124, 125, 126, 127],
|
|
133 => true,
|
|
14807 => [14821, 14822, 14823, 14963, 15021, 15062],
|
|
132 => [178, 173],
|
|
134 => true,
|
|
131 => true,
|
|
21 => [152, 153, 154]
|
|
)
|
|
);
|
|
|
|
if (!Util::isValidPage($validCats, $cats))
|
|
$smarty->error();
|
|
|
|
if (!$smarty->loadCache($cacheKey, $pageData, $filter))
|
|
{
|
|
// include child categories if current category is empty
|
|
$condition = !$cats[0] ? null : (int)end($cats);
|
|
$acvList = new AchievementList($condition ? [['category', $condition]] : [], true);
|
|
if (!$acvList->getMatches())
|
|
{
|
|
$curCats = $catList = [$condition ? $condition : 0];
|
|
while ($curCats)
|
|
{
|
|
$curCats = DB::Aowow()->SelectCol('SELECT Id FROM ?_achievementCategory WHERE parentCategory IN (?a)', $curCats);
|
|
$catList = array_merge($catList, $curCats);
|
|
}
|
|
$acvList = new AchievementList($catList ? [['category', $catList]] : [], true);
|
|
}
|
|
|
|
// recreate form selection
|
|
$filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
|
|
$filter['setCr'] = $acvList->filterGetSetCriteria();
|
|
$filter = array_merge($acvList->filterGetForm(), $filter);
|
|
|
|
// create page title and path
|
|
if (is_array($cats))
|
|
{
|
|
$catrows = DB::Aowow()->Select('SELECT * FROM ?_achievementcategory WHERE id IN (?a)',
|
|
$cats
|
|
);
|
|
|
|
foreach ($catrows as $cat)
|
|
{
|
|
$path[] = $cat['id'];
|
|
$title[] = Util::localizedString($cat, 'name');
|
|
}
|
|
array_unshift($title, Util::ucFirst(Lang::$game['achievements']));
|
|
}
|
|
|
|
// listview content
|
|
$pageData = array(
|
|
'data' => $acvList->getListviewData(),
|
|
'params' => []
|
|
);
|
|
|
|
// fill g_items, g_titles, g_achievements
|
|
$acvList->addGlobalsToJscript($pageData);
|
|
$acvList->addRewardsToJScript($pageData);
|
|
|
|
// if we are have different cats display field
|
|
if ($acvList->hasDiffFields(['category']))
|
|
$pageData['params']['visibleCols'] = "$['category']";
|
|
|
|
// create note if search limit was exceeded
|
|
if ($acvList->getMatches() > $AoWoWconf['sqlLimit'])
|
|
{
|
|
$pageData['params']['note'] = '$'.sprintf(Util::$filterResultString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), $AoWoWconf['sqlLimit']);
|
|
$pageData['params']['_truncated'] = 1;
|
|
}
|
|
|
|
if ($acvList->filterGetError())
|
|
$pageData['params']['_errors'] = '$1';
|
|
|
|
$smarty->saveCache($cacheKey, $pageData, $filter);
|
|
}
|
|
|
|
$page = array(
|
|
'tab' => 0, // for g_initHeader($tab)
|
|
'subCat' => $pageParam ? '='.$pageParam : '',
|
|
'title' => implode(" - ", $title),
|
|
'path' => "[".implode(", ", $path)."]",
|
|
'reqJS' => array(
|
|
array('path' => 'template/js/filters.js', 'conditional' => false),
|
|
),
|
|
);
|
|
|
|
// sort for dropdown-menus
|
|
asort(Lang::$game['si']);
|
|
|
|
$smarty->updatePageVars($page);
|
|
$smarty->assign('filter', $filter);
|
|
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$achievement));
|
|
$smarty->assign('mysql', DB::Aowow()->getStatistics());
|
|
$smarty->assign('lvData', $pageData);
|
|
$smarty->display('achievements.tpl');
|
|
|
|
?>
|