* moved tabs-block in template to separate brick-file

*yay* generification!
This commit is contained in:
Sarjuuk
2013-08-21 18:32:13 +02:00
parent 8ffbf13e03
commit d45b972d14
14 changed files with 343 additions and 302 deletions

View File

@@ -21,10 +21,10 @@ if (!defined('AOWOW_REVISION'))
require 'includes/class.community.php';
$id = intVal($pageParam);
$_id = intVal($pageParam);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ACHIEVEMENT, $id, -1, User::$localeId]);
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_ACHIEVEMENT, $id, -1, User::$localeId]);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ACHIEVEMENT, $_id, -1, User::$localeId]);
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_ACHIEVEMENT, $_id, -1, User::$localeId]);
// AowowPower-request
if (isset($_GET['power']))
@@ -35,11 +35,11 @@ if (isset($_GET['power']))
if (!$smarty->loadCache($cacheKeyTooltip, $x))
{
$acv = new AchievementList(array(['id', $id]));
$acv = new AchievementList(array(['id', $_id]));
if ($acv->error)
die('$WowheadPower.registerAchievement(\''.$id.'\', '.User::$localeId.', {})');
die('$WowheadPower.registerAchievement(\''.$_id.'\', '.User::$localeId.', {})');
$x = '$WowheadPower.registerAchievement('.$id.', '.User::$localeId.",{\n";
$x = '$WowheadPower.registerAchievement('.$_id.', '.User::$localeId.",{\n";
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($acv->getField('name', true))."',\n";
$x .= "\ticon: '".urlencode($acv->getField('iconString'))."',\n";
$x .= "\ttooltip_".User::$localeString.": '".$acv->renderTooltip()."'\n";
@@ -53,60 +53,63 @@ if (isset($_GET['power']))
// regular page
if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
$acv = new AchievementList(array(['id', $id]));
$acv = new AchievementList(array(['id', $_id]));
if ($acv->error)
$smarty->notFound(Lang::$game['achievement']);
$pageData['path'] = [0, 9];
$pageData['title'] = [Util::ucfirst(Lang::$game['achievement'])];
// create page title and path
$curCat = $acv->getField('category');
$tmpPath = [];
do
{
$tmpPath[] = $curCat;
array_unshift($tmpPath, $curCat);
$curCat = DB::Aowow()->SelectCell('SELECT parentCategory FROM ?_achievementcategory WHERE id = ?d', $curCat);
}
while ($curCat > 0);
if (!empty($tmpPath))
$pageData['path'] = array_merge($pageData['path'], array_reverse($tmpPath));
array_unshift($pageData['title'], $acv->getField('name', true));
array_unshift($tmpPath, 0, 9);
$acv->addGlobalsToJscript($smarty, GLOBALINFO_REWARDS);
$pageData['page'] = $acv->getDetailedData()[$id];
// infobox content
$infobox = [];
switch ($acv->getField('faction'))
{
case 1:
$pageData['infoBox'][] = Lang::$main['side'].': <span class="alliance-icon">'.Lang::$game['si'][SIDE_ALLIANCE].'</span>';
$infobox[] = Lang::$main['side'].': <span class="alliance-icon">'.Lang::$game['si'][SIDE_ALLIANCE].'</span>';
break;
case 2:
$pageData['infoBox'][] = Lang::$main['side'].': <span class="horde-icon">'.Lang::$game['si'][SIDE_HORDE].'</span>';
$infobox[] = Lang::$main['side'].': <span class="horde-icon">'.Lang::$game['si'][SIDE_HORDE].'</span>';
break;
default: // case 3
$pageData['infoBox'][] = Lang::$main['side'].': '.Lang::$game['si'][SIDE_BOTH];
$infobox[] = Lang::$main['side'].': '.Lang::$game['si'][SIDE_BOTH];
}
// todo (low): crosslink with charactersDB to check if realmFirsts are still available
$pageData['infoBox'] = array_merge($pageData['infoBox'], Lang::getInfoBoxForFlags($acv->getField('cuFlags')));
$pageData = array(
'title' => $acv->getField('name', true),
'path' => $tmpPath,
'infobox' => array_merge($infobox, Lang::getInfoBoxForFlags($acv->getField('cuFlags'))),
'relTabs' => [],
'page' => $acv->getDetailedData()[$_id]
);
// listview: "see also"
$conditions = array(
['name_loc'.User::$localeId, $acv->getField('name', true)],
['id', $id, '!']
['id', $_id, '!']
);
$saList = new AchievementList($conditions);
$pageData['page']['saData'] = $saList->getListviewData();
$pageData['page']['saParams'] = array(
$pageData['relTabs'][] = array(
'file' => 'achievement',
'data' => $saList->getListviewData(),
'params' => array(
'id' => 'see-also',
'name' => '$LANG.tab_seealso',
'visibleCols' => "$['category']",
'tabs' => '$tabsRelated'
)
);
$saList->addGlobalsToJscript($smarty);
@@ -114,17 +117,20 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// listview: "criteria of"
$refs = DB::Aowow()->SelectCol('SELECT refAchievement FROM ?_achievementcriteria WHERE Type = ?d AND value1 = ?d',
ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT,
$id
$_id
);
if (!empty($refs))
{
$coList = new AchievementList(array(['id', $refs]));
$pageData['page']['coData'] = $coList->getListviewData();
$pageData['page']['coParams'] = array(
$pageData['relTabs'][] = array(
'file' => 'achievement',
'data' => $coList->getListviewData(),
'params' => array(
'id' => 'criteria-of',
'name' => '$LANG.tab_criteriaof',
'visibleCols' => "$['category']",
'tabs' => '$tabsRelated'
)
);
$coList->addGlobalsToJscript($smarty);
@@ -349,7 +355,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
$pageData['page']['series'] = array(
array(
'id' => $id,
'id' => $_id,
'name' => $acv->getField('name', true),
'parent' => $acv->getField('series') >> 16,
)
@@ -390,13 +396,13 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// menuId 9: Achievement g_initPath()
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => implode(" - ", $pageData['title']),
'title' => $pageData['title'].' - '.Util::ucfirst(Lang::$game['achievement']),
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_ACHIEVEMENT,
'typeId' => $id
'typeId' => $_id
));
$smarty->assign('community', CommunityContent::getAll(TYPE_ACHIEVEMENT, $id)); // comments, screenshots, videos
$smarty->assign('community', CommunityContent::getAll(TYPE_ACHIEVEMENT, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$achievement));
$smarty->assign('lvData', $pageData);

View File

@@ -9,9 +9,9 @@ if (isset($_GET['xml']))
require 'includes/class.community.php';
$id = intVal($pageParam);
$_id = intVal($pageParam);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ITEM, $id, -1, User::$localeId]);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ITEM, $_id, -1, User::$localeId]);
// AowowPower-request
if (isset($_GET['power']))
@@ -21,7 +21,7 @@ if (isset($_GET['power']))
Util::powerUseLocale(@$_GET['domain']);
$enh = [];
$itemString = $id;
$itemString = $_id;
if (isset($_GET['rand']))
{
@@ -49,7 +49,7 @@ if (isset($_GET['power']))
// output json for tooltips
if (!$smarty->loadCache($cacheKeyTooltip, $x))
{
$item = new ItemList(array(['i.entry', $id]));
$item = new ItemList(array(['i.entry', $_id]));
if ($item->error)
die('$WowheadPower.registerItem(\''.$itemString.'\', '.User::$localeId.', {})');
@@ -58,7 +58,7 @@ if (isset($_GET['power']))
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($item->getField('name', true))."',\n";
$x .= "\tquality: ".$item->getField('Quality').",\n";
$x .= "\ticon: '".urlencode($item->getField('icon'))."',\n";
$x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($item->tooltip[$id])."'\n";
$x .= "\ttooltip_".User::$localeString.": '".Util::jsEscape($item->tooltip[$_id])."'\n";
$x .= "});";
$smarty->saveCache($cacheKeyTooltip, $x);
@@ -69,7 +69,7 @@ if (isset($_GET['power']))
// regular page
if (!$smarty->loadCache($cacheKeyPage, $item))
{
$item = new ItemList(array(['i.entry', $id]));
$item = new ItemList(array(['i.entry', $_id]));
if ($item->error)
$smarty->notFound(Lang::$game['item']);
@@ -78,12 +78,42 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
// not yet implemented -> chicken out
$smarty->error();
/*
<table class="infobox">
<tr><th>{#Quick_Facts#}</th></tr>
<tr><td>
<div class="infobox-spacer"></div>
<ul>
{* Уровень вещи *}
{if $item.level}<li><div>{#level#}: {$item.level}</div></li>{/if}
{* Стоимость вещи *}
{if $item.buygold or $item.buysilver or $item.buycopper}
<li><div>
{#Buy_for#}:
{if $item.buygold}<span class="moneygold">{$item.buygold}</span>{/if}
{if $item.buysilver}<span class="moneysilver">{$item.buysilver}</span>{/if}
{if $item.buycopper}<span class="moneycopper">{$item.buycopper}</span>{/if}
</div></li>
{/if}
{if $item.sellgold or $item.sellsilver or $item.sellcopper}
<li><div>
{#Sells_for#}:
{if $item.sellgold}<span class="moneygold">{$item.sellgold}</span>{/if}
{if $item.sellsilver}<span class="moneysilver">{$item.sellsilver}</span>{/if}
{if $item.sellcopper}<span class="moneycopper">{$item.sellcopper}</span>{/if}
</div></li>
{/if}
{if isset($item.disenchantskill)}<li><div>{#Disenchantable#} (<span class="tip" onmouseover="Tooltip.showAtCursor(event, LANG.tooltip_reqenchanting, 0, 0, 'q')" onmousemove="Tooltip.cursorUpdate(event)" onmouseout="Tooltip.hide()">{$item.disenchantskill}</span>)</div></li>{/if}
{if isset($item.key)}<li><div>{#Can_be_placed_in_the_keyring#}</div></li>{/if}
</ul>
</td></tr>
</table>
*/
unset($item);
// Информация о вещи...
$item = iteminfo($id, 1);
$item = iteminfo($_id, 1);
$path = [0, 0, $item['classs'], $item['subclass'], $item['type']];
// Поиск мобов с которых эта вещь лутится
@@ -725,24 +755,24 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
$item['currencyfor'] = [];
foreach($rows_cf as $row)
{
$id=$row['entry'];
$item['currencyfor'][$id] = [];
$item['currencyfor'][$id] = iteminfo2($row);
$item['currencyfor'][$id]['maxcount'] = $row['drop-maxcount'];
$item['currencyfor'][$id]['cost'] = [];
$_id=$row['entry'];
$item['currencyfor'][$_id] = [];
$item['currencyfor'][$_id] = iteminfo2($row);
$item['currencyfor'][$_id]['maxcount'] = $row['drop-maxcount'];
$item['currencyfor'][$_id]['cost'] = [];
if($row['BuyPrice']>0)
$npc['sells'][$id]['cost']['money'] = $row['BuyPrice'];
$npc['sells'][$_id]['cost']['money'] = $row['BuyPrice'];
if($row['reqhonorpoints']>0)
$item['currencyfor'][$id]['cost']['honor'] =/* ($row['A']==1?1:-1)* */$row['reqhonorpoints']; //FIXME_BUG
$item['currencyfor'][$_id]['cost']['honor'] =/* ($row['A']==1?1:-1)* */$row['reqhonorpoints']; //FIXME_BUG
if($row['reqarenapoints']>0)
$item['currencyfor'][$id]['cost']['arena'] = $row['reqarenapoints'];
$item['currencyfor'][$id]['cost']['items'] = [];
$item['currencyfor'][$_id]['cost']['arena'] = $row['reqarenapoints'];
$item['currencyfor'][$_id]['cost']['items'] = [];
for($j=1; $j<=5; $j++)
if(($row['reqitem'.$j]>0) and ($row['reqitemcount'.$j]>0))
{
allitemsinfo($row['reqitem'.$j], 0);
$item['currencyfor'][$id]['cost']['items'][] = array(
$item['currencyfor'][$_id]['cost']['items'][] = array(
'item' => $row['reqitem'.$j],
'count' => $row['reqitemcount'.$j]
);
@@ -818,9 +848,9 @@ $smarty->updatePageVars(array(
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_ITEM,
'typeid' => $id
'typeid' => $_id
));
$smarty->assign('community', CommunityContent::getAll(TYPE_ITEM, $id)); // comments, screenshots, videos
$smarty->assign('community', CommunityContent::getAll(TYPE_ITEM, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$item, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData);

View File

@@ -6,14 +6,14 @@ if (!defined('AOWOW_REVISION'))
require 'includes/class.community.php';
$id = intVal($pageParam);
$_id = intVal($pageParam);
$path = [0, 2];
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ITEMSET, $id, -1, User::$localeId]);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ITEMSET, $_id, -1, User::$localeId]);
if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
$iSet = new ItemsetList(array(['id', $id]));
$iSet = new ItemsetList(array(['id', $_id]));
if ($iSet->error)
$smarty->notFound(Lang::$game['itemset']);
@@ -165,6 +165,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'title' => $name, // for header
'path' => $path,
'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null,
'relTabs' => [],
'pieces' => $pieces,
'spells' => $spells,
'view3D' => json_encode($eqList, JSON_NUMERIC_CHECK),
@@ -175,7 +176,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
),
'page' => array(
'name' => $name, // for page content
'id' => $id,
'id' => $_id,
'bonusExt' => $skill,
'description' => $ta ? sprintf(Lang::$itemset['_desc'], $name, Lang::$itemset['notes'][$ta], $cnt) : sprintf(Lang::$itemset['_descTagless'], $name, $cnt),
'unavailable' => $unav
@@ -189,25 +190,25 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($ta && count($path) == 3)
{
$rel[] = ['id', $id, '!'];
$rel[] = ['id', $_id, '!'];
$rel[] = ['classMask', 1 << (end($path) - 1), '&'];
$rel[] = ['contentGroup', (int)$ta];
}
else if ($ev)
{
$rel[] = ['id', $id, '!'];
$rel[] = ['id', $_id, '!'];
$rel[] = ['holidayId', 0, '!'];
}
else if ($sk)
{
$rel[] = ['id', $id, '!'];
$rel[] = ['id', $_id, '!'];
$rel[] = ['contentGroup', 0];
$rel[] = ['skillId', 0, '!'];
$rel[] = ['type', $ty];
}
else if (!$ta && $ty)
{
$rel[] = ['id', $id, '!'];
$rel[] = ['id', $_id, '!'];
$rel[] = ['contentGroup', 0];
$rel[] = ['type', $ty];
$rel[] = ['skillId', 0];
@@ -218,7 +219,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$relSets = new ItemsetList($rel);
if (!$relSets->error)
{
$pageData['related'] = array(
$pageData['relTabs'][] = array(
'file' => 'itemset',
'data' => $relSets->getListviewData(),
'params' => array(
'id' => 'see-also',
@@ -246,13 +248,13 @@ $smarty->updatePageVars(array(
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_ITEMSET,
'typeId' => $id,
'typeId' => $_id,
'reqJS' => array(
'template/js/Summary.js',
'template/js/swfobject.js'
)
));
$smarty->assign('community', CommunityContent::getAll(TYPE_ITEMSET, $id)); // comments, screenshots, videos
$smarty->assign('community', CommunityContent::getAll(TYPE_ITEMSET, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$itemset));
$smarty->assign('lvData', $pageData);

View File

@@ -6,10 +6,10 @@ if (!defined('AOWOW_REVISION'))
require 'includes/class.community.php';
$id = intVal($pageParam);
$_id = intVal($pageParam);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_NPC, $id, -1, User::$localeId]);
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_NPC, $id, -1, User::$localeId]);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_NPC, $_id, -1, User::$localeId]);
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_NPC, $_id, -1, User::$localeId]);
// AowowPower-request
if (isset($_GET['power']))
@@ -20,13 +20,13 @@ if (isset($_GET['power']))
if (!$smarty->loadCache($cacheKeyTooltip, $x))
{
$npc = new CreatureList(array(['ct.id', $id]));
$npc = new CreatureList(array(['ct.id', $_id]));
if ($npc->error)
die('$WowheadPower.registerNpc(\''.$id.'\', '.User::$localeId.', {})');
die('$WowheadPower.registerNpc(\''.$_id.'\', '.User::$localeId.', {})');
$s = $npc->getSpawns(true);
$x = '$WowheadPower.registerNpc('.$id.', '.User::$localeId.", {\n";
$x = '$WowheadPower.registerNpc('.$_id.', '.User::$localeId.", {\n";
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($npc->getField('name', true))."',\n";
$x .= "\ttooltip_".User::$localeString.': \''.Util::jsEscape($npc->renderTooltip())."',\n";
// $x .= "\tmap: ".($s ? '{zone: '.$s[0].', coords: {0:'.json_encode($s[1], JSON_NUMERIC_CHECK).'}' : '{}')."\n";
@@ -41,7 +41,7 @@ if (isset($_GET['power']))
// regular page
if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
$npc = new CreatureList(array(['ct.id', $id]));
$npc = new CreatureList(array(['ct.id', $_id]));
if ($npc->error)
$smarty->notFound(Lang::$game['npc']);
@@ -50,7 +50,38 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// not yet implemented -> chicken out
$smarty->error();
/*
<table class="infobox">
<tr><th>{#Quick_Facts#}</th></tr>
<tr><td><div class="infobox-spacer"></div>
<ul>
<li><div>{#Level#}: {if $npc.minlevel<>$npc.maxlevel}{$npc.minlevel} - {/if}{$npc.maxlevel}</div></li>
<li><div>{#Classification#}: {$npc.rank}</div></li>
<li><div>{#React#}: <span class="q{if $npc.A==-1}10{elseif $npc.A==1}2{else}{/if}">A</span> <span class="q{if $npc.H==-1}10{elseif $npc.H==1}2{else}{/if}">H</span></div></li>
<li><div>{#Faction#}: <a href="?faction={$npc.faction_num}">{$npc.faction}</a></div></li>
<li><div>{#Health#}: {if $npc.minhealth<>$npc.maxhealth}{$npc.minhealth} - {/if}{$npc.maxhealth}</div></li>
{if ($npc.minmana or $npc.maxmana)}
<li><div>{#Mana#}: {if $npc.minmana<>$npc.maxmana}{$npc.minmana} - {/if}{$npc.maxmana}</div></li>
{/if}
{if ($npc.moneysilver>0) or ($npc.moneygold>0) or ($npc.moneycopper>0)}
<li><div>{#Wealth#}:{if ($npc.moneygold>0)}
<span class="moneygold">{$npc.moneygold}</span>{/if}
{if ($npc.moneysilver>0)}
<span class="moneysilver">{$npc.moneysilver}</span>{/if}
{if ($npc.moneycopper>0)}
<span class="moneycopper">{$npc.moneycopper}</span>{/if}
</div></li>
{/if}
{if $npc.mindmg > 0 and $npc.maxdmg > 0}
<li><div>{#Damage#}: {$npc.mindmg} - {$npc.maxdmg}</div></li>
{/if}
{if $npc.armor > 0}
<li><div>{#Armor#}: {$npc.armor}</div></li>
{/if}
</ul>
</td></tr>
</table>
*/
unset($npc);
@@ -88,7 +119,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$npc_cols[1],
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$id
$_id
);
if($row)
@@ -294,7 +325,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$item_cols[2],
($_SESSION['locale'])? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale'])? 1: DBSIMPLE_SKIP,
$id
$_id
);
if($rows_s)
{
@@ -350,7 +381,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
c.id=?
',
$quest_cols[2],
$id
$_id
);
if($rows_qs)
{
@@ -362,7 +393,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
unset ($rows_qs);
// Начиниают event-only квесты...
$rows_qse = event_find(array('quest_creature_id' => $id));
$rows_qse = event_find(array('quest_creature_id' => $_id));
if($rows_qse)
{
if (!isset($npc['starts']))
@@ -382,7 +413,7 @@ $rows_qe = $DB->select('
c.id=?
',
$quest_cols[2],
$id
$_id
);
if($rows_qe)
{
@@ -404,7 +435,7 @@ $rows_qe = $DB->select('
OR RequiredNpcOrGo4=?
',
$quest_cols[2],
$id, $id, $id, $id
$_id, $_id, $_id, $_id
);
if($rows_qo)
{
@@ -476,9 +507,9 @@ $smarty->updatePageVars(array(
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_NPC,
'typeId' => $id
'typeId' => $_id
));
$smarty->assign('community', CommunityContent::getAll(TYPE_NPC, $id)); // comments, screenshots, videos
$smarty->assign('community', CommunityContent::getAll(TYPE_NPC, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$npc, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData);

View File

@@ -6,13 +6,13 @@ if (!defined('AOWOW_REVISION'))
require 'includes/class.community.php';
$id = intVal($pageParam);
$_id = intVal($pageParam);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_PET, $id, -1, User::$localeId]);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_PET, $_id, -1, User::$localeId]);
if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
$pet = new PetList(array(['id', $id]));
$pet = new PetList(array(['id', $_id]));
if ($pet->error)
$smarty->notFound(Lang::$game['pet']);
@@ -28,21 +28,22 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$pageData = array(
'title' => $pet->getField('name', true),
'path' => '[0, 8, '.$pet->getField('type').']',
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
'relTabs' => [],
'page' => array(
'petCalc' => Util::$tcEncoding[(int)($id / 10)] . Util::$tcEncoding[(2 * ($id % 10) + ($pet->getField('exotic') ? 1 : 0))],
'petCalc' => Util::$tcEncoding[(int)($_id / 10)] . Util::$tcEncoding[(2 * ($_id % 10) + ($pet->getField('exotic') ? 1 : 0))],
'name' => $pet->getField('name', true),
'id' => $id,
'id' => $_id,
'icon' => $pet->getField('iconString'),
'expansion' => Util::$expansionString[$pet->getField('expansion')]
),
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
);
// tameable & gallery
$condition = array(
['ct.type', 1], // Beast
['ct.type_flags', 0x1, '&'], // tameable
['ct.family', $id], // displayed petType
['ct.family', $_id], // displayed petType
[
'OR', // at least neutral to at least one faction
['ft.A', 1, '<'],
@@ -51,23 +52,25 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
);
$tng = new CreatureList($condition);
$pageData['tameable'] = array(
$pageData['relTabs'][] = array(
'file' => 'creature',
'data' => $tng->getListviewData(NPCINFO_TAMEABLE),
'params' => [
'params' => array(
'name' => '$LANG.tab_tameable',
'tabs' => '$tabsRelated',
'hiddenCols' => "$['type']",
'visibleCols' => "$['skin']",
'note' => sprintf(Util::$filterResultString, '?npcs=1&filter=fa=38'),
'id' => 'tameable'
]
)
);
$pageData['gallery'] = array(
$pageData['relTabs'][] = array(
'file' => 'model',
'data' => $tng->getListviewData(NPCINFO_MODEL),
'params' => [
'params' => array(
'tabs' => '$tabsRelated'
]
)
);
// diet
@@ -80,22 +83,23 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$food = new ItemList(array(['i.subClass', [5, 8]], ['i.FoodType', $list]));
$food->addGlobalsToJscript($smarty);
$pageData['diet'] = array(
$pageData['relTabs'][] = array(
'file' => 'item',
'data' => $food->getListviewData(),
'params' => [
'params' => array(
'name' => '$LANG.diet',
'tabs' => '$tabsRelated',
'hiddenCols' => "$['source', 'slot', 'side']",
'sort' => "$['level']",
'id' => 'diet'
]
)
);
// spells
$mask = 0x0;
foreach (Util::$skillLineMask[-1] as $idx => $pair)
{
if ($pair[0] == $id)
if ($pair[0] == $_id)
{
$mask = 1 << $idx;
break;
@@ -122,14 +126,15 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$spells = new SpellList($conditions);
$spells->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
$pageData['abilities'] = array(
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $spells->getListviewData(),
'params' => [
'params' => array(
'name' => '$LANG.tab_abilities',
'tabs' => '$tabsRelated',
'visibleCols' => "$['schools', 'level']",
'id' => 'abilities'
]
)
);
// talents
@@ -152,16 +157,17 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$talents = new SpellList($conditions);
$talents->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
$pageData['talents'] = array(
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $talents->getListviewData(),
'params' => [
'params' => array(
'tabs' => '$tabsRelated',
'visibleCols' => "$['tier', 'level']",
'name' => '$LANG.tab_talents',
'id' => 'talents',
'sort' => "$['tier', 'name']",
'_petTalents' => 1
]
)
);
$smarty->saveCache($cacheKeyPage, $pageData);
@@ -175,12 +181,12 @@ $smarty->updatePageVars(array(
'path' => $pageData['path'],
'tab' => 0,
'type' => TYPE_PET,
'typeId' => $id,
'typeId' => $_id,
'reqJS' => array(
'template/js/swfobject.js'
)
));
$smarty->assign('community', CommunityContent::getAll(TYPE_PET, $id)); // comments, screenshots, videos
$smarty->assign('community', CommunityContent::getAll(TYPE_PET, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game));
$smarty->assign('lvData', $pageData);

View File

@@ -6,10 +6,10 @@ if (!defined('AOWOW_REVISION'))
require 'includes/class.community.php';
$id = intVal($pageParam);
$_id = intVal($pageParam);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_QUEST, $id, -1, User::$localeId]);
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_QUEST, $id, -1, User::$localeId]);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_QUEST, $_id, -1, User::$localeId]);
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_QUEST, $_id, -1, User::$localeId]);
// AowowPower-request
if (isset($_GET['power']))
@@ -20,11 +20,11 @@ if (isset($_GET['power']))
if (!$smarty->loadCache($cacheKeyTooltip, $x))
{
$quest = new QuestList(array(['qt.id', $id]));
$quest = new QuestList(array(['qt.id', $_id]));
if ($quest->error)
die('$WowheadPower.registerQuest(\''.$id.'\', '.User::$localeId.', {})');
die('$WowheadPower.registerQuest(\''.$_id.'\', '.User::$localeId.', {})');
$x = '$WowheadPower.registerQuest('.$id.', '.User::$localeId.", {\n";
$x = '$WowheadPower.registerQuest('.$_id.', '.User::$localeId.", {\n";
$x .= "\tname_".User::$localeString.": '".Util::jsEscape($quest->getField('Title', true))."',\n";
$x .= "\ttooltip_".User::$localeString.': \''.$quest->renderTooltip()."'\n"; // daily: 1 ... not used in wowheadPower => omitted here
$x .= "});";
@@ -38,7 +38,7 @@ if (isset($_GET['power']))
// regular page
if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
$quest = new QuestList(array(['qt.id', $id]));
$quest = new QuestList(array(['qt.id', $_id]));
if ($quest->error)
$smarty->notFound(Lang::$game['quest']);
@@ -52,7 +52,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
unset($quest);
// Основная инфа
$quest = GetDBQuestInfo($id, 0xFFFFFF);
$quest = GetDBQuestInfo($_id, 0xFFFFFF);
$path = [0, 3]; // TODO
/* ЦЕПОЧКА КВЕСТОВ */
@@ -607,10 +607,10 @@ $smarty->updatePageVars(array(
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_QUEST,
'typeId' => $id
'typeId' => $_id
));
$smarty->assign('community', CommunityContent::getAll(TYPE_QUEST, $id)); // comments, screenshots, videos
$smarty->assign('community', CommunityContent::getAll(TYPE_QUEST, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$quest, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData);

View File

@@ -6,10 +6,10 @@ if (!defined('AOWOW_REVISION'))
require 'includes/class.community.php';
$id = intVal($pageParam);
$_id = intVal($pageParam);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_SPELL, $id, -1, User::$localeId]);
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_SPELL, $id, -1, User::$localeId]);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_SPELL, $_id, -1, User::$localeId]);
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_SPELL, $_id, -1, User::$localeId]);
// AowowPower-request
if (isset($_GET['power']))
@@ -20,11 +20,11 @@ if (isset($_GET['power']))
if (!$smarty->loadCache($cacheKeyTooltip, $x))
{
$spell = new SpellList(array(['s.id', $id]));
$spell = new SpellList(array(['s.id', $_id]));
if ($spell->error)
die('$WowheadPower.registerSpell('.$id.', '.User::$localeId.', {});');
die('$WowheadPower.registerSpell('.$_id.', '.User::$localeId.', {});');
$x = '$WowheadPower.registerSpell('.$id.', '.User::$localeId.", {\n";
$x = '$WowheadPower.registerSpell('.$_id.', '.User::$localeId.", {\n";
$pt = [];
if ($n = $spell->getField('name', true))
$pt[] = "\tname_".User::$localeString.": '".Util::jsEscape($n)."'";
@@ -51,17 +51,17 @@ if (isset($_GET['power']))
// regular page
if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
$spell = new SpellList(array(['s.id', $id]));
$spell = new SpellList(array(['s.id', $_id]));
if ($spell->error)
$smarty->notFound(Lang::$game['spell']);
$cat = $spell->getField('typeCat');
$_cat = $spell->getField('typeCat');
$path = [0, 1, $_cat];
$l = [null, 'A', 'B', 'C'];
$pageData['path'] = [0, 1, $cat];
// reconstruct path / title
switch($cat)
switch($_cat)
{
case -2:
case 7:
@@ -73,65 +73,51 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
if ($cl & (1 << ($i - 1)))
{
$pageData['path'][] = $i;
$path[] = $i;
break;
}
$i++;
}
if ($cat == -13)
if ($_cat == -13)
{
$pageData['path'][] = ($spell->getField('cuFlags') & (SPELL_CU_GLYPH_MAJOR | SPELL_CU_GLYPH_MINOR)) >> 6;
$path[] = ($spell->getField('cuFlags') & (SPELL_CU_GLYPH_MAJOR | SPELL_CU_GLYPH_MINOR)) >> 6;
break;
}
case 9:
case -3:
case 11:
$pageData['path'][] = $spell->getField('skillLines')[0];
$path[] = $spell->getField('skillLines')[0];
if ($cat == 11)
if ($_cat == 11)
if ($_ = $spell->getField('reqSpellId'))
$pageData['path'][] = $_;
$path[] = $_;
break;
case -11:
foreach (SpellList::$skillLines as $line => $skills)
if (in_array($spell->getField('skillLines')[0], $skills))
$pageData['path'][] = $line;
$path[] = $line;
break;
case -7: // only spells unique in skillLineAbility will always point to the right skillLine :/
$_ = $spell->getField('cuFlags');
if ($_ & SPELL_CU_PET_TALENT_TYPE0)
$pageData['path'][] = 411; // Ferocity
$path[] = 411; // Ferocity
else if ($_ & SPELL_CU_PET_TALENT_TYPE1)
$pageData['path'][] = 409; // Tenacity
$path[] = 409; // Tenacity
else if ($_ & SPELL_CU_PET_TALENT_TYPE2)
$pageData['path'][] = 410; // Cunning
$path[] = 410; // Cunning
}
$pageData['page'] = $spell->getDetailPageData();
// description
@list(
$pageData['page']['info'],
$pageData['page']['spells']
) = $spell->renderTooltip(MAX_LEVEL, true);
// buff
@list(
$pageData['page']['buff'],
$pageData['page']['buffspells']
) = $spell->renderBuff(MAX_LEVEL, true);
// infobox
$infobox = [];
if (!in_array($cat, [-5, -6])) // not mount or vanity pet
if (!in_array($_cat, [-5, -6])) // not mount or vanity pet
{
if ($_ = $spell->getField('talentLevel')) // level
$infobox[] = '[li]'.(in_array($cat, [-2, 7, -13]) ? sprintf(Lang::$game['reqLevel'], $_) : Lang::$game['level'].Lang::$colon.$_).'[/li]';
$infobox[] = '[li]'.(in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::$game['reqLevel'], $_) : Lang::$game['level'].Lang::$colon.$_).'[/li]';
else if ($_ = $spell->getField('spellLevel'))
$infobox[] = '[li]'.(in_array($cat, [-2, 7, -13]) ? sprintf(Lang::$game['reqLevel'], $_) : Lang::$game['level'].Lang::$colon.$_).'[/li]';
$infobox[] = '[li]'.(in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::$game['reqLevel'], $_) : Lang::$game['level'].Lang::$colon.$_).'[/li]';
}
if ($mask = $spell->getField('reqRaceMask')) // race
@@ -162,7 +148,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$infobox[] = '[li]'.Lang::$game['requires2'].' '.Util::localizedString($bar, 'name').'[/li]';
}
if (in_array($cat, [9, 11])) // primary & secondary trades
if (in_array($_cat, [9, 11])) // primary & secondary trades
{
// skill
$bar = SkillList::getName($spell->getField('skillLines')[0]);
@@ -195,8 +181,26 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($cost = DB::Aowow()->selectCell('SELECT spellcost FROM npc_trainer WHERE spell = ?d', $spell->id))
$infobox[] = '[li]'.Lang::$spell['trainingCost'].Lang::$colon.'[money='.$cost.'][/li]';
// title
$pageData['title'] = [$spell->getField('name', true), Util::ucFirst(Lang::$game['spell'])];
$pageData = array(
'title' => $spell->getField('name', true),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'infobox' => $infobox,
'relTabs' => [],
'view3D' => 0,
'page' => $spell->getDetailPageData()
);
// description
@list(
$pageData['page']['info'],
$pageData['page']['spells']
) = $spell->renderTooltip(MAX_LEVEL, true);
// buff
@list(
$pageData['page']['buff'],
$pageData['page']['buffspells']
) = $spell->renderBuff(MAX_LEVEL, true);
// js-globals
$spell->addGlobalsToJScript($smarty, GLOBALINFO_RELATED);
@@ -241,8 +245,6 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// Iterate through all effects:
$pageData['page']['effect'] = [];
$pageData['view3D'] = 0;
for ($i = 1; $i < 4; $i++)
{
if ($spell->getField('effect'.$i.'Id') <= 0)
@@ -363,7 +365,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
break;
case 95: // Skinning
// todo (low): sort this out - 0:skinning (corpse, beast), 1:hearb (GO), 2: mineral (GO), 3: engineer (corpse, mechanic)
$foo['name'] .= ' ('.sprintf(Util::$dfnString, 'NYI]', $effMV).')';
$foo['name'] .= ' ('.sprintf(Util::$dfnString, '[NYI]', $effMV).')';
break;
case 108: // Dispel Mechanic
$foo['name'] .= ' ('.sprintf(Util::$dfnString, @Lang::$game['me'][$effMV], $effMV).')';
@@ -429,7 +431,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$st = DB::Aowow()->selectRow('SELECT *, displayIdA as model1, displayIdH as model2 FROM ?_shapeshiftForms WHERE id = ?d', $effMV);
if ($st['creatureType'] > 0)
$infobox[] = '[li]'.Lang::$game['type'].Lang::$colon.Lang::$game['ct'][$st['creatureType']].'[/li]';
$pageData['infobox'][] = '[li]'.Lang::$game['type'].Lang::$colon.Lang::$game['ct'][$st['creatureType']].'[/li]';
if (!$pageData['view3D'] && $st)
$pageData['view3D'] = $st['model2'] ? $st['model'.rand(1,2)]: $st['model1'];
@@ -572,9 +574,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if (in_array($effAura, [11, 12, 36, 77]) || in_array($effId, []))
unset($foo['value']);
}
unset($foo); // clear reference
$pageData['infobox'] = $infobox ? '[ul]'.implode('', $infobox).'[/ul]' : null;
$pageData['infobox'] = '[ul]'.implode('', $pageData['infobox']).'[/ul]';
unset($foo); // clear reference
/*******
* extra tabs
@@ -611,19 +614,22 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$modSpells = new SpellList($conditions);
if (!$modSpells->error)
{
$pageData['modifies'] = array(
if (!$modSpells->hasSetFields(['skillLines']))
$msH = "$['skill']";
$pageData['relTabs'][] = array(
'data' => $modSpells->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'id' => 'modifies',
'name' => '$LANG.tab_modifies',
'visibleCols' => "$['level']"
'visibleCols' => "$['level']",
'hiddenCols' => isset($msH) ? $msH : null
]
);
$modSpells->addGlobalsToJScript($smarty);
if(!$modSpells->hasSetFields(['skillLines']))
$pageData['modifies']['params']['hiddenCols'] = "$['skill']";
$modSpells->addGlobalddoJScript($smarty);
}
}
@@ -660,19 +666,21 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$modsSpell = new SpellList($conditions);
if (!$modsSpell->error)
{
$pageData['modifiedBy'] = array(
if (!$modsSpell->hasSetFields(['skillLines']))
$mbH = "$['skill']";
$pageData['relTabs'][] = array(
'data' => $modsSpell->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'id' => 'modified-by',
'name' => '$LANG.tab_modifiedby',
'visibleCols' => "$['level']"
'visibleCols' => "$['level']",
'hiddenCols' => isset($mbH) ? $mbH : null
]
);
$modsSpell->addGlobalsToJScript($smarty);
if(!$modsSpell->hasSetFields(['skillLines']))
$pageData['modifiedBy']['params']['hiddenCols'] = "$['skill']";
}
}
@@ -689,19 +697,22 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$saSpells = new SpellList($conditions);
if (!$saSpells->error)
{
$pageData['seeAlso'] = array(
if (!$saSpells->hasSetFields(['skillLines']))
$saH = "$['skill']";
$pageData['relTabs'][] = array(
'data' => $saSpells->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'id' => 'see-also',
'name' => '$LANG.tab_seealso',
'visibleCols' => "$['level']"
'visibleCols' => "$['level']",
'hiddenCols' => isset($saH) ? $saH : null
]
);
$saSpells->addGlobalsToJScript($smarty);
if(!$saSpells->hasSetFields(['skillLines']))
$pageData['seeAlso']['params']['hiddenCols'] = "$['skill']";
}
// used by - itemset
@@ -714,7 +725,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$ubSets = new ItemsetList($conditions);
if (!$ubSets->error)
{
$pageData['usedByItemset'] = array(
$pageData['relTabs'][] = array(
'data' => $ubSets->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
@@ -729,7 +740,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// used by - item
$conditions = array(
'OR',
'OR', // 6: learn spell
['AND', ['spelltrigger_1', 6, '!'], ['spellid_1', $spell->id]],
['AND', ['spelltrigger_2', 6, '!'], ['spellid_2', $spell->id]],
['AND', ['spelltrigger_3', 6, '!'], ['spellid_3', $spell->id]],
@@ -740,7 +751,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$ubItems = new ItemList($conditions);
if (!$ubItems->error)
{
$pageData['usedByItem'] = array(
$pageData['relTabs'][] = array(
'data' => $ubItems->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
@@ -759,7 +770,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$coAchievemnts = new AchievementList(array(['id', $crs]));
if (!$coAchievemnts->error)
{
$pageData['criteriaOf'] = array(
$pageData['relTabs'][] = array(
'data' => $coAchievemnts->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
@@ -836,7 +847,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
}
}
$pageData['contains'] = array(
$pageData['relTabs'][] = array(
'file' => 'item',
'data' => $lv,
'params' => [
'tabs' => '$tabsRelated',
@@ -849,8 +861,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
}
// teaches
// spell_learn_spell
// skill_discovery_template
// -> spell_learn_spell
// -> skill_discovery_template
/* source trainer
first check source if not trainer : break
@@ -884,6 +896,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
stunt through the tables... >.<
*/
$spellArr['taughtbyquest'] = [];
$spellArr['usedbynpc'] = [];
/* used by item
@@ -935,16 +949,16 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// menuId 1: Spell g_initPath()
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => implode(" - ", $pageData['title']),
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'title' => $pageData['title'].' - '.Util::ucFirst(Lang::$game['spell']),
'path' => $pageData['path'],
'tab' => 0,
'type' => TYPE_SPELL,
'typeId' => $id,
'typeId' => $_id,
'reqJS' => array(
'template/js/swfobject.js'
)
));
$smarty->assign('community', CommunityContent::getAll(TYPE_SPELL, $id)); // comments, screenshots, videos
$smarty->assign('community', CommunityContent::getAll(TYPE_SPELL, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$spell, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData);

View File

@@ -6,13 +6,13 @@ if (!defined('AOWOW_REVISION'))
require 'includes/class.community.php';
$id = intVal($pageParam);
$_id = intVal($pageParam);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_TITLE, $id, -1, User::$localeId]);
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_TITLE, $_id, -1, User::$localeId]);
if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
$title = new TitleList(array(['id', $id]));
$title = new TitleList(array(['id', $_id]));
if ($title->error)
$smarty->notFound(Lang::$game['title']);
@@ -31,17 +31,19 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$infobox[] = Lang::$game['eventShort'].Lang::$colon.'[url=?event='.$e.']'.WorldEventList::getName($e).'[/url]';
$pageData = array(
'title' => Util::ucFirst(trim(str_replace('%s', '', str_replace(',', '', $title->getField('male', true))))),
'path' => '[0, 10, '.$title->getField('category').']',
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
'relTabs' => [],
'page' => array(
'name' => $title->getHtmlizedName(),
'id' => $id,
'expansion' => Util::$expansionString[$title->getField('expansion')]
),
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
)
);
if (!empty($title->sources[$id]))
if (!empty($title->sources[$_id]))
{
foreach ($title->sources[$id] as $type => $entries)
foreach ($title->sources[$_id] as $type => $entries)
{
switch ($type)
{
@@ -49,26 +51,32 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$quests = new QuestList(array(['id', $entries]));
$quests->addGlobalsToJscript($smarty, GLOBALINFO_REWARDS);
$pageData['page']['questReward'] = $quests->getListviewData();
$pageData['page']['questParams'] = array(
$pageData['relTabs'][] = array(
'file' => 'quest',
'data' => $quests->getListviewData(),
'params' => array(
'id' => 'reward-from-quest',
'name' => '$LANG.tab_rewardfrom',
'hiddenCols' => "$['experience', 'money']",
'visibleCols' => "$['category']",
'tabs' => '$tabsRelated'
)
);
break;
case 12:
$acvs = new AchievementList(array(['id', $entries]));
$acvs->addGlobalsToJscript($smarty);
$pageData['page']['acvReward'] = $acvs->getListviewData();
$pageData['page']['acvParams'] = array(
$pageData['relTabs'][] = array(
'file' => 'achievement',
'data' => $acvs->getListviewData(),
'params' => array(
'id' => 'reward-from-achievement',
'name' => '$LANG.tab_rewardfrom',
'visibleCols' => "$['category']",
'sort' => "$['reqlevel', 'name']",
'tabs' => '$tabsRelated'
)
);
break;
// case 13:
@@ -77,9 +85,6 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
}
}
$pageData['title'] = Util::ucFirst(trim(str_replace('%s', '', str_replace(',', '', $title->getField('male', true)))));
$pageData['path'] = '[0, 10, '.$title->getField('category').']';
$smarty->saveCache($cacheKeyPage, $pageData);
}
@@ -91,9 +96,9 @@ $smarty->updatePageVars(array(
'path' => $pageData['path'],
'tab' => 0,
'type' => TYPE_TITLE,
'typeId' => $id
'typeId' => $_id
));
$smarty->assign('community', CommunityContent::getAll(TYPE_TITLE, $id)); // comments, screenshots, videos
$smarty->assign('community', CommunityContent::getAll(TYPE_TITLE, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main));
$smarty->assign('lvData', $pageData);

View File

@@ -23,7 +23,7 @@
<tr><td><div class="infobox-spacer"></div>
<ul>
{if $lvData.page.points}<li><div>{$lang.points}: <span class="moneyachievement tip" onmouseover="Listview.funcBox.moneyAchievementOver(event)" onmousemove="Tooltip.cursorUpdate(event)" onmouseout="Tooltip.hide()">{$lvData.page.points}</span></div></li>{/if}
{foreach from=$lvData.infoBox item=info}
{foreach from=$lvData.infobox item=info}
<li><div>{$info}</div></li>
{/foreach}
{*<li><div>Location: {$lvData.page.location}</div></li> todo: need to be parsed first *}
@@ -142,21 +142,9 @@
{/if}
<h2>{$lang.related}</h2>
</div>
<div id="tabs-generic"></div>
<div id="listview-generic" class="listview"></div>
<script type="text/javascript">//<![CDATA[
var tabsRelated = new Tabs({ldelim}parent: $WH.ge('tabs-generic'){rdelim});
{if $lvData.page.saData} {include file='bricks/listviews/achievement.tpl' data=$lvData.page.saData params=$lvData.page.saParams}{/if}
{if isset($lvData.page.coData)} {include file='bricks/listviews/achievement.tpl' data=$lvData.page.coData params=$lvData.page.coParams}{/if}
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
new Listview({ldelim}template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: tabsRelated, parent: 'listview-generic', data: lv_screenshots{rdelim});
if (lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))
new Listview({ldelim}template: 'video', id: 'videos', name: LANG.tab_videos, tabs: tabsRelated, parent: 'listview-generic', data: lv_videos{rdelim});
tabsRelated.flush();
//]]></script>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}
{include file='bricks/contribute.tpl'}

View File

@@ -0,0 +1,16 @@
<div id="tabs-generic"></div>
<div id="listview-generic" class="listview"></div>
<script type="text/javascript">//<![CDATA[
var tabsRelated = new Tabs({ldelim}parent: $WH.ge('tabs-generic'){rdelim});
{foreach from=$tabs item="tab"}
{if !empty($tab.data)}
{include file="bricks/listviews/`$tab.file`.tpl" data=$tab.data params=$tab.params}
{/if}
{/foreach}
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
new Listview({ldelim}template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: tabsRelated, parent: 'listview-generic', data: lv_screenshots{rdelim});
if (lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))
new Listview({ldelim}template: 'video', id: 'videos', name: LANG.tab_videos, tabs: tabsRelated, parent: 'listview-generic', data: lv_videos{rdelim});
tabsRelated.flush();
//]]></script>

View File

@@ -70,17 +70,7 @@
<h2 class="clear">{$lang.related}</h2>
</div>
<div id="tabs-generic"></div>
<div id="listview-generic" class="listview"></div>
<script type="text/javascript">//<![CDATA[
var tabsRelated = new Tabs({ldelim}parent: $WH.ge('tabs-generic'){rdelim});
{if !empty($lvData.related)} {include file='bricks/listviews/itemset.tpl' data=$lvData.related.data params=$lvData.related.params} {/if}
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
new Listview({ldelim}template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: tabsRelated, parent: 'listview-generic', data: lv_screenshots{rdelim});
if (lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))
new Listview({ldelim}template: 'video', id: 'videos', name: LANG.tab_videos, tabs: tabsRelated, parent: 'listview-generic', data: lv_videos{rdelim});
tabsRelated.flush();
//]]></script>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}
{include file='bricks/contribute.tpl'}

View File

@@ -35,21 +35,7 @@
<h2 class="clear">{$lang.related}</h2>
</div>
<div id="tabs-generic"></div>
<div id="listview-generic" class="listview"></div>
<script type="text/javascript">//<![CDATA[
var tabsRelated = new Tabs({ldelim}parent: $WH.ge('tabs-generic'){rdelim});
{if isset($lvData.gallery)} {include file='bricks/listviews/model.tpl' data=$lvData.gallery.data params=$lvData.gallery.params } {/if}
{if isset($lvData.tameable)} {include file='bricks/listviews/creature.tpl' data=$lvData.tameable.data params=$lvData.tameable.params } {/if}
{if isset($lvData.abilities)} {include file='bricks/listviews/spell.tpl' data=$lvData.abilities.data params=$lvData.abilities.params} {/if}
{if isset($lvData.talents)} {include file='bricks/listviews/spell.tpl' data=$lvData.talents.data params=$lvData.talents.params } {/if}
{if isset($lvData.diet)} {include file='bricks/listviews/item.tpl' data=$lvData.diet.data params=$lvData.diet.params } {/if}
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
new Listview({ldelim}template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: tabsRelated, parent: 'listview-generic', data: lv_screenshots{rdelim});
if (lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))
new Listview({ldelim}template: 'video', id: 'videos', name: LANG.tab_videos, tabs: tabsRelated, parent: 'listview-generic', data: lv_videos{rdelim});
tabsRelated.flush();
//]]></script>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}
{include file='bricks/contribute.tpl'}

View File

@@ -1,7 +1,8 @@
{include file='header.tpl'}
{assign var="iconlist1" value="1"}
{assign var="iconlist2" value="1"}
<div id="main">
<div class="main" id="main">
<div id="main-precontents" class="main-precontents"></div>
<div id="main-contents" class="main-contents">
@@ -182,32 +183,9 @@
</table>
<h2>{$lang.related}</h2>
</div>
<div id="tabs-generic"></div>
<div id="listview-generic" class="listview"></div>
<script type="text/javascript">//<![CDATA[
var tabsRelated = new Tabs({ldelim}parent: $WH.ge('tabs-generic'){rdelim});
{if isset($lvData.modifiedBy)} {include file='bricks/listviews/spell.tpl' data=$lvData.modifiedBy.data params=$lvData.modifiedBy.params } {/if}
{if isset($lvData.modifies)} {include file='bricks/listviews/spell.tpl' data=$lvData.modifies.data params=$lvData.modifies.params } {/if}
{if isset($lvData.seeAlso)} {include file='bricks/listviews/spell.tpl' data=$lvData.seeAlso.data params=$lvData.seeAlso.params } {/if}
{if isset($lvData.usedByItem)} {include file='bricks/listviews/item.tpl' data=$lvData.usedByItem.data params=$lvData.usedByItem.params } {/if}
{if isset($lvData.usedByItemset)} {include file='bricks/listviews/itemset.tpl' data=$lvData.usedByItemset.data params=$lvData.usedByItemset.params} {/if}
{if isset($lvData.criteriaOf)} {include file='bricks/listviews/achievement.tpl' data=$lvData.criteriaOf.data params=$lvData.criteriaOf.params } {/if}
{if isset($lvData.contains)} {include file='bricks/listviews/item.tpl' data=$lvData.contains.data params=$lvData.contains.params } {/if}
{if isset($lvData.taughtbynpc)} {include file='bricks/listviews/creature.tpl' data=$lvData.taughtbynpc.data params=$lvData.taughtbynpc.params } {/if}
{if isset($lvData.taughtbyitem)} {include file='bricks/listviews/item.tpl' data=$lvData.taughtbyitem.data params=$lvData.taughtbyitem.params } {/if}
{if isset($lvData.taughtbyquest)} {include file='bricks/listviews/quest.tpl' data=$lvData.taughtbyquest.data params=$lvData.taughtbyquest.params} {/if}
{if isset($lvData.questreward)} {include file='bricks/listviews/quest.tpl' data=$lvData.questreward.data params=$lvData.questreward.params } {/if}
{if isset($lvData.usedbynpc)} {include file='bricks/listviews/creature.tpl' data=$lvData.usedbynpc.data params=$lvData.usedbynpc.params } {/if}
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
new Listview({ldelim}template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: tabsRelated, parent: 'listview-generic', data: lv_screenshots{rdelim});
if (lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))
new Listview({ldelim}template: 'video', id: 'videos', name: LANG.tab_videos, tabs: tabsRelated, parent: 'listview-generic', data: lv_videos{rdelim});
tabsRelated.flush();
//]]></script>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}
{include file='bricks/contribute.tpl'}

View File

@@ -19,7 +19,7 @@
{include file='bricks/infobox.tpl'}
<div class="text">
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: 11, typeId: {$lvData.page.id} {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: 11, typeId: {$page.typeId} {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
<a href="http://old.wowhead.com/?{$query[0]}={$query[1]}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
<h1 class="h1-icon">{if isset($lvData.page.expansion)}<span class="{$lvData.page.expansion}-icon-right">{$lvData.page.name}</span>{else}{$lvData.page.name}{/if}</h1>
@@ -28,18 +28,7 @@
<h2 class="clear">{$lang.related}</h2>
</div>
<div id="tabs-generic"></div>
<div id="listview-generic" class="listview"></div>
<script type="text/javascript">//<![CDATA[
var tabsRelated = new Tabs({ldelim}parent: $WH.ge('tabs-generic'){rdelim});
{if isset($lvData.page.acvReward)} {include file='bricks/listviews/achievement.tpl' data=$lvData.page.acvReward params=$lvData.page.acvParams } {/if}
{if isset($lvData.page.questReward)} {include file='bricks/listviews/quest.tpl' data=$lvData.page.questReward params=$lvData.page.questParams} {/if}
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
new Listview({ldelim}template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: tabsRelated, parent: 'listview-generic', data: lv_screenshots{rdelim});
if (lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))
new Listview({ldelim}template: 'video', id: 'videos', name: LANG.tab_videos, tabs: tabsRelated, parent: 'listview-generic', data: lv_videos{rdelim});
tabsRelated.flush();
//]]></script>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}
{include file='bricks/contribute.tpl'}