- moved redButtons to separate brick-file (no more "here its translated, and not there" or mixed up button order and better management on top)

- implemented subTabs for spells (used on class-page)
- load sqlLimits from config into constants
This commit is contained in:
Sarjuuk
2013-12-13 16:29:47 +01:00
parent 07ee8213da
commit 954352e17a
33 changed files with 592 additions and 399 deletions

View File

@@ -47,20 +47,21 @@ $AoWoWconf['characters'][0] = array(
// $AoWoWconf['characters'][] = [];
// -- Site Configuration --
$AoWoWconf['page']['cacheTimer'] = 1 * WEEK; // Time to keep cache in seconds (Default: 1 week)
$AoWoWconf['page']['name'] = 'Aowow Database Viewer (ADV)'; // Title of the website
$AoWoWconf['page']['shortName'] = 'Aowow'; // used in Feeds
$AoWoWconf['ttl'] = 60; // time to live for RSS
$AoWowConf['sessionTimeout'] = 1 * HOUR; // non-permanent session times out in time() + X
$AoWoWconf['register'] = true; // Allow account creating
// $AoWoWconf['loginFailCount'] = 5; // how often invalid passwords are tollerated
// $AoWoWconf['loginFailTime'] = 15 * MINUTE; // how long an account is closed after exceeding above limit
// $AoWoWconf['contactEmail'] = "feedback@aowow.org"; // ah well...
$AoWoWconf['boardUrl'] = "http://www.wowhead.com/forums?board="; // a javascript thing..
$AoWoWconf['sqlLimit'] = 300; // Limit of some SQL queries
$AoWoWconf['debug'] = true; // Disable cache, show smarty console panel, enable sql-errors
$AoWoWconf['map_grouping'] = 0; // Map object grouping factor. Meters = 10^param. 0:disabled; 1|2|3:enabled (1:recommended)
$AoWoWconf['battlegroup'] = 'Pure Pwnage'; // pretend, we belong to a battlegroup to satisfy profiler-related Jscripts; region can be determined from realmlist.timezone
$AoWoWconf['maintainance'] = false; // brb gnomes say hi
$AoWoWconf['ttl'] = 1 * MINUTE; // default: 60 - time to live for RSS
$AoWoWconf['cacheTimer'] = 1 * WEEK; // default: 60 * 60 * 7 - Time to keep cache in seconds (Default: 1 week)
$AoWowConf['sessionTimeout'] = 1 * HOUR; // default: 60 * 60 - non-permanent session times out in time() + X
// $AoWoWconf['loginFailTime'] = 15 * MINUTE; // default: 15 * 60 - how long an account is closed after exceeding above limit
// $AoWoWconf['loginFailCount'] = 5; // default: 5 - how often invalid passwords are tollerated
$AoWoWconf['defaultLimit'] = 300; // default: 300 - Limit of some SQL queries
$AoWoWconf['searchLimit'] = 500; // default: 500 - Limit of some SQL queries
$AoWoWconf['debug'] = true; // default: false - Disable cache, show smarty console panel, enable sql-errors
$AoWoWconf['map_grouping'] = 0; // default: 1 - Map object grouping factor. Meters = 10^param. 0:disabled; 1|2|3:enabled (1:recommended)
$AoWoWconf['register'] = true; // Allow account creating
$AoWoWconf['boardUrl'] = "http://www.wowhead.com/forums?board="; // a javascript thing..
// $AoWoWconf['contactEmail'] = "feedback@aowow.org"; // ah well...
$AoWoWconf['name'] = 'Aowow Database Viewer (ADV)'; // Title of the website
$AoWoWconf['shortName'] = 'Aowow'; // used in Feeds
$AoWoWconf['battlegroup'] = 'Pure Pwnage'; // pretend, we belong to a battlegroup to satisfy profiler-related Jscripts; region can be determined from realmlist.timezone
$AoWoWconf['maintainance'] = false; // brb gnomes say hi
?>

View File

@@ -50,7 +50,7 @@ define('AUTH_BANNED', 3);
define('AUTH_IPBANNED', 4);
// Cookie Names
define('COOKIE_AUTH', 'aw_a');
define('COOKIE_AUTH', 'aw_a');
// Times
define('MINUTE', 60);
@@ -87,6 +87,15 @@ define('LOCALE_DE', 3);
define('LOCALE_ES', 6);
define('LOCALE_RU', 8);
// red buttons on the top of the page (ASC:: right -> left)
define('BUTTON_WOWHEAD', 0);
define('BUTTON_UPGRADE', 1);
define('BUTTON_COMPARE', 2);
define('BUTTON_VIEW3D', 3);
define('BUTTON_LINKS', 4);
define('BUTTON_FORUM', 5);
define('BUTTON_TALENT', 6);
// generic filter handler
define('FILTER_CR_BOOLEAN', 1);
define('FILTER_CR_FLAG', 2);

View File

@@ -12,7 +12,11 @@ require 'config/config.php';
$e = !!$AoWoWconf['debug'] ? (E_ALL & ~(E_DEPRECATED|E_USER_DEPRECATED|E_STRICT)) : 0;
error_reporting($e);
define('STATIC_URL', substr('http://'.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1));
define('STATIC_URL', substr('http://'.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1));
define('SQL_LIMIT_NONE', 0);
define('SQL_LIMIT_SEARCH', $AoWoWconf['searchLimit']);
define('SQL_LIMIT_DEFAULT', $AoWoWconf['defaultLimit']);
require 'includes/libs/Smarty-2.6.26/libs/Smarty.class.php';// Libraray: http://www.smarty.net/
// require 'includes/libs/Smarty-3.1.14/libs/Smarty.class.php'; // Libraray: http://www.smarty.net/

View File

@@ -50,11 +50,9 @@ abstract class BaseType
*/
public function __construct($conditions = [], $applyFilter = false)
{
global $AoWoWconf; // yes i hate myself..
$where = [];
$linking = ' AND ';
$limit = $AoWoWconf['sqlLimit'];
$limit = SQL_LIMIT_DEFAULT;
$className = get_class($this);
if (!$this->queryBase || $conditions === null)

View File

@@ -12,7 +12,7 @@ class GameObjectList extends BaseType
protected $queryBase = 'SELECT *, go.entry AS ARRAY_KEY FROM gameobject_template go';
protected $queryOpts = array(
'go' => [['lg']],
'go' => [['lg', 'l']],
'lg' => ['j' => ['locales_gameobject lg ON go.entry = lg.entry', true]],
'l' => ['j' => ['?_lock l ON l.id = IF(go.type = 3, data0, null)', true], 's' => ', l.type1, l.properties1, l.reqSkill1, l.type2, l.properties2, l.reqSkill2']
);

View File

@@ -75,105 +75,147 @@ class ItemList extends BaseType
return Util::localizedString($n, 'name');
}
// todo (high): there are cases, where the same items has different extendedCosts attached (through different vendors)
// needs a way to filter for a specific currency/token to accomodate currencyFor-Tabs
// needs a way to filter for a specific vendor to accomodate soldBy-Tabs
public function getExtendedCost(&$reqRating = 0)
// todo (med): information will get lost if one vendor sells one item multiple times with different costs (e.g. for item 54637)
// wowhead seems to have had the same issues
public function getExtendedCost($filter = [], &$reqRating = 0)
{
if (!empty($this->vendors))
return $this->vendors;
$ids = array_keys($this->templates);
$itemz = DB::Aowow()->select('
SELECT nv.item AS ARRAY_KEY1, nv.entry AS ARRAY_KEY2, 0 AS eventId, nv.maxcount, iec.* FROM npc_vendor nv LEFT JOIN ?_itemextendedcost iec ON nv.extendedCost = iec.id WHERE nv.item IN (?a)
UNION
SELECT genv.item AS ARRAY_KEY1, c.id AS ARRAY_KEY2, genv.eventEntry AS eventId, genv.maxcount, iec.* FROM game_event_npc_vendor genv JOIN creature c ON c.guid = genv.guid LEFT JOIN ?_itemextendedcost iec ON genv.extendedCost = iec.id WHERE genv.item IN (?a)',
$ids,
$ids
);
$cItems = [];
foreach ($itemz as &$vendors)
if (empty($this->vendors))
{
foreach ($vendors as $k => $costs)
$ids = array_keys($this->templates);
$itemz = DB::Aowow()->select('
SELECT nv.item AS ARRAY_KEY1, nv.entry AS ARRAY_KEY2, 0 AS eventId, nv.maxcount, iec.* FROM npc_vendor nv LEFT JOIN ?_itemextendedcost iec ON nv.extendedCost = iec.id WHERE nv.item IN (?a)
UNION
SELECT genv.item AS ARRAY_KEY1, c.id AS ARRAY_KEY2, genv.eventEntry AS eventId, genv.maxcount, iec.* FROM game_event_npc_vendor genv JOIN creature c ON c.guid = genv.guid LEFT JOIN ?_itemextendedcost iec ON genv.extendedCost = iec.id WHERE genv.item IN (?a)',
$ids,
$ids
);
$cItems = [];
foreach ($itemz as &$vendors)
{
$data = array(
'stock' => $costs['maxcount'] ? $costs['maxcount'] : -1,
'event' => $costs['eventId']
);
foreach ($vendors as $k => $costs)
{
$data = array(
'stock' => $costs['maxcount'] ? $costs['maxcount'] : -1,
'event' => $costs['eventId'],
'reqRtg' => $costs['reqPersonalRating']
);
if ($_ = $this->getField('buyPrice')) // somewhat nonsense.. is identical for all vendors (obviously)
$data[0] = $_;
// hardcode arena(103) & honor(104)
if ($_ = @$costs['reqArenaPoints'])
{
$data[-103] = $_;
Util::$pageTemplate->extendGlobalIds(TYPE_CURRENCY, 103);
}
if ($_ = @$costs['reqHonorPoints'])
{
$data[-104] = $_;
Util::$pageTemplate->extendGlobalIds(TYPE_CURRENCY, 104);
}
for ($i = 1; $i < 6; $i++)
{
if (($_ = @$costs['reqItemId'.$i]) && $costs['itemCount'.$i] > 0)
{
$data[$_] = $costs['itemCount'.$i];
$cItems[] = $_;
}
}
$vendors[$k] = $data;
}
}
// convert items to currency if possible
$moneyItems = new CurrencyList(array(['itemId', $cItems]));
$moneyItems->addGlobalsToJscript(Util::$pageTemplate);
foreach ($itemz as $id => &$vendors)
{
foreach ($vendors as &$costs)
{
foreach ($costs as $k => $v)
{
if (in_array($k, $cItems))
{
$found = false;
foreach ($moneyItems->iterate() as $__)
{
if ($moneyItems->getField('itemId') == $k)
{
unset($costs[$k]);
$costs[-$moneyItems->id] = $v;
$found = true;
break;
}
}
if (!$found)
Util::$pageTemplate->extendGlobalIds(TYPE_ITEM, $k);
}
}
}
$this->vendors[$id] = $vendors;
}
}
$result = $this->vendors;
// apply filter if given
$tok = @$filter[TYPE_ITEM];
$cur = @$filter[TYPE_CURRENCY];
$npc = @$filter[TYPE_NPC]; // bought at specific vendor
$reqRating = -1;
foreach ($result as $itemId => $data)
{
foreach ($data as $npcId => $costs)
{
if ($npc && $npcId != $npc)
{
unset($data[$npcId]);
continue;
}
if ($tok || $cur) // bought with specific token or currency
{
$valid = false;
foreach ($costs as $k => $qty)
{
if ((!$tok || $k == $tok) && (!$cur || $k == -$cur))
{
$valid = true;
break;
}
}
if (!$valid)
unset($data[$npcId]);
}
// reqRating ins't really a cost .. so pass it by ref instead of return
// use lowest total value
// note: how to distinguish between brackets .. or team/pers-rating?
if ($_ = @$costs['reqPersonalRating'])
$reqRating = $_;
if ($_ = $this->getField('buyPrice')) // somewhat nonsense.. is identical for all vendors (obviously)
$data[0] = $_;
// hardcode arena(103) & honor(104)
if ($_ = @$costs['reqArenaPoints'])
{
$data[-103] = $_;
Util::$pageTemplate->extendGlobalIds(TYPE_CURRENCY, 103);
}
if ($_ = @$costs['reqHonorPoints'])
{
$data[-104] = $_;
Util::$pageTemplate->extendGlobalIds(TYPE_CURRENCY, 104);
}
for ($i = 1; $i < 6; $i++)
{
if (($_ = @$costs['reqItemId'.$i]) && $costs['itemCount'.$i] > 0)
{
$data[$_] = $costs['itemCount'.$i];
$cItems[] = $_;
}
}
$vendors[$k] = $data;
}
}
// convert items to currency if possible
$moneyItems = new CurrencyList(array(['itemId', $cItems]));
$moneyItems->addGlobalsToJscript(Util::$pageTemplate);
foreach ($itemz as $id => &$vendors)
{
foreach ($vendors as &$costs)
{
foreach ($costs as $k => $v)
{
if (in_array($k, $cItems))
{
$found = false;
foreach ($moneyItems->iterate() as $__)
{
if ($moneyItems->getField('itemId') == $k)
{
unset($costs[$k]);
$costs[-$moneyItems->id] = $v;
$found = true;
break;
}
}
if (!$found)
Util::$pageTemplate->extendGlobalIds(TYPE_ITEM, $k);
}
}
if (isset($data[$npcId]) && ($reqRating > $costs['reqRtg'] || $reqRating < 0 ))
$reqRating = $costs['reqRtg'];
}
$this->vendors[$id] = $vendors;
if (empty($data))
unset($result[$itemId]);
}
return $this->vendors;
return $result;
}
public function getListviewData($addInfoMask = 0x0)
public function getListviewData($addInfoMask = 0x0, $miscData = null)
{
/*
* ITEMINFO_JSON (0x01): itemMods (including spells) and subitems parsed
@@ -224,9 +266,12 @@ class ItemList extends BaseType
if ($addInfoMask & ITEMINFO_VENDOR)
{
// just use the first reseults
if ($cost = @reset($this->getExtendedCost()[$this->id]));
// just use the first results
// todo (med): dont use first result; search for the right one
$cost = @reset($this->getExtendedCost($miscData)[$this->id]);
if ($cost)
{
$currency = [];
$tokens = [];
foreach ($cost as $k => $qty)
@@ -678,7 +723,7 @@ class ItemList extends BaseType
$x .= sprintf(Lang::$game['reqLevel'], $_reqLvl).'<br />';
// required arena team raing / perosnal rating / todo (low): sort out what kind of rating
if (@$this->getExtendedCost($reqRating)[$this->id] && $reqRating)
if (@$this->getExtendedCost([], $reqRating)[$this->id] && $reqRating)
$x .= sprintf(Lang::$item['reqRating'], $reqRating);
// item level

View File

@@ -288,7 +288,7 @@ class SmartyAoWoW extends Smarty
$cwd = str_replace("\\", "/", getcwd());
$this->assign('appName', $config['page']['name']);
$this->assign('appName', $config['name']);
$this->assign('AOWOW_REVISION', AOWOW_REVISION);
$this->config = $config;
$this->template_dir = $cwd.'/template/';
@@ -308,7 +308,8 @@ class SmartyAoWoW extends Smarty
'typeId' => null, // [int] entry to display
'path' => '[]' // [string] (js:array) path to preselect in the menu
);
$this->_tpl_vars['jsGlobals'] = [];
$this->_tpl_vars['jsGlobals'] = [];
$this->_tpl_vars['redButtons'] = [];
}
// using Smarty::assign would overwrite every pair and result in undefined indizes

View File

@@ -92,6 +92,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'path' => $tmpPath,
'infobox' => array_merge($infobox, Lang::getInfoBoxForFlags($acv->getField('cuFlags'))),
'relTabs' => [],
'buttons' => array(
BUTTON_LINKS => ['color' => 'ffffff00', 'linkId' => Util::$typeStrings[TYPE_ACHIEVEMENT].':'.$_id.':&quot;..UnitGUID(&quot;player&quot;)..&quot;:0:0:0:0:0:0:0:0'],
BUTTON_WOWHEAD => true
),
'page' => array(
'name' => $acv->getField('name', true),
'description' => $acv->getField('description', true),
@@ -407,6 +411,7 @@ $smarty->updatePageVars(array(
'type' => TYPE_ACHIEVEMENT,
'typeId' => $_id
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_ACHIEVEMENT, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$achievement, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData);

View File

@@ -90,9 +90,9 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
$pageData['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
// create note if search limit was exceeded
if ($acvList->getMatches() > $AoWoWconf['sqlLimit'])
if ($acvList->getMatches() > SQL_LIMIT_DEFAULT)
{
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), $AoWoWconf['sqlLimit']);
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), SQL_LIMIT_DEFAULT);
$pageData['params']['_truncated'] = 1;
}

View File

@@ -31,6 +31,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($cl->error)
$smarty->notFound(Lang::$game['class']);
/***********/
/* Infobox */
/***********/
$infobox = [];
// hero class
if ($cl->getField('hero'))
@@ -64,45 +68,74 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$infobox[] = Lang::$game['specs'].Lang::$colon.'[ul][li]'.implode('[/li][li]', $specList).'[/li][/ul]';
/****************/
/* Main Content */
/****************/
$pageData = array (
'title' => $cl->getField('name', true).' - '.Util::ucFirst(Lang::$game['class']),
'path' => $_path,
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
'relTabs' => [],
'page' => array(
'title' => $cl->getField('name', true).' - '.Util::ucFirst(Lang::$game['class']),
'path' => $_path,
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
'relTabs' => [],
'buttons' => array(
BUTTON_LINKS => ['color' => '', 'linkId' => ''],
BUTTON_WOWHEAD => true,
BUTTON_TALENT => ['href' => '?talent#'.Util::$tcEncoding[$tcClassId[$_id] * 3], 'pet' => false],
BUTTON_FORUM => false // doto (low): $GLOBALS['AoWoWconf']['boardUrl'] + X
),
'page' => array(
'name' => $cl->getField('name', true),
'talentCalc' => Util::$tcEncoding[$tcClassId[$_id] * 3],
'icon' => 'class_'.strtolower($cl->getField('fileString')),
'expansion' => Util::$expansionString[$cl->getField('expansion')]
)
);
/*
note!
newer listviews support subTabs - i.e.:
Spells => Abilities, Talents, Glyphs, Proficiencies
Items => grouping by subclass
*/
// Quests
/**************/
/* Extra Tabs */
/**************/
// Tab: Spells (grouped)
// '$LANG.tab_armorproficiencies',
// '$LANG.tab_weaponskills',
// '$LANG.tab_glyphs',
// '$LANG.tab_abilities',
// '$LANG.tab_talents',
$conditions = array(
['RequiredClasses', $_mask, '&'],
[['RequiredClasses', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL, '!']
['s.typeCat', [-13, -11, -2, 7]],
[['s.cuFlags', (SPELL_CU_TRIGGERED | SPELL_CU_EXCLUDE_CATEGORY_SEARCH), '&'], 0],
[
'OR',
['s.reqClassMask', $_mask, '&'], // Glyphs, Proficiencies
['s.skillLine1', $classSkills[$_id]], // Abilities / Talents
['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $classSkills[$_id]]]
],
[ // last rank or unranked
'OR',
['s.cuFlags', SPELL_CU_LAST_RANK, '&'],
['s.rankId', 0]
]
);
$quests = new QuestList($conditions);
$quests->addGlobalsToJscript($smarty);
$genSpells = new SpellList($conditions);
$genSpells->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
$pageData['relTabs'][] = array(
'file' => 'quest',
'data' => $quests->getListviewData(),
'file' => 'spell',
'data' => $genSpells->getListviewData(),
'params' => array(
'sort' => "$['reqlevel', 'name']",
'tabs' => '$tabsRelated'
'id' => 'spells',
'name' => '$LANG.tab_spells',
'visibleCols' => "$['level', 'schools', 'type', 'classes']",
'hiddenCols' => "$['reagents', 'skill']",
'sort' => "$['-level', 'type', 'name']",
'tabs' => '$tabsRelated',
'computeDataFunc' => '$Listview.funcBox.initSpellFilter',
'onAfterCreate' => '$Listview.funcBox.addSpellIndicator'
)
);
// Items
// Tab: Items (grouped)
$conditions = array(
['requiredClass', 0, '>'],
['requiredClass', $_mask, '&'],
@@ -133,9 +166,25 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
)
);
// Tab: Quests
$conditions = array(
['RequiredClasses', $_mask, '&'],
[['RequiredClasses', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL, '!']
);
$quests = new QuestList($conditions);
$quests->addGlobalsToJscript($smarty);
// Itemsets
$pageData['relTabs'][] = array(
'file' => 'quest',
'data' => $quests->getListviewData(),
'params' => array(
'sort' => "$['reqlevel', 'name']",
'tabs' => '$tabsRelated'
)
);
// Tab: Itemsets
$sets = new ItemsetList(array(['classMask', $_mask, '&']));
$sets->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
@@ -150,8 +199,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
)
);
// Trainer
// Tab: Trainer
$conditions = array(
['npcflag', 0x30, '&'], // is trainer
['trainer_type', 0], // trains class spells
@@ -170,142 +218,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
)
);
// Armor Proficiencies
$conditions = array(
['s.typeCat', -11],
['s.skillLine1', SpellList::$skillLines[8]],
['s.reqClassMask', $_mask, '&']
);
$armorProf = new SpellList($conditions);
$armorProf->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $armorProf->getListviewData(),
'params' => array(
'id' => 'armor-proficiencies',
'name' => '$LANG.tab_armorproficiencies',
'visibleCols' => "$['type', 'classes']",
'hiddenCols' => "$['reagents', 'skill']",
'tabs' => '$tabsRelated'
)
);
// Weapon Proficiencies
$conditions = array(
['s.typeCat', -11],
['OR', ['s.skillLine1', SpellList::$skillLines[6]], ['s.skillLine1', -3]],
['s.reqClassMask', $_mask, '&']
);
$weaponProf = new SpellList($conditions);
$weaponProf->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $weaponProf->getListviewData(),
'params' => array(
'id' => 'weapon-skills',
'name' => '$LANG.tab_weaponskills',
'visibleCols' => "$['type', 'classes']",
'hiddenCols' => "$['reagents', 'skill']",
'tabs' => '$tabsRelated'
)
);
// Glyphs
$conditions = array(
['s.typeCat', -13],
['s.reqClassMask', $_mask, '&']
);
$glyphs = new SpellList($conditions);
$glyphs->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $glyphs->getListviewData(),
'params' => array(
'id' => 'glyphs',
'name' => '$LANG.tab_glyphs',
'visibleCols' => "$['type']",
'hiddenCols' => "$['reagents']",
'tabs' => '$tabsRelated'
)
);
// Abilities
$conditions = array(
['s.typeCat', [7, -2]],
[['s.cuFlags', (SPELL_CU_TALENTSPELL | SPELL_CU_TALENT | SPELL_CU_TRIGGERED | SPELL_CU_EXCLUDE_CATEGORY_SEARCH), '&'], 0],
[ // select class by skillLine
'OR',
['s.skillLine1', $classSkills[$_id]],
['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $classSkills[$_id]]]
],
[ // last rank or unranked
'OR',
['s.cuFlags', SPELL_CU_LAST_RANK, '&'],
['s.rankId', 0]
]
);
$abilities = new SpellList($conditions);
$abilities->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $abilities->getListviewData(),
'params' => array(
'id' => 'abilities',
'name' => '$LANG.tab_abilities',
'note' => sprintf(Util::$filterResultString, '?spells=7.'.$_id),
'visibleCols' => "$['level', 'schools']",
'sort' => "$['skill', 'name']",
'tabs' => '$tabsRelated'
)
);
// Talents
$conditions = array(
['s.typeCat', -2],
['cuFlags', (SPELL_CU_TALENT | SPELL_CU_TALENTSPELL), '&'],
[ // select class by skillLine
'OR',
['s.skillLine1', $classSkills[$_id]],
['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $classSkills[$_id]]]
],
[ // last rank or unranked
'OR',
['s.cuFlags', SPELL_CU_LAST_RANK, '&'],
['s.rankId', 0]
]
);
$talents = new SpellList($conditions);
$talents->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $talents->getListviewData(),
'params' => array(
'id' => "talents",
'name' => '$LANG.tab_talents',
'note' => sprintf(Util::$filterResultString, '?spells=-2.'.$_id),
'visibleCols' => "$['level', 'schools', 'tier']",
'sort' => "$['skill', 'tier']",
'tabs' => '$tabsRelated'
)
);
// Races
// Tab: Races
$races = new CharRaceList(array(['classMask', $_mask, '&']));
$pageData['relTabs'][] = array(
@@ -328,11 +241,11 @@ $smarty->updatePageVars(array(
'tab' => 0,
'type' => TYPE_CLASS,
'typeId' => $_id,
// 'boardUrl' => '', //$GLOBALS['AoWoWconf']['boardUrl'] + X,
'reqJS' => array(
'template/js/swfobject.js'
)
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_CLASS, $_id)); // comments, screenshots, videos
$smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData);

View File

@@ -80,9 +80,6 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
$_class = $item->getField('class');
$_subClass = $item->getField('subClass');
$_bagFamily = $item->getField('bagFamily');
$_extCost = [];
if ($_ = @$item->getExtendedCost($_reqRating)[$item->id])
$_extCost = $_;
/***********/
/* Infobox */
@@ -130,33 +127,49 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
if ($tName = DB::Aowow()->selectRow('SELECT * FROM ?_totemCategory WHERE id = ?d', $tId))
$quickInfo[] = Lang::$item['tool'].Lang::$colon.'[url=?items&filter=cr=91;crs='.$tId.';crv=0]'.Util::localizedString($tName, 'name').'[/url]';
$each = $item->getField('stackable') > 1 ? '[color=q0] ('.Lang::$item['each'].')[/color]' : null;
$tokens = $currency = [];
if ($_ = reset($_extCost))
$each = $item->getField('stackable') > 1 ? '[color=q0] ('.Lang::$item['each'].')[/color]' : null;
if ($_ = @$item->getExtendedCost([], $_reqRating)[$item->id])
{
foreach ($_ as $c => $qty)
$handled = [];
$costList = [];
foreach ($_ as $npcId => $data)
{
if (is_string($c))
if (in_array(md5(serialize($data)), $handled)) // display every cost-combination only once
continue;
if ($c < 0) // currency items (and honor or arena)
$currency[] = -$c.','.$qty;
else if ($c > 0) // plain items (item1,count1,item2,count2,...)
$tokens[$c] = $c.','.$qty;
$handled[] = md5(serialize($data));
$tokens = [];
$currency = [];
foreach ($data as $c => $qty)
{
if (is_string($c))
continue;
if ($c < 0) // currency items (and honor or arena)
$currency[] = -$c.','.$qty;
else if ($c > 0) // plain items (item1,count1,item2,count2,...)
$tokens[$c] = $c.','.$qty;
}
$cost = isset($_[0]) ? '[money='.$_[0] : '[money';
if ($tokens)
$cost .= ' items='.implode(',', $tokens);
if ($currency)
$cost .= ' currency='.implode(',', $currency);
$cost .= ']';
$costList[] = $cost;
}
$cost = isset($_[0]) ? '[money='.$_[0] : '[money';
if ($tokens)
$cost .= ' items='.implode(',', $tokens);
if ($currency)
$cost .= ' currency='.implode(',', $currency);
$cost .= ']';
if ($cost)
$quickInfo[] = Lang::$item['cost'].Lang::$colon.$cost.$each;
if (count($costList) == 1)
$quickInfo[] = Lang::$item['cost'].Lang::$colon.$costList[0].$each;
else if (count($costList) > 1)
$quickInfo[] = Lang::$item['cost'].$each.Lang::$colon.'[ul][li]'.implode('[/li][li]', $costList).'[/li][/ul]';
if ($_reqRating)
$quickInfo[] = sprintf(Lang::$item['reqRating'], $_reqRating);
@@ -228,6 +241,9 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
/* Main Content */
/****************/
$cmpUpg = in_array($_class, [ITEM_CLASS_WEAPON, ITEM_CLASS_ARMOR]) || $item->getField('gemEnchantmentId');
$view3D = in_array($_class, [ITEM_CLASS_WEAPON, ITEM_CLASS_ARMOR]) && $item->getField('displayId');
$pageData = array(
'infobox' => $quickInfo ? '[ul][li]'.implode('[/li][li]', $quickInfo).'[/li][/ul]' : null,
'relTabs' => [],
@@ -235,16 +251,18 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
'path' => [0, 0],
'title' => [$item->getField('name', true), Util::ucFirst(Lang::$game['item'])],
'pageText' => [],
'buttons' => in_array($_class, [ITEM_CLASS_WEAPON, ITEM_CLASS_ARMOR]) || $item->getField('gemEnchantmentId'),
'buttons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => ['color' => 'ff'.Util::$rarityColorStings[$item->getField('quality')], 'linkId' => 'item:'.$_id.':0:0:0:0:0:0:0:0'],
BUTTON_VIEW3D => $view3D ? ['displayId' => $item->getField('displayId'), 'slot' => $_slot, 'type' => TYPE_ITEM, 'typeId' => $_id] : false,
BUTTON_COMPARE => $cmpUpg, // bool required
BUTTON_UPGRADE => $cmpUpg ? ['class' => $_class, 'slot' => $_slot] : false
),
'page' => array(
'color' => Util::$rarityColorStings[$item->getField('quality')],
'quality' => $item->getField('quality'),
'icon' => $item->getField('iconString'),
'name' => $item->getField('name', true),
'displayId' => in_array($_class, [ITEM_CLASS_WEAPON, ITEM_CLASS_ARMOR]) && $item->getField('displayId') ? $item->getField('displayId') : null,
'slot' => $_slot,
'stack' => $item->getField('stackable'),
'class' => $_class
)
);
@@ -360,7 +378,7 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
foreach ($sources as $lootTpl => $lootData)
{
// cap fetched entries to the sql-limit to guarantee, that the highest chance items get selected first
$ids = array_slice(array_keys($lootData), 0, $AoWoWconf['sqlLimit']);
$ids = array_slice(array_keys($lootData), 0, SQL_LIMIT_DEFAULT);
switch ($lootTpl)
{
@@ -759,6 +777,7 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
'AND',
['class', $_class],
['subClass', $_subClass],
['slot', $_slot],
['itemLevel', $item->getField('itemLevel') - 15, '>'],
['itemLevel', $item->getField('itemLevel') + 15, '<'],
['quality', $item->getField('quality')],
@@ -789,10 +808,10 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
$starts = new QuestList(array(['qt.id', $qId]));
if (!$starts->error)
{
$starts->addGlobalsToJscript($stmarty);
$starts->addGlobalsToJscript($smarty);
$pageData['relTabs'][] = array(
'file' => 'item',
'file' => 'quest',
'data' => $starts->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
@@ -869,7 +888,7 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
}
// tab: sold by
if ($vendors = $_extCost)
if ($vendors = @$item->getExtendedCost([], $_reqRating)[$item->id])
{
$soldBy = new CreatureList(array(['id', array_keys($vendors)]));
if (!$soldBy->error)
@@ -954,21 +973,24 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
else
$w = 'iec.reqItemId1 = '.$_id.' OR iec.reqItemId2 = '.$_id.' OR iec.reqItemId3 = '.$_id.' OR iec.reqItemId4 = '.$_id.' OR iec.reqItemId5 = '.$_id;
$baughtBy = DB::Aowow()->selectCol('
$boughtBy = DB::Aowow()->selectCol('
SELECT item FROM npc_vendor nv JOIN ?_itemExtendedCost iec ON iec.id = nv.extendedCost WHERE '.$w.'
UNION
SELECT item FROM game_event_npc_vendor genv JOIN ?_itemExtendedCost iec ON iec.id = genv.extendedCost WHERE '.$w
);
if ($baughtBy)
if ($boughtBy)
{
$baughtBy = new ItemList(array(['id', $baughtBy]));
if (!$baughtBy->error)
$boughtBy = new ItemList(array(['id', $boughtBy]));
if (!$boughtBy->error)
{
$baughtBy->addGlobalsToJscript($smarty);
$boughtBy->addGlobalsToJscript($smarty);
$iCur = new CurrencyList(array(['itemId', $_id]));
$filter = $iCur->error ? [TYPE_ITEM => $_id] : [TYPE_CURRENCY => $iCur->id];
$pageData['relTabs'][] = array(
'file' => 'item',
'data' => $baughtBy->getListviewData(ITEMINFO_VENDOR),
'data' => $boughtBy->getListviewData(ITEMINFO_VENDOR, $filter),
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_currencyfor',
@@ -1051,6 +1073,7 @@ $smarty->updatePageVars(array(
$pageData['pageText'] ? ['path' => 'template/css/Book.css'] : null,
)
));
$smarty->assign('redButtons', $pageData['buttons']);
$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

@@ -321,9 +321,9 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
}
// create note if search limit was exceeded; overwriting 'note' is intentional
if ($items->getMatches() > $AoWoWconf['sqlLimit'] && empty($filter['upg']))
if ($items->getMatches() > SQL_LIMIT_DEFAULT && empty($filter['upg']))
{
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), $AoWoWconf['sqlLimit']);
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), SQL_LIMIT_DEFAULT);
$pageData['params']['_truncated'] = 1;
}

View File

@@ -26,6 +26,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$_na = $iSet->getField('name', true);
$_cnt = count($iSet->getField('pieces'));
/***********/
/* Infobox */
/***********/
$infobox = [];
// unavailable (todo (low): set data)
if ($iSet->getField('cuFlags') & CUSTOM_UNAVAILABLE)
@@ -71,6 +75,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($_ta)
$infobox[] = Lang::$itemset['_tag'].Lang::$colon.'[url=?itemsets&filter=ta='.$_ta.']'.Lang::$itemset['notes'][$_ta].'[/url]';
/****************/
/* Main Content */
/****************/
// pieces + Summary
$pieces = [];
$eqList = [];
@@ -173,7 +181,12 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'relTabs' => [],
'pieces' => $pieces,
'spells' => $spells,
'view3D' => json_encode($eqList, JSON_NUMERIC_CHECK),
'buttons' => array(
BUTTON_WOWHEAD => $_id > 0, // bool only
BUTTON_LINKS => ['color' => '', 'linkId' => ''],
BUTTON_VIEW3D => ['type' => TYPE_ITEMSET, 'typeId' => $_id, 'equipList' => $eqList],
BUTTON_COMPARE => ['eqList' => implode(':', $compare), 'qty' => $_cnt]
),
'compare' => array(
'qty' => $_cnt,
'items' => $compare,
@@ -190,6 +203,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$iSet->addGlobalsToJscript($smarty);
/**************/
/* Extra Tabs */
/**************/
// related sets (priority: 1: similar tag + class; 2: has event; 3: no tag + similar type, 4: similar type + profession)
$rel = [];
@@ -259,6 +276,7 @@ $smarty->updatePageVars(array(
'template/js/swfobject.js'
)
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_ITEMSET, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$itemset, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData);

View File

@@ -32,9 +32,9 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
$path[] = $filter['cl'];
// create note if search limit was exceeded
if ($itemsets->getMatches() > $AoWoWconf['sqlLimit'])
if ($itemsets->getMatches() > SQL_LIMIT_DEFAULT)
{
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), $AoWoWconf['sqlLimit']);
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), SQL_LIMIT_DEFAULT);
$pageData['params']['_truncated'] = 1;
}

View File

@@ -116,9 +116,9 @@ if (strstr($pageCall, 'latest') || $pageCall == 'most-comments')
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".
"<rss version=\"2.0\">\n\t<channel>\n".
"\t\t<title>".$AoWoWconf['page']['shortName'].' - '.Lang::$main['utilities'][$menu] . ($_title ? Lang::$colon . $_title : null)."</title>\n".
"\t\t<title>".$AoWoWconf['shortName'].' - '.Lang::$main['utilities'][$menu] . ($_title ? Lang::$colon . $_title : null)."</title>\n".
"\t\t<link>".STATIC_URL.'?'.$pageCall . ($pageParam ? '='.$pageParam : null)."</link>\n".
"\t\t<description>".$AoWoWconf['page']['name']."</description>\n".
"\t\t<description>".$AoWoWconf['name']."</description>\n".
"\t\t<language>".implode('-', str_split(User::$localeString, 2))."</language>\n".
"\t\t<ttl>".$AoWoWconf['ttl']."</ttl>\n".
// <lastBuildDate>Sat, 31 Aug 2013 15:33:16 -0500</lastBuildDate>

View File

@@ -16,6 +16,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($pet->error)
$smarty->notFound(Lang::$game['pet']);
/***********/
/* Infobox */
/***********/
$infobox = [];
// level range
@@ -25,13 +29,21 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($pet->getField('exotic'))
$infobox[] = '[url=?spell=53270]'.Lang::$pet['exotic'].'[/url]';
/****************/
/* Main Content */
/****************/
$pageData = array(
'title' => $pet->getField('name', true),
'path' => '[0, 8, '.$pet->getField('type').']',
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
'relTabs' => [],
'buttons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => true,
BUTTON_TALENT => ['href' => '?petcalc#'.Util::$tcEncoding[(int)($_id / 10)] . Util::$tcEncoding[(2 * ($_id % 10) + ($pet->getField('exotic') ? 1 : 0))], 'pet' => true]
),
'page' => array(
'petCalc' => Util::$tcEncoding[(int)($_id / 10)] . Util::$tcEncoding[(2 * ($_id % 10) + ($pet->getField('exotic') ? 1 : 0))],
'name' => $pet->getField('name', true),
'id' => $_id,
'icon' => $pet->getField('iconString'),
@@ -39,7 +51,11 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
),
);
// tameable & gallery
/**************/
/* Extra Tabs */
/**************/
// tab: tameable & gallery
$condition = array(
['ct.type', 1], // Beast
['ct.type_flags', 0x1, '&'], // tameable
@@ -73,7 +89,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
)
);
// diet
// tab: diet
$list = [];
$mask = $pet->getField('foodMask');
for ($i = 1; $i < 7; $i++)
@@ -95,7 +111,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
)
);
// spells
// tab: spells
$mask = 0x0;
foreach (Util::$skillLineMask[-1] as $idx => $pair)
{
@@ -137,7 +153,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
)
);
// talents
// tab: talents
$conditions = array(
['s.typeCat', -7],
[ // last rank or unranked
@@ -186,6 +202,7 @@ $smarty->updatePageVars(array(
'template/js/swfobject.js'
)
));
$smarty->assign('redButtons', $pageData['buttons']);
$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

@@ -10,7 +10,7 @@ $_id = intVal($pageParam);
$_mask = 1 << ($_id - 1);
$_path = [0, 13, $_id];
$mountVendors = array( // [starter, argent tournament]
$mountVendors = array( // race => [starter, argent tournament]
null,
[384, 33307],
[3362, 33553],
@@ -34,7 +34,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$smarty->notFound(Lang::$game['race']);
/***********/
/* INFOBOX */
/* Infobox */
/***********/
$infobox = []; // unfortunately is all of this custom data :/
@@ -64,11 +64,19 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$infobox[] = Lang::$class['startZone'].Lang::$colon.'[zone='.$_.']';
}
/****************/
/* Main Content */
/****************/
$pageData = array (
'title' => $race->getField('name', true).' - '.Util::ucFirst(Lang::$game['race']),
'path' => $_path,
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
'relTabs' => [],
'buttons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => true
),
'page' => array(
'name' => $race->getField('name', true),
'icon' => strtolower($race->getField('fileString')),
@@ -76,9 +84,9 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
)
);
/********/
/* TABS */
/********/
/**************/
/* Extra Tabs */
/**************/
// Classes
$classes = new CharClassList(array(['racemask', $_mask, '&']));
@@ -92,7 +100,6 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
)
);
// Tongues
$conditions = array(
['typeCat', -11], // proficiencies
@@ -133,7 +140,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
)
);
// Quests
// Quests
$conditions = array(
['RequiredRaces', $_mask, '&'],
[['RequiredRaces', RACE_MASK_ALL, '&'], RACE_MASK_ALL, '!'],
@@ -189,6 +196,7 @@ $smarty->updatePageVars(array(
'type' => TYPE_RACE,
'typeId' => $_id
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_RACE, $_id)); // comments, screenshots, videos
$smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData);

View File

@@ -18,10 +18,18 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$_cat = $skill->getField('typeCat');
/****************/
/* Main Content */
/****************/
$pageData = array(
'title' => $skill->getField('name', true),
'path' => [0, 14],
'relTabs' => [],
'buttons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => true
),
'page' => array(
'name' => $skill->getField('name', true),
'icon' => $skill->getField('iconString'),
@@ -31,6 +39,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$pageData['path'][] = (in_array($_cat, [9, 11]) || $_id == 762) ? $_id : $_cat;
/**************/
/* Extra Tabs */
/**************/
if (in_array($_cat, [-5, 9, 11]))
{
$condition = array(
@@ -346,6 +358,7 @@ $smarty->updatePageVars(array(
'type' => TYPE_SKILL,
'typeId' => $_id
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_SKILL, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main));
$smarty->assign('lvData', $pageData);

View File

@@ -246,7 +246,11 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'infobox' => $infobox,
'relTabs' => [],
'view3D' => 0,
'buttons' => array(
BUTTON_LINKS => ['color' => 'ff71d5ff', 'linkId' => Util::$typeStrings[TYPE_SPELL].':'.$_id],
BUTTON_VIEW3D => false,
BUTTON_WOWHEAD => true
),
'page' => array(
'scaling' => '',
'powerCost' => $spell->createPowerCostForCurrent(),
@@ -579,7 +583,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if (!$summon->error)
{
$_ = '(<a href="?npc='.$effMV.'">'.$summon->getField('name', true).'</a>)';
$pageData['view3D'] = $summon->getRandomModelId();
$pageData['buttons'][BUTTON_VIEW3D] = ['type' => TYPE_NPC, 'displayId' => $summon->getRandomModelId()];
}
$foo['name'] .= Lang::$colon.$_;
@@ -633,7 +637,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($n/*!$summon->error*/)
{
$_ = '(<a href="?object='.$effMV.'">'.$n/*$summon->getField('name', true)*/.'</a>)';
//$pageData['view3D'] = $summon->getRandomModelId();
//$pageData['buttons'][BUTTON_VIEW3D] = ['type' => TYPE_NPC, 'displayId' => $summon->getRandomModelId()];
}
$foo['name'] .= Lang::$colon.$_;
@@ -751,7 +755,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
case 36: // Shapeshift
if ($st = DB::Aowow()->selectRow('SELECT *, displayIdA as model1, displayIdH as model2 FROM ?_shapeshiftForms WHERE id = ?d', $effMV))
{
$pageData['view3D'] = $st['model2'] ? $st['model'.rand(1, 2)]: $st['model1'];
$pageData['buttons'][BUTTON_VIEW3D] = array(
'type' => TYPE_NPC,
'displayId' => $st['model2'] ? $st['model'.rand(1, 2)]: $st['model1']
);
if ($st['creatureType'] > 0)
$pageData['infobox'][] = '[li]'.Lang::$game['type'].Lang::$colon.Lang::$game['ct'][$st['creatureType']].'[/li]';
@@ -901,6 +908,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if (!$transform->error)
{
$pageData['view3D'] = $transform->getRandomModelId();
$pageData['buttons'][BUTTON_VIEW3D] = ['type' => TYPE_NPC, 'displayId' => $transform->getRandomModelId()];
$bar = ' (<a href="?npc='.$effMV.'">'.$transform->getField('name', true).'</a>)';
}
else
@@ -1578,9 +1586,10 @@ $smarty->updatePageVars(array(
'type' => TYPE_SPELL,
'typeId' => $_id,
'reqJS' => array(
$pageData['view3D'] ? 'template/js/swfobject.js' : null
$pageData['buttons'][BUTTON_VIEW3D] ? 'template/js/swfobject.js' : null
)
));
$smarty->assign('redButtons', $pageData['buttons']);
$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

@@ -392,9 +392,9 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
$spells->addGlobalsToJscript($smarty, GLOBALINFO_SELF | GLOBALINFO_RELATED);
// create note if search limit was exceeded; overwriting 'note' is intentional
if ($spells->getMatches() > $AoWoWconf['sqlLimit'])
if ($spells->getMatches() > SQL_LIMIT_DEFAULT)
{
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_spellsfound', $spells->getMatches(), $AoWoWconf['sqlLimit']);
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_spellsfound', $spells->getMatches(), SQL_LIMIT_DEFAULT);
$pageData['params']['_truncated'] = 1;
}

View File

@@ -16,6 +16,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($title->error)
$smarty->notFound(Lang::$game['title']);
/***********/
/* Infobox */
/***********/
$infobox = [];
if ($title->getField('side') == SIDE_ALLIANCE)
$infobox[] = Lang::$main['side'].Lang::$colon.'[span class=alliance-icon]'.Lang::$game['si'][SIDE_ALLIANCE].'[/span]';
@@ -30,17 +34,29 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($e = $title->getField('eventId'))
$infobox[] = Lang::$game['eventShort'].Lang::$colon.'[url=?event='.$e.']'.WorldEventList::getName($e).'[/url]';
/****************/
/* Main Content */
/****************/
$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' => [],
'buttons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => true
),
'page' => array(
'name' => $title->getHtmlizedName(),
'expansion' => Util::$expansionString[$title->getField('expansion')]
)
);
/**************/
/* Extra Tabs */
/**************/
if (!empty($title->sources[$_id]))
{
foreach ($title->sources[$_id] as $type => $entries)
@@ -98,6 +114,7 @@ $smarty->updatePageVars(array(
'type' => TYPE_TITLE,
'typeId' => $_id
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_TITLE, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main));
$smarty->assign('lvData', $pageData);

View File

@@ -50,16 +50,16 @@ todo 26: Listview - template: 'profile', id: 'characters', name: LANG.
29: Arena Teams..?
*/
$search = urlDecode(trim($pageParam));
$query = Util::sqlEscape(str_replace('?', '_', str_replace('*', '%', ($search))), true);
$type = @intVal($_GET['type']);
$searchMask = 0x0;
$found = [];
$jsGlobals = [];
$maxResults = 500; // todo: move to config
$search = urlDecode(trim($pageParam));
$query = Util::sqlEscape(str_replace('?', '_', str_replace('*', '%', ($search))), true);
$type = @intVal($_GET['type']);
$searchMask = 0x0;
$found = [];
$jsGlobals = [];
$maxResults = SQL_LIMIT_SEARCH;
$_wt = isset($_GET['wt']) ? explode(':', $_GET['wt']) : null;
$_wtv = isset($_GET['wtv']) ? explode(':', $_GET['wtv']) : null;
$_wt = isset($_GET['wt']) ? explode(':', $_GET['wt']) : null;
$_wtv = isset($_GET['wtv']) ? explode(':', $_GET['wtv']) : null;
if (isset($_GET['json']))
{
@@ -331,12 +331,12 @@ if ($searchMask & 0x40)
if (($searchMask & SEARCH_TYPE_JSON) && $type == TYPE_ITEMSET && isset($found['itemset']))
{
$conditions = [['i.id', array_keys($found['itemset']['pcsToSet'])], 0];
$conditions = [['i.id', array_keys($found['itemset']['pcsToSet'])], SQL_LIMIT_NONE];
$miscData = ['pcsToSet' => @$found['itemset']['pcsToSet']];
}
else if (($searchMask & SEARCH_TYPE_JSON) && $type == TYPE_ITEM)
{
$conditions = [['i.class', [ITEM_CLASS_WEAPON, ITEM_CLASS_GEM, ITEM_CLASS_ARMOR]], ['name_loc'.User::$localeId, $query], $AoWoWconf['sqlLimit']];
$conditions = [['i.class', [ITEM_CLASS_WEAPON, ITEM_CLASS_GEM, ITEM_CLASS_ARMOR]], ['name_loc'.User::$localeId, $query], SQL_LIMIT_DEFAULT];
$miscData = ['wt' => $_wt, 'wtv' => $_wtv];
}
else

View File

@@ -67,8 +67,8 @@
$WH.ge('h1-icon-generic').appendChild(Icon.create('{$lvData.page.iconname|escape:"javascript"}', 1));
//]]></script>
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: {$page.type}, typeId: {$page.typeId}, linkColor: 'ffffff00', linkId: '{$page.typeId}:&quot;..UnitGUID(&quot;player&quot;)..&quot;:0:0:0:0:0:0:0:0', linkName: '{$lvData.page.name|escape:'javascript'}' {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
<a href="{$wowhead}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
{include file='bricks/redButtons.tpl'}
<h1 class="h1-icon">{$lvData.page.name}</h1>
{$lvData.page.description}

View File

@@ -0,0 +1,61 @@
{*
found this button(?) in item.tpl .. no script, data or style found for this id
<div id="sdlkgnfdlkgndfg4"></div>
*}
{if isset($redButtons[$smarty.const.BUTTON_LINKS])}
{assign var='b' value=$redButtons[$smarty.const.BUTTON_LINKS]}
{if $b}
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} {if isset($b.color)}linkColor: '{$b.color}', {/if}{if isset($b.linkId)}linkId: '{$b.linkId}', {/if}{if isset($b.name)}linkName: '{$lvData.page.name|escape:"javascript"}', {/if}type: {$page.type}, typeId: {$page.typeId} {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
{else}
<a href="javascript:;" id="open-links-button" class="button-red button-red-disabled"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
{/if}
{/if}
{if isset($redButtons[$smarty.const.BUTTON_WOWHEAD])}
{assign var='b' value=$redButtons[$smarty.const.BUTTON_WOWHEAD]}
{if $b}
<a href="{$wowhead}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
{else}
<a href="javascript:;" class="button-red button-red-disabled"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
{/if}
{/if}
{if isset($redButtons[$smarty.const.BUTTON_VIEW3D])}
{assign var='b' value=$redButtons[$smarty.const.BUTTON_VIEW3D]}
{if $b}
<a href="javascript:;" id="view3D-button" class="button-red" onclick="this.blur(); ModelViewer.show({ldelim} {foreach from=$b name=i key=k item=v}{$k}: {$v|@json_encode:$smarty.const.JSON_NUMERIC_CHECK}{if $smarty.foreach.i.last}{else}, {/if}{/foreach} {rdelim})"><em><b><i>{$lang.view3D}</i></b><span>{$lang.view3D}</span></em></a>
{else}
<a href="javascript:;" id="view3D-button" class="button-red button-red-disabled"><em><b><i>{$lang.view3D}</i></b><span>{$lang.view3D}</span></em></a>
{/if}
{/if}
{if isset($redButtons[$smarty.const.BUTTON_COMPARE])}
{assign var='b' value=$redButtons[$smarty.const.BUTTON_COMPARE]}
{if $b}
<a href="javascript:;" class="button-red" onclick="this.blur(); su_addToSaved('{if isset($b.eqList)}{$b.eqList}{else}{$page.typeId}{/if}', {if isset($b.qty)}{$b.qty}{else}1{/if})"><em><b><i>{$lang.compare}</i></b><span>{$lang.compare}</span></em></a>
{else}
<a href="javascript:;" class="button-red button-red-disabled"><em><b><i>{$lang.compare}</i></b><span>{$lang.compare}</span></em></a>
{/if}
{/if}
{if isset($redButtons[$smarty.const.BUTTON_UPGRADE])}
{assign var='b' value=$redButtons[$smarty.const.BUTTON_UPGRADE]}
{if $b}
<a href="javascript:;" class="button-red" onclick="this.blur(); pr_showClassPresetMenu(this, {$page.typeId}, {$b.class}, {$b.slot}, event);"><em><b><i>{$lang.findUpgrades}</i></b><span>{$lang.findUpgrades}</span></em></a>
{else}
<a href="javascript:;" class="button-red button-red-disabled"><em><b><i>{$lang.findUpgrades}</i></b><span>{$lang.findUpgrades}</span></em></a>
{/if}
{/if}
{if isset($redButtons[$smarty.const.BUTTON_TALENT])}
{assign var='b' value=$redButtons[$smarty.const.BUTTON_TALENT]}
{if $b}
<a href="{$b.href}" class="button-red"><em><b><i>{if $b.pet}{$lang.petCalc}{else}{$lang.talentCalc}{/if}</i></b><span>{if $b.pet}{$lang.petCalc}{else}{$lang.talentCalc}{/if}</span></em></a>
{else}
<a href="javascript:;" class="button-red button-red-disabled"><em><b><i>{if $b.pet}{$lang.petCalc}{else}{$lang.talentCalc}{/if}</i></b><span>{if $b.pet}{$lang.petCalc}{else}{$lang.talentCalc}{/if}</span></em></a>
{/if}
{/if}
{if isset($redButtons[$smarty.const.BUTTON_FORUM])}
{assign var='b' value=$redButtons[$smarty.const.BUTTON_FORUM]}
{if $b}
<a href="{$b.href}" class="button-red"><em><b><i>{$lang.forum}</i></b><span>{$lang.forum}</span></em></a>
{else}
<a href="javascript:;" class="button-red button-red-disabled"><em><b><i>{$lang.forum}</i></b><span>{$lang.forum}</span></em></a>
{/if}
{/if}

View File

@@ -23,10 +23,9 @@
<script type="text/javascript">
$WH.ge('headicon-generic').appendChild(Icon.create('{$lvData.page.icon}', 1));
</script>
<a href="{$wowhead}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: {$page.type}, typeId: {$page.typeId} {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
<a href="?talent#{$lvData.page.talentCalc}" class="button-red"><em><b><i>{$lang.talentCalc}</i></b><span>{$lang.talentCalc}</span></em></a>
<a href="{if !empty($page.boardUrl)}{$page.boardUrl}{else}javascript:;{/if}" class="button-red{if empty($page.boardUrl)} button-red-disabled{/if}"><em><b><i>{$lang.forum}</i></b><span>{$lang.forum}</span></em></a>
{include file='bricks/redButtons.tpl'}
<h1 class="h1-icon">{if $lvData.page.expansion}<span class="{$lvData.page.expansion}-icon-right">{$lvData.page.name}</span>{else}{$lvData.page.name}{/if}</h1>
{include file='bricks/article.tpl'}

View File

@@ -19,12 +19,9 @@
{include file='bricks/infobox.tpl' info=$lvData.infobox}
<div class="text">
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: {$page.type}, typeId: {$page.typeId}, linkColor: 'ff{$lvData.page.color}', linkId: 'item:{$page.typeId}:0:0:0:0:0:0:0:0', linkName: '{$lvData.page.name|escape:"javascript"}' {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
<a href="javascript:;" id="view3D-button" class="button-red{if $lvData.page.displayId}" onclick="this.blur(); ModelViewer.show({ldelim} type: {$page.type}, typeId: {$page.typeId}, displayId: {$lvData.page.displayId}, slot: {$lvData.page.slot} {rdelim}){else} button-red-disabled{/if}"><em><b><i>{$lang.view3D}</i></b><span>{$lang.view3D}</span></em></a>
<a href="javascript:;" class="button-red{if $lvData.buttons}" onclick="this.blur(); su_addToSaved('{$page.typeId}', 1){else} button-red-disabled{/if}"><em><b><i>{$lang.compare}</i></b><span>{$lang.compare}</span></em></a>
<a href="javascript:;" class="button-red{if $lvData.buttons}" onclick="this.blur(); pr_showClassPresetMenu(this, {$page.typeId}, {$lvData.page.class}, {$lvData.page.slot}, event);{else} button-red-disabled{/if}"><em><b><i>{$lang.findUpgrades}</i></b><span>{$lang.findUpgrades}</span></em></a>
<a href="{$wowhead}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
{* <div id="sdlkgnfdlkgndfg4"></div> what the heck.. this div has neither data nor style or script associated with *}
{include file='bricks/redButtons.tpl'}
<h1>{$lvData.page.name}</h1>
{include file='bricks/tooltip.tpl'}

View File

@@ -19,10 +19,9 @@
{include file='bricks/infobox.tpl' info=$lvData.infobox}
<div class="text">
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: {$page.type}, typeId: {$page.typeId} {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
<a href="javascript:;" id="view3D-button" class="button-red" onclick="this.blur(); ModelViewer.show({ldelim} type: {$page.type}, typeId: {$page.typeId}, equipList: {$lvData.view3D} {rdelim})"><em><b><i>{$lang.view3D}</i></b><span>{$lang.view3D}</span></em></a>
<a href="javascript:;" class="button-red" onclick="this.blur(); su_addToSaved('{':'|implode:$lvData.compare.items}', {$lvData.compare.qty})"><em><b><i>{$lang.compare}</i></b><span>{$lang.compare}</span></em></a>
<a href="{if $page.typeId > 0}{$wowhead}{else}javascript:;{/if}" class="button-red{if $lvData.page.id < 0} button-red-disabled{/if}"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
{include file='bricks/redButtons.tpl'}
<h1>{$lvData.page.name}</h1>
{include file='bricks/article.tpl'}

View File

@@ -1039,7 +1039,7 @@ function g_getMoneyHtml(money, side, costItems, costCurrency, achievementPoints)
html += '<a href="?currency=' + currencyId + '" class="moneyarena tip" onmouseover="Listview.funcBox.moneyArenaOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">' + $WH.number_format(count) + '</a>';
}
else if (currencyId == 104) { // honor
html += '<a href="?currency=' + currencyId + '" class="money' + (side == 1 ? 'alliance' : 'horde') + ' tip" onmouseover="Listview.funcBox.moneyHonorOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">' + $WH.number_format(count) + '</a>';
html += '<a href="?currency=' + currencyId + '" class="money' + (side == 1 ? 'alliance' : 'horde') + ' tip" onmouseover="Listview.funcBox.moneyHonorOver(event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">' + (side == 3 ? '<span class="moneyalliance">' : '') + $WH.number_format(count) + (side == 3 ? '</span>' : '') + '</a>';
}
else { // tokens
html += '<a href="?currency=' + currencyId + '" class="icontinyr tip q1" onmouseover="Listview.funcBox.moneyCurrencyOver(' + currencyId + ', ' + count + ', event)" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()" style="background-image: url(' + g_staticUrl + '/images/icons/tiny/' + icon[0].toLowerCase() + '.gif)">' + count + '</a>';
@@ -5981,6 +5981,70 @@ Listview.funcBox = {
}
},
initSpellFilter: function (row) {
if (this._spellTypes == null) {
this._spellTypes = {};
}
if (this._spellTypes[row.cat] == null) {
this._spellTypes[row.cat] = 0;
}
this._spellTypes[row.cat]++;
},
addSpellIndicator: function () {
var it = location.hash.match(/:type=([^:]+)/);
var f = function (spellCat, updatePound) {
g_setSelectedLink(this, "spellType");
lv.customPound = lv.id + (spellCat != null ? ":type=" + spellCat : "");
lv.customFilter = function (spell) {
return spellCat == null || spell.cat == spellCat;
};
lv.updateFilters(1);
lv.applySort();
lv.refreshRows();
if (updatePound) {
lv.updatePound(1)
}
};
var
lv = this,
categories = [],
a;
a = $("<a><span>" + LANG.pr_note_all + "</span></a>");
a[0].f = f.bind(a[0], null, 1);
a.click(a[0].f);
var firstCallback = f.bind(a[0], null, 0);
firstCallback();
categories.push($('<span class="indicator-mode"></span>').append(a).append($("<b>" + LANG.pr_note_all + "</b>")));
for (var i in g_spell_categories) {
if (!this._spellTypes[i]) {
continue;
}
a = $("<a><span>" + g_spell_categories[i] + "</span> (" + this._spellTypes[i] + ")</a>");
a[0].f = f.bind(a[0], i, 1);
a.click(a[0].f);
categories.push($('<span class="indicator-mode"></span>').append(a).append($("<b>" + g_spell_categories[i] + " (" + this._spellTypes[i] + ")</b>")));
if (it && it[1] == i) {
(a[0].f)();
}
}
if (categories.length > 2) {
for (var i = 0, len = categories.length; i < len; ++i) {
this.createIndicator(categories[i], null, $("a", categories[i])[0].f)
}
$(this.noteTop).css("padding-bottom", "12px");
$(this.noteIndicators).append($('<div class="clear"></div>')).insertAfter($(this.navTop))
}
},
initStatisticFilter: function(row)
{
if(this._achievTypes == null)

View File

@@ -19,9 +19,9 @@
{include file='bricks/infobox.tpl' info=$lvData.infobox}
<div class="text">
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: {$page.type}, typeId: {$page.typeId} {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
<a href="?petcalc#{$lvData.page.petCalc}" class="button-red"><em><b><i>{$lang.petCalc}</i></b><span>{$lang.petCalc}</span></em></a>
<a href="{$wowhead}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
{include file='bricks/redButtons.tpl'}
<div id="h1-icon-generic" class="h1-icon"></div>
<script type="text/javascript">//<![CDATA[

View File

@@ -26,8 +26,8 @@
$WH.ge('race-icon-female').appendChild(Icon.create('race_{$lvData.page.icon}_female', 1));
</script>
<a href="{$wowhead}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: {$page.type}, typeId: {$page.typeId} {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
{include file='bricks/redButtons.tpl'}
<h1 class="h1-icon">{if $lvData.page.expansion}<span class="{$lvData.page.expansion}-icon-right">{$lvData.page.name}</span>{else}{$lvData.page.name}{/if}</h1>
{include file='bricks/article.tpl'}

View File

@@ -25,8 +25,8 @@
$WH.ge('h1-icon-generic').appendChild(Icon.create('{$lvData.page.icon|escape:"javascript"}', 1));
//]]></script>
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: {$page.type}, typeId: {$page.typeId} {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
<a href="{$wowhead}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
{include file='bricks/redButtons.tpl'}
<h1 class="h1-icon">{$lvData.page.name}</h1>
{include file='bricks/article.tpl'}

View File

@@ -1,6 +1,4 @@
{include file='header.tpl'}
{assign var="iconlist1" value="1"}
{assign var="iconlist2" value="1"}
<div class="main" id="main">
<div id="main-precontents" class="main-precontents"></div>
@@ -21,27 +19,19 @@
{include file='bricks/infobox.tpl' info=$lvData.infobox}
<div class="text">
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: {$page.type}, typeId: {$page.typeId}, linkColor: 'ff71d5ff', linkId: 'spell:{$page.typeId}', linkName: '{$lvData.page.name}' {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
<a href="javascript:;" id="view3D-button" class="button-red{if $lvData.view3D}" onclick="this.blur(); ModelViewer.show({ldelim} type: 1, displayId: {$lvData.view3D} {rdelim}){else} button-red-disabled{/if}"><em><b><i>View in 3D</i></b><span>View in 3D</span></em></a>
<a href="{$wowhead}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
{include file='bricks/redButtons.tpl'}
<h1>{$lvData.page.name}</h1>
{include file='bricks/tooltip.tpl'}
{if $lvData.page.reagents}{if $lvData.page.tools}<div style="float: left; margin-right: 75px">{/if}
<h3>{$lang.reagents}</h3>
<table class="iconlist">
{section name=i loop=$lvData.page.reagents}
<tr><th align="right" id="iconlist-icon{$iconlist1++}"></th><td><span class="q{$lvData.page.reagents[i].quality}"><a href="?item={$lvData.page.reagents[i].entry}">{$lvData.page.reagents[i].name}</a></span>{if $lvData.page.reagents[i].count > 1}&nbsp({$lvData.page.reagents[i].count}){/if}</td></tr>
{/section}
</table>
<script type="text/javascript">
{section name=i loop=$lvData.page.reagents}
$WH.ge('iconlist-icon{$iconlist2++}').appendChild(g_items.createIcon({$lvData.page.reagents[i].entry}, 0, {$lvData.page.reagents[i].count}));
{/section}
</script>
{if $lvData.page.tools}</div>{/if}{/if}
{if $lvData.page.tools}{if $lvData.page.reagents}<div style="float: left">{/if}
{if $lvData.page.reagents}
{if $lvData.page.tools}<div style="float: left; margin-right: 75px">{/if}
{include file='bricks/reagentList.tpl' reagent=$lvData.page.reagents}
{if $lvData.page.tools}</div>{/if}
{/if}
{if $lvData.page.tools}
{if $lvData.page.reagents}<div style="float: left">{/if}
<h3>{$lang.tools}</h3>
<table class="iconlist">
{section name=i loop=$lvData.page.tools}
@@ -53,7 +43,8 @@
$WH.ge('iconlist-icon{$iconlist2++}').appendChild(g_items.createIcon({$lvData.page.tools[i].itemId}, 0, 1));
{/if}{/section}
</script>
{if $lvData.page.reagents}</div>{/if}{/if}
{if $lvData.page.reagents}</div>{/if}{
/if}
<div class="clear"></div>

View File

@@ -19,8 +19,9 @@
{include file='bricks/infobox.tpl' info=$lvData.infobox}
<div class="text">
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: {$page.type}, typeId: {$page.typeId} {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
<a href="{$wowhead}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
{include file='bricks/redButtons.tpl'}
<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>
{include file='bricks/article.tpl'}