mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
- moved search to /pages - moved g_dataKey to header.tpl and apply it on nessecary pages (restores TalentCalc) - Events: fixed relTabs with arbitrary data, when holidayId was 0 - CharClass: get heroClass-status through flags; dropped related DB-field - Achievements: fixed some criteria not being displayed in tooltips - Community: applied long forgotten changes to tplVars and use of uppercase ids - Titles: * exclude unused titles from listview * restored 'links'-button on detail-page - Quests: * added 'slain' fro proxy-npcs * use more wflags (&1 needs more research) - Factions: * fixed order of categories * fixed params to QuestList for relTabs - Profiler: * enabled 'profiles that have this char as source' in Profiler * removed the exampelChar from project * further documented more expected variables; includes/excludes-handling still not entirely clear * created datasets for reference data (create with ?build=profiler) - Localzation: * localized profiler for loc3 * corrected some single words * localized custom reward rate - table in factions - AjaxHandler: * new handler for ajax-requests *duh* * dropped data.php (index.php now calls to AjaxHandler for these cases) - moved reading of static files to own function Util::loadStaticFile()
82 lines
2.2 KiB
PHP
82 lines
2.2 KiB
PHP
<?php
|
|
|
|
if (!defined('AOWOW_REVISION'))
|
|
die('illegal access');
|
|
|
|
|
|
$cats = Util::extractURLParams($pageParam);
|
|
$path = [0, 7];
|
|
$title = [Util::ucFirst(Lang::$game['factions'])];
|
|
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_FACTION, -1, implode('.', $cats), User::$localeId]);
|
|
$validCats = array(
|
|
1118 => [469, 891, 67, 892, 169],
|
|
980 => [936],
|
|
1097 => [1037, 1052, 1117],
|
|
0 => true
|
|
);
|
|
|
|
if (!Util::isValidPage($validCats, $cats))
|
|
$smarty->error();
|
|
|
|
if (!$smarty->loadCache($cacheKey, $pageData))
|
|
{
|
|
$conditions = [];
|
|
|
|
if (!User::isInGroup(U_GROUP_STAFF)) // unlisted factions
|
|
$conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
|
|
|
|
if (isset($cats[0]) && empty($cats[1]))
|
|
{
|
|
if (!$cats[0])
|
|
$conditions[] = ['parentFactionId', [1118, 980, 1097, 469, 891, 67, 892, 169, 1037, 1052, 1117, 936], '!'];
|
|
else
|
|
{
|
|
$subs = DB::Aowow()->selectCol('SELECT id FROM ?_factions WHERE parentFactionId = ?d', $cats[0]);
|
|
$conditions[] = ['OR', ['parentFactionId', $subs], ['id', $subs]];
|
|
}
|
|
|
|
$path[] = $cats[0];
|
|
|
|
$t = Lang::$faction['cat'][$cats[0]];
|
|
array_unshift($title, is_array($t) ? $t[0] : $t);
|
|
}
|
|
else if (!empty($cats[1]))
|
|
{
|
|
$conditions[] = ['parentFactionId', $cats[1]];
|
|
$path[] = $cats[0];
|
|
$path[] = $cats[1];
|
|
array_unshift($title, Lang::$faction['cat'][$cats[0]][$cats[1]]);
|
|
}
|
|
|
|
$factions = new FactionList($conditions);
|
|
|
|
// menuId 7: Faction g_initPath()
|
|
// tabId 0: Database g_initHeader()
|
|
$pageData = array(
|
|
'page' => array(
|
|
'title' => implode(' - ', $title),
|
|
'path' => json_encode($path, JSON_NUMERIC_CHECK),
|
|
'tab' => 0
|
|
),
|
|
'lv' => array(
|
|
array(
|
|
'file' => 'faction',
|
|
'data' => $factions->getListviewData(),
|
|
'params' => []
|
|
)
|
|
)
|
|
);
|
|
|
|
$smarty->saveCache($cacheKey, $pageData);
|
|
}
|
|
|
|
|
|
$smarty->updatePageVars($pageData['page']);
|
|
$smarty->assign('lang', Lang::$main);
|
|
$smarty->assign('lvData', $pageData['lv']);
|
|
|
|
// load the page
|
|
$smarty->display('list-page-generic.tpl');
|
|
|
|
?>
|