detail page for events (with not much in it)

detail and listview for NPCs (without spawns, spells and some filters)
forcing the template to be more generic

- noticed, that the loot display is off. It happens with different modes
  on a creature, that has the same loot but different chances or quantities
  ... analyzing
This commit is contained in:
Sarjuuk
2014-02-08 12:09:48 +01:00
parent 99642e4ea4
commit 819a46ae15
85 changed files with 2942 additions and 1934 deletions

View File

@@ -161,6 +161,9 @@ define('OBJECT_CU_STEALTHED', 0x20);
define('OBJECT_CU_CASTER_GROUPED', 0x40); define('OBJECT_CU_CASTER_GROUPED', 0x40);
define('OBJECT_CU_NOT_PERSISTANT', 0x80); define('OBJECT_CU_NOT_PERSISTANT', 0x80);
define('NPC_CU_INSTANCE_BOSS', 0x01);
define('NPC_CU_DIFFICULTY_DUMMY', 0x02);
define('MAX_LEVEL', 80); define('MAX_LEVEL', 80);
// Loot handles // Loot handles
@@ -325,6 +328,25 @@ define('LOCK_PROPERTY_MINING', 3);
define('NPC_TYPEFLAG_HERBLOOT', 0x0100); define('NPC_TYPEFLAG_HERBLOOT', 0x0100);
define('NPC_TYPEFLAG_MININGLOOT', 0x0200); define('NPC_TYPEFLAG_MININGLOOT', 0x0200);
define('NPC_TYPEFLAG_ENGINEERLOOT', 0x8000); define('NPC_TYPEFLAG_ENGINEERLOOT', 0x8000);
define('NPC_TYPEFLAG_SPECIALLOOT', 0x8300);
define('NPC_RANK_NORMAL', 0);
define('NPC_RANK_ELITE', 1);
define('NPC_RANK_RARE_ELITE', 2);
define('NPC_RANK_BOSS', 3);
define('NPC_RANK_RARE', 4);
define('NPC_FLAG_TRAINER', 0x00000010);
define('NPC_FLAG_CLASS_TRAINER', 0x00000020);
define('NPC_FLAG_VENDOR', 0x00000080);
define('NPC_FLAG_REPAIRER', 0x00001000);
define('NPC_FLAG_FLIGHT_MASTER', 0x00002000);
define('NPC_FLAG_INNKEEPER', 0x00010000);
define('NPC_FLAG_BANKER', 0x00020000);
define('NPC_FLAG_GUILD_MASTER', 0x00080000);
define('NPC_FLAG_BATTLEMASTER', 0x00100000);
define('NPC_FLAG_AUCTIONEER', 0x00200000);
define('NPC_FLAG_STABLE_MASTER', 0x00400000);
// GameObject // GameObject
define('OBJECT_DOOR', 0); define('OBJECT_DOOR', 0);

View File

@@ -22,6 +22,7 @@ require 'includes/libs/Smarty-2.6.26/libs/Smarty.class.php';// Libraray: http://
// require 'includes/libs/Smarty-3.1.14/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/
require 'includes/libs/DbSimple/Generic.php'; // Libraray: http://en.dklab.ru/lib/DbSimple (using mysqli variant: https://bitbucket.org/brainreaver/dbsimple/src) require 'includes/libs/DbSimple/Generic.php'; // Libraray: http://en.dklab.ru/lib/DbSimple (using mysqli variant: https://bitbucket.org/brainreaver/dbsimple/src)
require 'includes/utilities.php'; require 'includes/utilities.php';
require 'localization/lang.class.php';
require 'includes/user.class.php'; require 'includes/user.class.php';
require 'includes/database.class.php'; require 'includes/database.class.php';
@@ -94,7 +95,6 @@ User::assignUserToTemplate($smarty, true);
// parse page-parameters .. sanitize before use! // parse page-parameters .. sanitize before use!
@list($str, $trash) = explode('&', $_SERVER['QUERY_STRING'], 2); @list($str, $trash) = explode('&', $_SERVER['QUERY_STRING'], 2);
@list($pageCall, $pageParam) = explode('=', $str, 2); @list($pageCall, $pageParam) = explode('=', $str, 2);
$smarty->assign('query', [$pageCall, $pageParam]);
$smarty->assign('wowhead', 'http://'.Util::$subDomains[User::$localeId].'.wowhead.com/'.$str); $smarty->assign('wowhead', 'http://'.Util::$subDomains[User::$localeId].'.wowhead.com/'.$str);
?> ?>

View File

@@ -168,22 +168,22 @@ class AchievementList extends BaseType
} }
if ($crt['completionFlags'] & ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER) if ($crt['completionFlags'] & ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER)
$criteria .= '- '.htmlspecialchars($crtName).' <span class="moneygold">'.number_format($crt['value2' ] / 10000).'</span><br />'; $criteria .= '- '.Util::jsEscape($crtName).' <span class="moneygold">'.number_format($crt['value2' ] / 10000).'</span><br />';
else else
$criteria .= '- '.htmlspecialchars($crtName).'<br />'; $criteria .= '- '.Util::jsEscape($crtName).'<br />';
if (++$i == round(count($rows)/2)) if (++$i == round(count($rows)/2))
$criteria .= '</small></td><th class="q0" style="white-space: nowrap; text-align: left"><small>'; $criteria .= '</small></td><th class="q0" style="white-space: nowrap; text-align: left"><small>';
} }
$x = '<table><tr><td><b class="q">'; $x = '<table><tr><td><b class="q">';
$x .= Util::jsEscape(htmlspecialchars($name)); $x .= Util::jsEscape($name);
$x .= '</b></td></tr></table>'; $x .= '</b></td></tr></table>';
if ($description || $criteria) if ($description || $criteria)
$x .= '<table><tr><td>'; $x .= '<table><tr><td>';
if ($description) if ($description)
$x .= '<br />'.Util::jsEscape(htmlspecialchars($description)).'<br />'; $x .= '<br />'.Util::jsEscape($description).'<br />';
if ($criteria) if ($criteria)
{ {

View File

@@ -20,11 +20,12 @@ abstract class BaseType
/* /*
* condition as array [expression, value, operator] * condition as array [expression, value, operator]
* expression: str - must match fieldname; * expression: str - must match fieldname;
* int - impl. 1: select everything * int - 1: select everything; 0: select nothing
* array - another condition array * array - another condition array
* value: str - operator defaults to: LIKE %<val>% * value: str - operator defaults to: LIKE %<val>%
* int - operator defaults to: = <val> * int - operator defaults to: = <val>
* array - operator defaults to: IN (<val>) * array - operator defaults to: IN (<val>)
* null - operator defaults to: IS [NULL]
* operator: modifies/overrides default * operator: modifies/overrides default
* ! - negated default value (NOT LIKE; <>; NOT IN) * ! - negated default value (NOT LIKE; <>; NOT IN)
* condition as str * condition as str
@@ -41,12 +42,13 @@ abstract class BaseType
* ['flags', 0xFF, '&'], * ['flags', 0xFF, '&'],
* ['flags2', 0xF, '&'], * ['flags2', 0xF, '&'],
* ] * ]
* [['mask', 0x3, '&'], 0] * [['mask', 0x3, '&'], 0],
* ['joinedTbl.field', NULL] // NULL must be explicitly specified "['joinedTbl.field']" would be skipped as erronous definition (only really usefull when left-joining)
* 'OR', * 'OR',
* 5 * 5
* ) * )
* results in * results in
* WHERE ((`id` = 45) OR (`name` NOT LIKE "%test%") OR ((`flags` & 255) AND (`flags2` & 15)) OR ((`mask` & 3) = 0)) LIMIT 5 * WHERE ((`id` = 45) OR (`name` NOT LIKE "%test%") OR ((`flags` & 255) AND (`flags2` & 15)) OR ((`mask` & 3) = 0)) OR (`joinedTbl`.`field` IS NULL) LIMIT 5
*/ */
public function __construct($conditions = [], $applyFilter = false) public function __construct($conditions = [], $applyFilter = false)
{ {
@@ -175,6 +177,11 @@ abstract class BaseType
$op = (isset($c[2]) && $c[2] == '!') ? 'NOT LIKE' : 'LIKE'; $op = (isset($c[2]) && $c[2] == '!') ? 'NOT LIKE' : 'LIKE';
$val = $val === '' ? '""' : '"%'.$val.'%"'; $val = $val === '' ? '""' : '"%'.$val.'%"';
} }
else if (count($c) > 1 && $c[1] === null) // specifficly check for NULL
{
$op = (isset($c[2]) && $c[2] == '!') ? 'IS NOT' : 'IS';
$val = 'NULL';
}
else // null for example else // null for example
return null; return null;
@@ -578,7 +585,7 @@ abstract class Filter
$tmp = []; $tmp = [];
foreach (array_merge($this->fiData['c'], $this->fiData['v']) as $k => $v) foreach (array_merge($this->fiData['c'], $this->fiData['v']) as $k => $v)
{ {
if ($v == '') if ($v === '')
continue; continue;
else if (is_array($v)) else if (is_array($v))
$tmp[$k] = $k."=".implode(':', $v); $tmp[$k] = $k."=".implode(':', $v);

View File

@@ -13,9 +13,16 @@ class CreatureList extends BaseType
public $tooltips = []; public $tooltips = [];
protected $queryBase = 'SELECT ct.*, ct.id AS ARRAY_KEY FROM ?_creature ct'; protected $queryBase = 'SELECT ct.*, ct.id AS ARRAY_KEY FROM ?_creature ct';
protected $queryOpts = array( public $queryOpts = array(
'ct' => [['ft']], 'ct' => [['ft', 'clsMin', 'clsMax', 'qr']],
'ft' => ['j' => '?_factiontemplate ft ON ft.id = ct.factionA', 's' => ', ft.A, ft.H, ft.factionId'] 'ft' => ['j' => '?_factiontemplate ft ON ft.id = ct.factionA', 's' => ', ft.*'],
'clsMin' => ['j' => 'creature_classlevelstats clsMin ON ct.unitClass = clsMin.class AND ct.minLevel = clsMin.level', 's' => ', CASE ct.exp WHEN 0 THEN clsMin.basehp0 * healthMod WHEN 1 THEN clsMin.basehp1 * healthMod ELSE clsMin.basehp2 * healthMod END AS healthMin, clsMin.baseMana * manaMod AS manaMin'],
'clsMax' => ['j' => 'creature_classlevelstats clsMax ON ct.unitClass = clsMax.class AND ct.maxLevel = clsMax.level', 's' => ', CASE ct.exp WHEN 0 THEN clsMax.basehp0 * healthMod WHEN 1 THEN clsMax.basehp1 * healthMod ELSE clsMax.basehp2 * healthMod END AS healthMax, clsMax.baseMana * manaMod AS manaMax'],
'qr' => ['j' => ['creature_questrelation qr ON qr.id = ct.id', true], 's' => ', qr.quest', 'g' => 'ct.id'], // start
'ir' => ['j' => ['creature_involvedrelation ir ON ir.id = ct.id', true]], // end
'qtqr' => ['j' => 'quest_template qtqr ON qr.quest = qtqr.id'],
'qtir' => ['j' => 'quest_template qtir ON ir.quest = qtir.id'],
'rep' => ['j' => ['creature_onkill_reputation rep ON rep.creature_id = ct.id', true]]
); );
public static function getName($id) public static function getName($id)
@@ -48,15 +55,16 @@ class CreatureList extends BaseType
$type = $this->curTpl['type']; $type = $this->curTpl['type'];
$row3 = [Lang::$game['level']]; $row3 = [Lang::$game['level']];
$fam = $this->curTpl['family']; $fam = $this->curTpl['family'];
// todo (low): rework, when factions are implemented
$fac = DB::Aowow()->selectRow('SELECT * FROM dbc.faction f JOIN dbc.factionTemplate ft ON f.id = ft.factionId WHERE ft.id = ?d AND NOT f.reputationFlags1 & 0x4 AND f.reputationIndex <> -1', $this->curTpl['factionA']);
if (!($this->curTpl['typeFlags'] & 0x4)) if (!($this->curTpl['typeFlags'] & 0x4))
{ {
$level = $this->curTpl['minlevel']; $level = $this->curTpl['minLevel'];
if ($level != $this->curTpl['maxlevel']) if ($level != $this->curTpl['maxLevel'])
$level .= ' - '.$this->curTpl['maxlevel']; $level .= ' - '.$this->curTpl['maxLevel'];
} }
else
$level = '??';
$row3[] = $level; $row3[] = $level;
if ($type) if ($type)
@@ -75,8 +83,9 @@ class CreatureList extends BaseType
if ($type == 1 && $fam) // 1: Beast if ($type == 1 && $fam) // 1: Beast
$x .= '<tr><td>'.Lang::$game['fa'][$fam].'</td></tr>'; $x .= '<tr><td>'.Lang::$game['fa'][$fam].'</td></tr>';
if ($fac) // todo (low): exclude not displayed factions
$x .= '<tr><td>'.Util::localizedString($fac, 'name').'</td></tr>'; if ($f = FactionList::getName($this->getField('factionId')))
$x .= '<tr><td>'.$f.'</td></tr>';
$x .= '</table>'; $x .= '</table>';
@@ -125,19 +134,19 @@ class CreatureList extends BaseType
if (isset($data[$texStr])) if (isset($data[$texStr]))
{ {
if ($data[$texStr]['minlevel'] > $this->curTpl['minlevel']) if ($data[$texStr]['minlevel'] > $this->curTpl['minLevel'])
$data[$texStr]['minlevel'] = $this->curTpl['minlevel']; $data[$texStr]['minlevel'] = $this->curTpl['minLevel'];
if ($data[$texStr]['maxlevel'] < $this->curTpl['maxlevel']) if ($data[$texStr]['maxlevel'] < $this->curTpl['maxLevel'])
$data[$texStr]['maxlevel'] = $this->curTpl['maxlevel']; $data[$texStr]['maxlevel'] = $this->curTpl['maxLevel'];
$data[$texStr]['count']++; $data[$texStr]['count']++;
} }
else else
$data[$texStr] = array( $data[$texStr] = array(
'family' => $this->curTpl['family'], 'family' => $this->curTpl['family'],
'minlevel' => $this->curTpl['minlevel'], 'minlevel' => $this->curTpl['minLevel'],
'maxlevel' => $this->curTpl['maxlevel'], 'maxlevel' => $this->curTpl['maxLevel'],
'modelId' => $this->curTpl['modelId'], 'modelId' => $this->curTpl['modelId'],
'displayId' => $this->curTpl['displayId1'], 'displayId' => $this->curTpl['displayId1'],
'skin' => $texStr, 'skin' => $texStr,
@@ -147,18 +156,21 @@ class CreatureList extends BaseType
else else
{ {
$data[$this->id] = array( $data[$this->id] = array(
'family' => $this->curTpl['family'], 'family' => $this->curTpl['family'],
'minlevel' => $this->curTpl['minlevel'], 'minlevel' => $this->curTpl['minLevel'],
'maxlevel' => $this->curTpl['maxlevel'], 'maxlevel' => $this->curTpl['maxLevel'],
'id' => $this->id, 'id' => $this->id,
'boss' => $this->curTpl['typeFlags'] & 0x4 ? 1 : 0, 'boss' => $this->curTpl['typeFlags'] & 0x4 ? 1 : 0,
'rank' => $this->curTpl['rank'], // classification(?) 'classification' => $this->curTpl['rank'],
'location' => $this->getSpawns(SPAWNINFO_ZONES), 'location' => $this->getSpawns(SPAWNINFO_ZONES),
'name' => $this->getField('name', true), 'name' => $this->getField('name', true),
'type' => $this->curTpl['type'], 'type' => $this->curTpl['type'],
'react' => '['.$this->curTpl['A'].', '.$this->curTpl['H'].']' 'react' => [$this->curTpl['A'], $this->curTpl['H']],
); );
if ($this->getField('quest'))
$data[$this->id]['hasQuests'] = 1;
if ($_ = $this->getField('subname', true)) if ($_ = $this->getField('subname', true))
$data[$this->id]['tag'] = $_; $data[$this->id]['tag'] = $_;
@@ -181,4 +193,287 @@ class CreatureList extends BaseType
} }
class CreatureListFilter extends Filter
{
protected $enums = array(
3 => array( 469, 1037, 1106, 529, 1012, 87, 21, 910, 609, 942, 909, 530, 69, 577, 930, 1068, 1104, 729, 369, 92, 54, 946, 67, 1052, 749,
47, 989, 1090, 1098, 978, 1011, 93, 1015, 1038, 76, 470, 349, 1031, 1077, 809, 911, 890, 970, 169, 730, 72, 70, 932, 1156, 933,
510, 1126, 1067, 1073, 509, 941, 1105, 990, 934, 935, 1094, 1119, 1124, 1064, 967, 1091, 59, 947, 81, 576, 922, 68, 1050, 1085, 889,
589, 270)
);
// cr => [type, field, misc, extraCol]
protected $genericFilter = array( // misc (bool): _NUMERIC => useFloat; _STRING => localized; _FLAG => match Value; _BOOLEAN => stringSet
5 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_REPAIRER ], // canrepair
9 => [FILTER_CR_BOOLEAN, 'lootId', ], // lootable
11 => [FILTER_CR_BOOLEAN, 'pickpocketLootId', ], // pickpocketable
18 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_AUCTIONEER ], // auctioneer
19 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_BANKER ], // banker
20 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_BATTLEMASTER ], // battlemaster
21 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_FLIGHT_MASTER ], // flightmaster
22 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_GUILD_MASTER ], // guildmaster
23 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_INNKEEPER ], // innkeeper
24 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_CLASS_TRAINER ], // talentunlearner
25 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_GUILD_MASTER ], // tabardvendor
27 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_STABLE_MASTER ], // stablemaster
28 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_TRAINER ], // trainer
29 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_VENDOR ], // vendor
19 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_BANKER ], // banker
37 => [FILTER_CR_NUMERIC, 'id', null, true], // id
35 => [FILTER_CR_STRING, 'textureString' ], // useskin
32 => [FILTER_CR_FLAG, 'cuFlags', NPC_CU_INSTANCE_BOSS ] // instanceboss
);
protected function createSQLForCriterium(&$cr)
{
if (in_array($cr[0], array_keys($this->genericFilter)))
{
if ($genCR = $this->genericCriterion($cr))
return $genCR;
unset($cr);
$this->error = true;
return [1];
}
switch ($cr[0])
{
case 1: // health [num]
if (!$this->isSaneNumeric($cr[2]) || !$this->int2Op($cr[1]))
break;
// remap OP for this special case
switch ($cr[1])
{
case '=': // min > max is totally possible
$this->parent->queryOpts['clsMin']['h'] = 'IF(healthMin > healthMax, healthMax, healthMin) <= '.$cr[2];
$this->parent->queryOpts['clsMax']['h'] = 'IF(healthMin > healthMax, healthMin, healthMax) >= '.$cr[2];
break;
case '>':
$this->parent->queryOpts['clsMin']['h'] = 'IF(healthMin > healthMax, healthMax, healthMin) > '.$cr[2];
break;
case '>=':
$this->parent->queryOpts['clsMin']['h'] = 'IF(healthMin > healthMax, healthMax, healthMin) >= '.$cr[2];
break;
case '<':
$this->parent->queryOpts['clsMax']['h'] = 'IF(healthMin > healthMax, healthMin, healthMax) < '.$cr[2];
break;
case '<=':
$this->parent->queryOpts['clsMax']['h'] = 'IF(healthMin > healthMax, healthMin, healthMax) <= '.$cr[2];
break;
}
return [1]; // always true, use post-filter
case 2: // mana [num]
if (!$this->isSaneNumeric($cr[2]) || !$this->int2Op($cr[1]))
break;
// remap OP for this special case
switch ($cr[1])
{
case '=':
$this->parent->queryOpts['clsMin']['h'] = 'IF(manaMin > manaMax, manaMax, manaMin) <= '.$cr[2];
$this->parent->queryOpts['clsMax']['h'] = 'IF(manaMin > manaMax, manaMin, manaMax) => '.$cr[2];
break;
case '>':
$this->parent->queryOpts['clsMax']['h'] = 'IF(manaMin > manaMax, manaMin, manaMax) > '.$cr[2];
break;
case '>=':
$this->parent->queryOpts['clsMax']['h'] = 'IF(manaMin > manaMax, manaMin, manaMax) >= '.$cr[2];
break;
case '<':
$this->parent->queryOpts['clsMin']['h'] = 'IF(manaMin > manaMax, manaMax, manaMin) < '.$cr[2];
break;
case '<=':
$this->parent->queryOpts['clsMin']['h'] = 'IF(manaMin > manaMax, manaMax, manaMin) <= '.$cr[2];
break;
}
return [1]; // always true, use post-filter
case 7: // startsquest [enum]
switch ($cr[1])
{
case 1: // any
return ['ir.quest', 0, '!'];
case 2: // alliance
return ['AND', ['ir.quest', 0, '!'], [['qtqr.RequiredRaces', RACE_MASK_HORDE, '&'], 0], ['qtqr.RequiredRaces', RACE_MASK_ALLIANCE, '&']];
case 3: // horde
return ['AND', ['ir.quest', 0, '!'], [['qtqr.RequiredRaces', RACE_MASK_ALLIANCE, '&'], 0], ['qtqr.RequiredRaces', RACE_MASK_HORDE, '&']];
case 4: // both
return ['AND', ['ir.quest', 0, '!'], ['OR', ['AND', ['qtqr.RequiredRaces', RACE_MASK_ALLIANCE, '&'], ['qtqr.RequiredRaces', RACE_MASK_HORDE, '&']], ['qtqr.RequiredRaces', 0]]];
case 5: // none
return ['ir.quest', NULL];
}
break;
case 8: // endsquest [enum]
switch ($cr[1])
{
case 1: // any
return ['qr.quest', 0, '!'];
case 2: // alliance
return ['AND', ['qr.quest', 0, '!'], [['qtqi.RequiredRaces', RACE_MASK_HORDE, '&'], 0], ['qtqi.RequiredRaces', RACE_MASK_ALLIANCE, '&']];
case 3: // horde
return ['AND', ['qr.quest', 0, '!'], [['qtqi.RequiredRaces', RACE_MASK_ALLIANCE, '&'], 0], ['qtqi.RequiredRaces', RACE_MASK_HORDE, '&']];
case 4: // both
return ['AND', ['qr.quest', 0, '!'], ['OR', ['AND', ['qtqi.RequiredRaces', RACE_MASK_ALLIANCE, '&'], ['qtqi.RequiredRaces', RACE_MASK_HORDE, '&']], ['qtqi.RequiredRaces', 0]]];
case 5: // none
return ['qr.quest', NULL];
}
break;
case 3: // faction [enum]
if (in_array($cr[1], $this->enums[$cr[0]]))
{
$facTpls = [];
$facs = new FactionList(array('OR', ['parentFactionId', $cr[1]], ['id', $cr[1]]));
foreach ($facs->iterate() as $__)
$facTpls = array_merge($facTpls, $facs->getField('templateIds'));
if (!$facTpls)
return [0];
return ['OR', ['factionA', $facTpls], ['factionH', $facTpls]];
}
break;
case 42: // increasesrepwith [enum]
if (in_array($cr[1], $this->enums[3])) // reuse
return ['OR', ['AND', ['rep.RewOnKillRepFaction1', $cr[1]], ['rep.RewOnKillRepValue1', 0, '>']], ['AND', ['rep.RewOnKillRepFaction2', $cr[1]], ['rep.RewOnKillRepValue2', 0, '>']]];
break;
case 43: // decreasesrepwith [enum]
if (in_array($cr[1], $this->enums[3])) // reuse
return ['OR', ['AND', ['rep.RewOnKillRepFaction1', $cr[1]], ['rep.RewOnKillRepValue1', 0, '<']], ['AND', ['rep.RewOnKillRepFaction2', $cr[1]], ['rep.RewOnKillRepValue2', 0, '<']]];
break;
case 12: // averagemoneydropped [op] [int]
if (!$this->isSaneNumeric($cr[2]) || !$this->int2Op($cr[1]))
break;
return ['AND', ['((minGold + maxGold) / 2)', $cr[2], $cr[1]]];
case 15: // gatherable [yn]
if ($this->int2Bool($cr[1]))
{
if ($cr[1])
return ['AND', ['skinLootId', 0, '>'], ['typeFlags', NPC_TYPEFLAG_HERBLOOT, '&']];
else
return ['OR', ['skinLootId', 0], [['typeFlags', NPC_TYPEFLAG_HERBLOOT, '&'], 0]];
}
break;
case 44: // salvageable [yn]
if ($this->int2Bool($cr[1]))
{
if ($cr[1])
return ['AND', ['skinLootId', 0, '>'], ['typeFlags', NPC_TYPEFLAG_ENGINEERLOOT, '&']];
else
return ['OR', ['skinLootId', 0], [['typeFlags', NPC_TYPEFLAG_ENGINEERLOOT, '&'], 0]];
}
break;
case 16: // minable [yn]
if ($this->int2Bool($cr[1]))
{
if ($cr[1])
return ['AND', ['skinLootId', 0, '>'], ['typeFlags', NPC_TYPEFLAG_MININGLOOT, '&']];
else
return ['OR', ['skinLootId', 0], [['typeFlags', NPC_TYPEFLAG_MININGLOOT, '&'], 0]];
}
break;
case 10: // skinnable [yn]
if ($this->int2Bool($cr[1]))
{
if ($cr[1])
return ['AND', ['skinLootId', 0, '>'], [['typeFlags', NPC_TYPEFLAG_SPECIALLOOT, '&'], 0]];
else
return ['OR', ['skinLootId', 0], [['typeFlags', NPC_TYPEFLAG_SPECIALLOOT, '&'], 0, '!']];
}
break;
case 6: // foundin [enum]
case 38: // relatedevent [enum]
case 34: // usemodel [str] // displayId -> id:creatureDisplayInfo.dbc/model -> id:cratureModelData.dbc/modelPath
case 33: // hascomments [yn]
case 31: // hasscreenshots [yn]
case 40: // hasvideos [yn]
case 41: // haslocation [yn] [staff]
/* todo */ return [1];
}
unset($cr);
$this->error = true;
return [1];
}
protected function createSQLForValues()
{
$parts = [];
$_v = &$this->fiData['v'];
// name [str]
if (isset($_v['na']))
{
if (isset($_v['ex']) && $_v['ex'] == 'on')
$parts[] = ['OR', ['name_loc'.User::$localeId, $_v['na']], ['subname_loc'.User::$localeId, $_v['na']]];
else
$parts[] = ['name_loc'.User::$localeId, $_v['na']];
}
// pet family [list]
if (isset($_v['fa']))
{
$_ = (array)$_v['fa'];
if (!array_diff($_, [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 20, 21, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 37, 38, 39, 41, 42, 43, 44, 45, 46]))
$parts[] = ['family', $_];
else
unset($_v['cl']);
}
// creatureLevel min [int]
if (isset($_v['minle']))
{
if (is_int($_v['minle']) && $_v['minle'] > 0)
$parts[] = ['minLevel', $_v['minle'], '>='];
else
unset($_v['minle']);
}
// creatureLevel max [int]
if (isset($_v['maxle']))
{
if (is_int($_v['maxle']) && $_v['maxle'] > 0)
$parts[] = ['maxLevel', $_v['maxle'], '<='];
else
unset($_v['maxle']);
}
// classification [list]
if (isset($_v['cl']))
{
$_ = (array)$_v['cl'];
if (!array_diff($_, [0, 1, 2, 3, 4]))
$parts[] = ['rank', $_];
else
unset($_v['cl']);
}
// react Alliance [int]
if (isset($_v['ra']))
{
$_ = (int)$_v['ra'];
if (in_array($_, [-1, 0, 1]))
$parts[] = ['ft.A', $_];
else
unset($_v['ra']);
}
// react Horde [int]
if (isset($_v['rh']))
{
$_ = (int)$_v['rh'];
if (in_array($_, [-1, 0, 1]))
$parts[] = ['ft.H', $_];
else
unset($_v['rh']);
}
return $parts;
}
}
?> ?>

View File

@@ -25,12 +25,10 @@ class FactionList extends BaseType
foreach ($this->iterate() as &$_curTpl) foreach ($this->iterate() as &$_curTpl)
{ {
// prepare factionTemplates // prepare factionTemplates
if ($_curTpl['templateIds']) $_curTpl['templateIds'] = $_curTpl['templateIds'] ? explode(' ', $_curTpl['templateIds']) : [];
$_curTpl['templateIds'] = explode(' ', $_curTpl['templateIds']);
// prepare quartermaster // prepare quartermaster
if ($_curTpl['qmNpcIds']) $_curTpl['qmNpcIds'] = $_curTpl['qmNpcIds'] ? explode(' ', $_curTpl['qmNpcIds']) : [];
$_curTpl['qmNpcIds'] = explode(' ', $_curTpl['qmNpcIds']);
} }
} }

View File

@@ -81,17 +81,20 @@ class ItemList extends BaseType
{ {
$ids = array_keys($this->templates); $ids = array_keys($this->templates);
$itemz = DB::Aowow()->select(' $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) 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.entry IN (?a) AND} nv.item IN (?a)
UNION 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)', 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 {JOIN creature c ON c.guid = genv.guid AND 1= ?d} WHERE {c.id IN (?a) AND} genv.item IN (?a)',
empty($filter[TYPE_NPC]) || !is_array($filter[TYPE_NPC]) ? DBSIMPLE_SKIP : $filter[TYPE_NPC],
$ids, $ids,
empty($filter[TYPE_NPC]) || !is_array($filter[TYPE_NPC]) ? DBSIMPLE_SKIP : 1,
empty($filter[TYPE_NPC]) || !is_array($filter[TYPE_NPC]) ? DBSIMPLE_SKIP : $filter[TYPE_NPC],
$ids $ids
); );
$cItems = []; $cItems = [];
foreach ($itemz as &$vendors) foreach ($itemz as $k => $vendors)
{ {
foreach ($vendors as $k => $costs) foreach ($vendors as $l => $costs)
{ {
$data = array( $data = array(
'stock' => $costs['maxcount'] ? $costs['maxcount'] : -1, 'stock' => $costs['maxcount'] ? $costs['maxcount'] : -1,
@@ -124,8 +127,10 @@ class ItemList extends BaseType
} }
} }
$vendors[$k] = $data; $vendors[$l] = $data;
} }
$itemz[$k] = $vendors;
} }
// convert items to currency if possible // convert items to currency if possible
@@ -134,9 +139,9 @@ class ItemList extends BaseType
$moneyItems = new CurrencyList(array(['itemId', $cItems])); $moneyItems = new CurrencyList(array(['itemId', $cItems]));
$moneyItems->addGlobalsToJscript(Util::$pageTemplate); $moneyItems->addGlobalsToJscript(Util::$pageTemplate);
foreach ($itemz as $id => &$vendors) foreach ($itemz as $id => $vendors)
{ {
foreach ($vendors as &$costs) foreach ($vendors as $l => $costs)
{ {
foreach ($costs as $k => $v) foreach ($costs as $k => $v)
{ {
@@ -158,7 +163,9 @@ class ItemList extends BaseType
Util::$pageTemplate->extendGlobalIds(TYPE_ITEM, $k); Util::$pageTemplate->extendGlobalIds(TYPE_ITEM, $k);
} }
} }
$vendors[$l] = $costs;
} }
$itemz[$id] = $vendors;
} }
} }
@@ -170,19 +177,12 @@ class ItemList extends BaseType
// apply filter if given // apply filter if given
$tok = @$filter[TYPE_ITEM]; $tok = @$filter[TYPE_ITEM];
$cur = @$filter[TYPE_CURRENCY]; $cur = @$filter[TYPE_CURRENCY];
$npc = @$filter[TYPE_NPC]; // bought at specific vendor
$reqRating = -1; $reqRating = -1;
foreach ($result as $itemId => $data) foreach ($result as $itemId => $data)
{ {
foreach ($data as $npcId => $costs) foreach ($data as $npcId => $costs)
{ {
if ($npc && $npcId != $npc)
{
unset($data[$npcId]);
continue;
}
if ($tok || $cur) // bought with specific token or currency if ($tok || $cur) // bought with specific token or currency
{ {
$valid = false; $valid = false;
@@ -269,7 +269,6 @@ class ItemList extends BaseType
$cost = @reset($this->getExtendedCost($miscData)[$this->id]); $cost = @reset($this->getExtendedCost($miscData)[$this->id]);
if ($cost) if ($cost)
{ {
$currency = []; $currency = [];
$tokens = []; $tokens = [];
foreach ($cost as $k => $qty) foreach ($cost as $k => $qty)
@@ -285,6 +284,17 @@ class ItemList extends BaseType
$data[$this->id]['stock'] = $cost['stock']; $data[$this->id]['stock'] = $cost['stock'];
$data[$this->id]['cost'] = [$this->getField('buyPrice')]; $data[$this->id]['cost'] = [$this->getField('buyPrice')];
if ($e = $cost['event'])
{
Util::$pageTemplate->extendGlobalIds(TYPE_WORLDEVENT, $e);
$data[$this->id]['condition'] = array(
'type' => TYPE_WORLDEVENT,
'typeId' => -$e,
'status' => 1
);
}
if ($currency || $tokens) // fill idx:3 if required if ($currency || $tokens) // fill idx:3 if required
$data[$this->id]['cost'][] = $currency; $data[$this->id]['cost'][] = $currency;
@@ -725,7 +735,7 @@ class ItemList extends BaseType
else if ($_reqLvl > 1) else if ($_reqLvl > 1)
$x .= sprintf(Lang::$game['reqLevel'], $_reqLvl).'<br />'; $x .= sprintf(Lang::$game['reqLevel'], $_reqLvl).'<br />';
// required arena team raing / perosnal rating / todo (low): sort out what kind of rating // required arena team rating / personal 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); $x .= sprintf(Lang::$item['reqRating'], $reqRating);

View File

@@ -75,7 +75,7 @@ class QuestList extends BaseType
quest_template q, quest_template q,
locales_quest l locales_quest l
WHERE WHERE
q.id = l.entry AND q.id = l.id AND
q.id = ?d', q.id = ?d',
$id $id
); );

View File

@@ -9,7 +9,10 @@ class WorldEventList extends BaseType
public static $type = TYPE_WORLDEVENT; public static $type = TYPE_WORLDEVENT;
protected $queryBase = 'SELECT *, -e.id AS ARRAY_KEY, -e.id as id FROM ?_events e'; protected $queryBase = 'SELECT *, -e.id AS ARRAY_KEY, -e.id as id FROM ?_events e';
protected $queryOpts = ['e' => ['j' => ['?_holidays h ON e.holidayId = h.id', true], 'o' => '-e.id ASC']]; protected $queryOpts = array(
'e' => ['j' => ['?_holidays h2 ON e.holidayId = h2.id', true], 'o' => '-e.id ASC'],
'h' => ['j' => ['?_holidays h ON e.holidayId = h.id']]
);
public function __construct($conditions = []) public function __construct($conditions = [])
{ {
@@ -73,49 +76,44 @@ class WorldEventList extends BaseType
return Util::localizedString($row, 'name'); return Util::localizedString($row, 'name');
} }
public static function updateDates($start, $end, $occurence, $final = 5000000000) // in the far far FAR future.. public static function updateDates($date = null)
{ {
if (!$start) if (!$date || empty($date['firstDate']) || empty($date['length']))
{ {
return array( return array(
'start' => 0, 'start' => 0,
'end' => 0, 'end' => 0,
'nextStart' => 0, 'rec' => 0
'nextEnd' => 0
); );
} }
// Convert everything to seconds // Convert everything to seconds
$start = intVal($start); $firstDate = intVal($date['firstDate']);
$end = intVal($end); $lastDate = !empty($date['lastDate']) ? intVal($date['lastDate']) : 5000000000; // in the far far FAR future..;
$occurence = intVal($occurence); $interval = !empty($date['rec']) ? intVal($date['rec']) : -1;
$final = intVal($final); $length = intVal($date['length']);
$now = time(); $curStart = $firstDate;
$year = date("Y", $now); $curEnd = $firstDate + $length;
$nextStart = $curStart + $interval;
$nextEnd = $curEnd + $interval;
$curStart = $start; while ($interval > 0 && $nextEnd <= $lastDate && $curEnd < time())
$curEnd = $end;
$nextStart = $curStart + $occurence;
$nextEnd = $curEnd + $occurence;
while ($nextEnd <= $final && date("Y", $nextEnd) <= $year && $curEnd <= $now)
{ {
$curStart = $nextStart; $curStart = $nextStart;
$curEnd = $nextEnd; $curEnd = $nextEnd;
$nextStart = $curStart + $occurence; $nextStart = $curStart + $interval;
$nextEnd = $curEnd + $occurence; $nextEnd = $curEnd + $interval;
} }
return array( return array(
'start' => $curStart, 'start' => $curStart,
'end' => $curEnd, 'end' => $curEnd,
'nextStart' => $nextStart, 'rec' => $interval
'nextEnd' => $nextEnd
); );
} }
public function getListviewData() public function getListviewData($forNow = false)
{ {
$data = []; $data = [];
@@ -125,12 +123,27 @@ class WorldEventList extends BaseType
'category' => $this->curTpl['category'], 'category' => $this->curTpl['category'],
'id' => $this->id, 'id' => $this->id,
'name' => $this->getField('name', true), 'name' => $this->getField('name', true),
'rec' => $this->curTpl['occurence'], '_date' => array(
'startDate' => $this->curTpl['startTime'], 'rec' => $this->curTpl['occurence'],
'endDate' => $this->curTpl['startTime'] + $this->curTpl['length'] 'length' => $this->curTpl['length'],
'firstDate' => $this->curTpl['startTime'],
'lastDate' => $this->curTpl['endTime']
)
); );
} }
if ($forNow)
{
foreach ($data as &$d)
{
$u = self::updateDates($d['_date']);
unset($d['_date']);
$d['startDate'] = $u['start'];
$d['endDate'] = $u['end'];
$d['rec'] = $u['rec'];
}
}
return $data; return $data;
} }

View File

@@ -3,280 +3,6 @@
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('invalid access');
class Lang
{
public static $timeUnits;
public static $main;
public static $account;
public static $game;
public static $error;
public static $search;
public static $profiler;
public static $achievement;
public static $class;
public static $currency;
public static $event;
public static $faction;
public static $item;
public static $itemset;
public static $maps;
public static $npc;
public static $pet;
public static $quest;
public static $skill;
public static $spell;
public static $title;
public static $zone;
public static $colon;
public static function load($loc)
{
if (!file_exists('localization/locale_'.$loc.'.php'))
die('File for localization '.strToUpper($loc).' not found.');
else
require 'localization/locale_'.$loc.'.php';
foreach ($lang as $k => $v)
self::$$k = $v;
// *cough* .. reuse-hack
self::$item['cat'][2] = [self::$item['cat'][2], self::$spell['weaponSubClass']];
self::$item['cat'][2][1][14] .= ' ('.self::$item['cat'][2][0].')';
}
// todo: expand
public static function getInfoBoxForFlags($flags)
{
$tmp = [];
if ($flags & CUSTOM_DISABLED)
$tmp[] = '[tooltip name=disabledHint]'.Util::jsEscape(self::$main['disabledHint']).'[/tooltip][span class=tip tooltip=disabledHint]'.Util::jsEscape(self::$main['disabled']).'[/span]';
if ($flags & CUSTOM_SERVERSIDE)
$tmp[] = '[tooltip name=serversideHint]'.Util::jsEscape(self::$main['serversideHint']).'[/tooltip][span class=tip tooltip=serversideHint]'.Util::jsEscape(self::$main['serverside']).'[/span]';
if ($flags & CUSTOM_UNAVAILABLE)
$tmp[] = self::$main['unavailable'];
return $tmp;
}
public static function getLocks($lockId, $interactive = false)
{
$locks = [];
$lock = DB::Aowow()->selectRow('SELECT * FROM ?_lock WHERE id = ?d', $lockId);
if (!$lock)
return '';
for ($i = 1; $i <= 5; $i++)
{
$prop = $lock['properties'.$i];
$rank = $lock['reqSkill'.$i];
$name = '';
if ($lock['type'.$i] == 1) // opened by item
{
$name = ItemList::getName($prop);
if (!$name)
continue;
if ($interactive)
$name = '<a class="q1" href="?item='.$prop.'">'.$name.'</a>';
}
else if ($lock['type'.$i] == 2) // opened by skill
{
// exclude unusual stuff
if (!in_array($prop, [1, 2, 3, 4, 9, 16, 20]))
continue;
$txt = DB::Aowow()->selectRow('SELECT * FROM ?_locktype WHERE id = ?d', $prop); // todo (low): convert to static text
$name = Util::localizedString($txt, 'name');
if (!$name)
continue;
if ($interactive)
{
$skill = 0;
switch ($prop)
{
case 1: $skill = 633; break; // Lockpicking
case 2: $skill = 182; break; // Herbing
case 3: $skill = 186; break; // Mining
case 20: $skill = 773; break; // Scribing
}
if ($skill)
$name = '<a href="?skill='.$skill.'">'.$name.'</a>';
}
if ($rank > 0)
$name .= ' ('.$rank.')';
}
else
continue;
$locks[$lock['type'.$i] == 1 ? $i : -$i] = sprintf(Lang::$game['requires'], $name);
}
return $locks;
}
public static function getReputationLevelForPoints($pts)
{
if ($pts >= 41999)
return self::$game['rep'][REP_EXALTED];
else if ($pts >= 20999)
return self::$game['rep'][REP_REVERED];
else if ($pts >= 8999)
return self::$game['rep'][REP_HONORED];
else if ($pts >= 2999)
return self::$game['rep'][REP_FRIENDLY];
else /* if ($pts >= 1) */
return self::$game['rep'][REP_NEUTRAL];
}
public static function getRequiredItems($class, $mask, $short = true)
{
if (!in_array($class, [ITEM_CLASS_MISC, ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON]))
return '';
// not checking weapon / armor here. It's highly unlikely that they overlap
if ($short)
{
// misc - Mounts
if ($class == ITEM_CLASS_MISC)
return '';
// all basic armor classes
if ($class == ITEM_CLASS_ARMOR && ($mask & 0x1E) == 0x1E)
return '';
// all weapon classes
if ($class == ITEM_CLASS_WEAPON && ($mask & 0x1DE5FF) == 0x1DE5FF)
return '';
foreach (Lang::$spell['subClassMasks'] as $m => $str)
if ($mask == $m)
return $str;
}
if ($class == ITEM_CLASS_MISC) // yeah hardcoded.. sue me!
return Lang::$spell['cat'][-5];
$tmp = [];
$strs = Lang::$spell[$class == ITEM_CLASS_ARMOR ? 'armorSubClass' : 'weaponSubClass'];
foreach ($strs as $k => $str)
if ($mask & (1 << $k) && $str)
$tmp[] = $str;
return implode(', ', $tmp);
}
public static function getStances($stanceMask)
{
$stanceMask &= 0xFC27909F; // clamp to available stances/forms..
$tmp = [];
$i = 1;
while ($stanceMask)
{
if ($stanceMask & (1 << ($i - 1)))
{
$tmp[] = self::$game['st'][$i];
$stanceMask &= ~(1 << ($i - 1));
}
$i++;
}
return implode(', ', $tmp);
}
public static function getMagicSchools($schoolMask)
{
$schoolMask &= SPELL_ALL_SCHOOLS; // clamp to available schools..
$tmp = [];
$i = 0;
while ($schoolMask)
{
if ($schoolMask & (1 << $i))
{
$tmp[] = self::$game['sc'][$i];
$schoolMask &= ~(1 << $i);
}
$i++;
}
return implode(', ', $tmp);
}
public static function getClassString($classMask)
{
$classMask &= CLASS_MASK_ALL; // clamp to available classes..
if ($classMask == CLASS_MASK_ALL) // available to all classes
return false;
$tmp = [];
$i = 1;
while ($classMask)
{
if ($classMask & (1 << ($i - 1)))
{
$tmp[] = '<a href="?class='.$i.'" class="c'.$i.'">'.self::$game['cl'][$i].'</a>';
$classMask &= ~(1 << ($i - 1));
}
$i++;
}
return implode(', ', $tmp);
}
public static function getRaceString($raceMask)
{
$raceMask &= RACE_MASK_ALL; // clamp to available races..
if ($raceMask == RACE_MASK_ALL) // available to all races (we don't display 'both factions')
return false;
$tmp = [];
$side = 0;
$i = 1;
if (!$raceMask)
return array('side' => SIDE_BOTH, 'name' => self::$game['ra'][0]);
if ($raceMask == RACE_MASK_HORDE)
return array('side' => SIDE_HORDE, 'name' => self::$game['ra'][-2]);
if ($raceMask == RACE_MASK_ALLIANCE)
return array('side' => SIDE_ALLIANCE, 'name' => self::$game['ra'][-1]);
if ($raceMask & RACE_MASK_HORDE)
$side |= SIDE_HORDE;
if ($raceMask & RACE_MASK_ALLIANCE)
$side |= SIDE_ALLIANCE;
while ($raceMask)
{
if ($raceMask & (1 << ($i - 1)))
{
$tmp[] = '<a href="?race='.$i.'" class="q1">'.self::$game['ra'][$i].'</a>';
$raceMask &= ~(1 << ($i - 1));
}
$i++;
}
return array ('side' => $side, 'name' => implode(', ', $tmp));
}
}
class SmartyAoWoW extends Smarty class SmartyAoWoW extends Smarty
{ {
private $config = []; private $config = [];
@@ -289,8 +15,6 @@ class SmartyAoWoW extends Smarty
$cwd = str_replace("\\", "/", getcwd()); $cwd = str_replace("\\", "/", getcwd());
$this->assign('appName', $config['name']);
$this->assign('AOWOW_REVISION', AOWOW_REVISION);
$this->config = $config; $this->config = $config;
$this->template_dir = $cwd.'/template/'; $this->template_dir = $cwd.'/template/';
$this->compile_dir = $cwd.'/cache/template/'; $this->compile_dir = $cwd.'/cache/template/';
@@ -300,17 +24,20 @@ class SmartyAoWoW extends Smarty
$this->left_delimiter = '{'; $this->left_delimiter = '{';
$this->right_delimiter = '}'; $this->right_delimiter = '}';
$this->caching = false; // Total Cache, this site does not work $this->caching = false; // Total Cache, this site does not work
$this->_tpl_vars['page'] = array( $this->_tpl_vars = array(
'reqJS' => [], // <[string]> path to required JSFile 'reqJS' => [], // <[string]> path to required JSFile
'reqCSS' => [], // <[string,string]> path to required CSSFile, IE condition 'reqCSS' => [], // <[string,string]> path to required CSSFile, IE condition
'title' => null, // [string] page title 'title' => null, // [string] page title
'tab' => null, // [int] # of tab to highlight in the menu 'tab' => null, // [int] # of tab to highlight in the menu
'type' => null, // [int] numCode for spell, npc, object, ect 'type' => null, // [int] numCode for spell, npc, object, ect
'typeId' => null, // [int] entry to display 'typeId' => null, // [int] entry to display
'path' => '[]' // [string] (js:array) path to preselect in the menu 'path' => '[]', // [string] (js:array) path to preselect in the menu
'jsGlobals' => [],
'redButtons' => [],
'headIcons' => [], // icons in front of title
); );
$this->_tpl_vars['jsGlobals'] = []; $this->assign('appName', $config['name']);
$this->_tpl_vars['redButtons'] = []; $this->assign('AOWOW_REVISION', AOWOW_REVISION);
} }
// using Smarty::assign would overwrite every pair and result in undefined indizes // using Smarty::assign would overwrite every pair and result in undefined indizes
@@ -320,7 +47,7 @@ class SmartyAoWoW extends Smarty
return; return;
foreach ($pageVars as $var => $val) foreach ($pageVars as $var => $val)
$this->_tpl_vars['page'][$var] = $val; $this->_tpl_vars[$var] = $val;
} }
// use, if you want to alert the staff to a problem with Trinity // use, if you want to alert the staff to a problem with Trinity
@@ -334,13 +61,13 @@ class SmartyAoWoW extends Smarty
$tv = &$this->_tpl_vars; $tv = &$this->_tpl_vars;
// fetch article & static infobox // fetch article & static infobox
if ($tv['page']['type'] && $tv['page']['typeId']) if ($tv['type'] && $tv['typeId'])
{ {
$article = DB::Aowow()->selectRow( $article = DB::Aowow()->selectRow(
'SELECT SQL_CALC_FOUND_ROWS article, quickInfo, locale FROM ?_articles WHERE type = ?d AND typeId = ?d AND locale = ?d UNION ALL '. 'SELECT SQL_CALC_FOUND_ROWS article, quickInfo, locale FROM ?_articles WHERE type = ?d AND typeId = ?d AND locale = ?d UNION ALL '.
'SELECT article, quickInfo, locale FROM ?_articles WHERE type = ?d AND typeId = ?d AND locale = 0 AND FOUND_ROWS() = 0', 'SELECT article, quickInfo, locale FROM ?_articles WHERE type = ?d AND typeId = ?d AND locale = 0 AND FOUND_ROWS() = 0',
$tv['page']['type'], $tv['page']['typeId'], User::$localeId, $tv['type'], $tv['typeId'], User::$localeId,
$tv['page']['type'], $tv['page']['typeId'] $tv['type'], $tv['typeId']
); );
if ($article) if ($article)
@@ -390,12 +117,12 @@ class SmartyAoWoW extends Smarty
} }
// fetch announcements // fetch announcements
if ($tv['query'][0] && !preg_match('/[^a-z]/i', $tv['query'][0])) if (preg_match('/^([a-z\-]+)=?.*$/i', $_SERVER['QUERY_STRING'], $match))
{ {
if (!isset($tv['announcements'])) if (!isset($tv['announcements']))
$tv['announcements'] = []; $tv['announcements'] = [];
$ann = DB::Aowow()->Select('SELECT * FROM ?_announcements WHERE status = 1 AND (page = ? OR page = "*")', $tv['query'][0]); $ann = DB::Aowow()->Select('SELECT * FROM ?_announcements WHERE status = 1 AND (page = ? OR page = "*")', $match[0]);
foreach ($ann as $k => $v) foreach ($ann as $k => $v)
{ {
if ($t = Util::localizedString($v, 'text')) if ($t = Util::localizedString($v, 'text'))
@@ -510,11 +237,11 @@ class SmartyAoWoW extends Smarty
} }
} }
public function notFound($subject) public function notFound($subject, $entry)
{ {
$this->updatePageVars(array( $this->updatePageVars(array(
'subject' => Util::ucFirst($subject), 'subject' => Util::ucFirst($subject),
'id' => intVal($this->_tpl_vars['query'][1]), 'id' => $entry,
'notFound' => sprintf(Lang::$main['pageNotFound'], $subject) 'notFound' => sprintf(Lang::$main['pageNotFound'], $subject)
)); ));
@@ -733,8 +460,7 @@ class Util
'clothChestArmor', 'leatherChestArmor', 'mailChestArmor', 'plateChestArmor' 'clothChestArmor', 'leatherChestArmor', 'mailChestArmor', 'plateChestArmor'
); );
public static $dateFormatShort = "Y/m/d"; public static $dateFormatInternal = "Y/m/d H:i:s";
public static $dateFormatLong = "Y/m/d H:i:s";
public static $changeLevelString = '<a href="javascript:;" onmousedown="return false" class="tip" style="color: white; cursor: pointer" onclick="$WH.g_staticTooltipLevelClick(this, null, 0)" onmouseover="$WH.Tooltip.showAtCursor(event, \'<span class=\\\'q2\\\'>\' + LANG.tooltip_changelevel + \'</span>\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><!--lvl-->%s</a>'; public static $changeLevelString = '<a href="javascript:;" onmousedown="return false" class="tip" style="color: white; cursor: pointer" onclick="$WH.g_staticTooltipLevelClick(this, null, 0)" onmouseover="$WH.Tooltip.showAtCursor(event, \'<span class=\\\'q2\\\'>\' + LANG.tooltip_changelevel + \'</span>\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><!--lvl-->%s</a>';
@@ -1370,6 +1096,12 @@ class Util
if ($short) if ($short)
{ {
if ($_ = round($s['d'] / 365))
return $_." ".Lang::$timeUnits['ab'][0];
if ($_ = round($s['d'] / 30))
return $_." ".Lang::$timeUnits['ab'][1];
if ($_ = round($s['d'] / 7))
return $_." ".Lang::$timeUnits['ab'][2];
if ($_ = round($s['d'])) if ($_ = round($s['d']))
return $_." ".Lang::$timeUnits['ab'][3]; return $_." ".Lang::$timeUnits['ab'][3];
if ($_ = round($s['h'])) if ($_ = round($s['h']))
@@ -1385,6 +1117,12 @@ class Util
} }
else else
{ {
if (!(($s['d'] + $s['h']) % 365)) // whole years
return round(($s['d'] + $s['h'] *24) / 365, 2)." ".Lang::$timeUnits[$s['d'] / 365 == 1 && !$s['h'] ? 'sg' : 'pl'][0];
if (!(($s['d'] + $s['h']) % 30)) // whole month
return round(($s['d'] + $s['h'] * 24) / 30, 2)." ".Lang::$timeUnits[$s['d'] / 30 == 1 && !$s['h'] ? 'sg' : 'pl'][1];
if (!(($s['d'] + $s['h']) % 7)) // whole weeks
return round(($s['d'] + $s['h'] * 24) / 7, 2)." ".Lang::$timeUnits[$s['d'] / 7 == 1 && !$s['h'] ? 'sg' : 'pl'][2];
if ($s['d']) if ($s['d'])
return round($s['d'] + $s['h'] / 24, 2)." ".Lang::$timeUnits[$s['d'] == 1 && !$s['h'] ? 'sg' : 'pl'][3]; return round($s['d'] + $s['h'] / 24, 2)." ".Lang::$timeUnits[$s['d'] == 1 && !$s['h'] ? 'sg' : 'pl'][3];
if ($s['h']) if ($s['h'])
@@ -1449,26 +1187,30 @@ class Util
'</HTML>' => '', '</HTML>' => '',
'<BODY>' => '', '<BODY>' => '',
'</BODY>' => '', '</BODY>' => '',
'<BR></BR>' => '<br />', '<BR></BR>' => '<br />'
"\n" => '',
"\r" => ''
); );
// html may contain images // html may contain 'Pictures'
$text = preg_replace('/"Interface\\\Pictures\\\([\w_\-]+)"/i', '"images/interface/Pictures/\1.jpg"', strtr($text, $pairs)); $text = preg_replace('/"Interface\\\Pictures\\\([\w_\-]+)"/i', '"images/interface/Pictures/\1.jpg"', strtr($text, $pairs));
} }
else
$text = strtr($text, ["\n" => '<br />', "\r" => '']);
// gender switch $from = array(
// ok, directed gender-reference: ($g:male:female:ref) where 'ref' is the variable (see $pairs) forward in the text determining the gender '/\|T([\w]+\\\)*([^\.]+)\.blp:\d+\|t/ui', // images (force size to tiny) |T<fullPath>:<size>|t
$text = preg_replace('/\$g\s*([^:;]+)\s*:\s*([^:;]+)\s*(:?[^:;]*);/ui', '&lt;\1/\2&gt;', $text); '/\|c(\w{6})\w{2}([^\|]+)\|r/ui', // color |c<RRGGBBAA><text>|r
'/\$g\s*([^:;]+)\s*:\s*([^:;]+)\s*(:?[^:;]*);/ui',// directed gender-reference $g:<male>:<female>:<refVariable>
'/\$t([^;]+);/ui', // nonesense, that the client apparently ignores
'/\|\d\-?\d?\((\$\w)\)/ui' // and another modifier for something russian |3-6($r)
);
// nonesense, that the client apparently ignores $to = array(
$text = preg_replace('/\$t([^;]+);/ui', '', $text); '<span class="icontiny" style="background-image: url('.STATIC_URL.'/images/icons/tiny/\2.gif)">',
'<span style="color: #\1">\2</span>',
'&lt;\1/\2&gt;',
'',
'\1'
);
// and another modifier for something russian |3-6($r) .. jesus christ <_< $text = preg_replace($from, $to, $text);
$text = preg_replace('/\|\d\-?\d?\((\$\w)\)/ui', '\1', $text);
$pairs = array( $pairs = array(
'$c' => '&lt;'.Lang::$game['class'].'&gt;', '$c' => '&lt;'.Lang::$game['class'].'&gt;',
@@ -1479,6 +1221,8 @@ class Util
'$N' => '&lt;'.Lang::$main['name'].'&gt;', '$N' => '&lt;'.Lang::$main['name'].'&gt;',
'$b' => '<br />', '$b' => '<br />',
'$B' => '<br />', '$B' => '<br />',
"\n" => '<br />',
"\r" => '',
'|n' => '' // what .. the fuck .. another type of line terminator? (only in spanish though) '|n' => '' // what .. the fuck .. another type of line terminator? (only in spanish though)
); );
@@ -1523,10 +1267,9 @@ class Util
return strtr(trim($string), array( return strtr(trim($string), array(
'\\' => '\\\\', '\\' => '\\\\',
"'" => "\\'", "'" => "\\'",
// '"' => '\\"', '"' => '\\"',
"\r" => '\\r', "\r" => '\\r',
"\n" => '\\n', "\n" => '\\n'
// '</' => '<\/',
)); ));
} }
@@ -1567,12 +1310,14 @@ class Util
public static function extractURLParams($str) public static function extractURLParams($str)
{ {
$arr = explode('.', $str); $arr = explode('.', $str);
$params = [];
foreach ($arr as $i => $a) foreach ($arr as $v)
$arr[$i] = is_numeric($a) ? (int)$a : null; if (is_numeric($v))
$params[] = (int)$v;
return $arr; return $params;
} }
// for item and spells // for item and spells
@@ -1732,19 +1477,20 @@ class Util
{ {
switch (count($keys)) switch (count($keys))
{ {
case 0: case 0: // no params works always
return true; return true;
case 1: case 1: // null is avalid || key in a n-dim-array || value in a 1-dim-array
return (is_int($keys) && in_array($keys, $struct)) || (is_array($keys) && (isset($struct[$keys[0]]) || $keys[0] === null && count($keys) == 1)); return $keys[0] === null || isset($struct[$keys[0]]) || in_array($keys[0], $struct);
case 2: case 2: // first param has to be a key. otherwise invalid
if (!isset($struct[$keys[0]])) if (!isset($struct[$keys[0]]))
return false; return false;
// check if the sub-array is n-imensional
if (count($struct[$keys[0]]) == count($struct[$keys[0]], COUNT_RECURSIVE)) if (count($struct[$keys[0]]) == count($struct[$keys[0]], COUNT_RECURSIVE))
return in_array($keys[1], $struct[$keys[0]]); return in_array($keys[1], $struct[$keys[0]]); // second param is value in second level array
else else
return isset($struct[$keys[0]][$keys[1]]); return isset($struct[$keys[0]][$keys[1]]); // check if params is key of another array
case 3: case 3: // 3 params MUST point to a specific value
return isset($struct[$keys[0]][$keys[1]]) && in_array($keys[2], $struct[$keys[0]][$keys[1]]); return isset($struct[$keys[0]][$keys[1]]) && in_array($keys[2], $struct[$keys[0]][$keys[1]]);
} }
@@ -1872,7 +1618,7 @@ class Util
quest_mail_loot_template entry quest_template RewMailTemplateId quest_mail_loot_template entry quest_template RewMailTemplateId
reference_loot_template entry many <- many _loot_template -mincountOrRef In case of negative mincountOrRef reference_loot_template entry many <- many _loot_template -mincountOrRef In case of negative mincountOrRef
*/ */
private static function getLootByEntry($tableName, $lootId, $groupId = 0, $baseChance = 1.0) private static function getLootByEntry($tableName, $lootId, &$handledRefs, $groupId = 0, $baseChance = 1.0)
{ {
$loot = []; $loot = [];
$rawItems = []; $rawItems = [];
@@ -1895,17 +1641,17 @@ class Util
'realChanceMod' => $baseChance 'realChanceMod' => $baseChance
); );
if ($entry['lootmode'] > 1) // if ($entry['lootmode'] > 1)
{ // {
$buff = []; $buff = [];
for ($i = 0; $i < 8; $i++) for ($i = 0; $i < 8; $i++)
if ($entry['lootmode'] & (1 << $i)) if ($entry['lootmode'] & (1 << $i))
$buff[] = $i; $buff[] = $i + 1;
$set['mode'] = implode(', ', $buff); $set['mode'] = implode(', ', $buff);
} // }
else // else
$set['mode'] = 0; // $set['mode'] = 0;
/* /*
modes:{"mode":8,"4":{"count":7173,"outof":17619},"8":{"count":7173,"outof":10684}} modes:{"mode":8,"4":{"count":7173,"outof":17619},"8":{"count":7173,"outof":10684}}
@@ -1921,11 +1667,17 @@ class Util
*/ */
if ($entry['mincountOrRef'] < 0) if ($entry['mincountOrRef'] < 0)
{ // todo (high): find out, why i used this in the first place. (don't do drugs, kids) {
list($data, $raw) = self::getLootByEntry(LOOT_REFERENCE, $entry['mincountOrRef'], /*$entry['groupid'],*/ 0, abs($entry['ChanceOrQuestChance'] / 100)); // bandaid.. remove when propperly handling lootmodes
if (!in_array($entry['mincountOrRef'], $handledRefs))
{ // todo (high): find out, why i used this in the first place. (don't do drugs, kids)
list($data, $raw) = self::getLootByEntry(LOOT_REFERENCE, $entry['mincountOrRef'], $handledRefs, /*$entry['groupid'],*/ 0, abs($entry['ChanceOrQuestChance'] / 100));
$loot = array_merge($loot, $data); $handledRefs[] = $entry['mincountOrRef'];
$rawItems = array_merge($rawItems, $raw);
$loot = array_merge($loot, $data);
$rawItems = array_merge($rawItems, $raw);
}
$set['content'] = $entry['mincountOrRef']; $set['content'] = $entry['mincountOrRef'];
$set['multiplier'] = $entry['maxcount']; $set['multiplier'] = $entry['maxcount'];
@@ -1999,13 +1751,16 @@ class Util
// if (is_array($entry) && in_array($table, [LOOT_CREATURE, LOOT_GAMEOBJECT]) // if (is_array($entry) && in_array($table, [LOOT_CREATURE, LOOT_GAMEOBJECT])
// iterate over the 4 available difficulties and assign modes // iterate over the 4 available difficulties and assign modes
*/
$struct = self::getLootByEntry($table, $entry);
modes:{"mode":1,"1":{"count":4408,"outof":16013},"4":{"count":4408,"outof":22531}}
*/
$handledRefs = [];
$struct = self::getLootByEntry($table, $entry, $handledRefs);
if (!$struct) if (!$struct)
return $lv; return $lv;
$items = new ItemList(array(['i.id', $struct[1]])); $items = new ItemList(array(['i.id', $struct[1]], SQL_LIMIT_NONE));
$items->addGlobalsToJscript(Util::$pageTemplate, GLOBALINFO_SELF | GLOBALINFO_RELATED); $items->addGlobalsToJscript(Util::$pageTemplate, GLOBALINFO_SELF | GLOBALINFO_RELATED);
$foo = $items->getListviewData(); $foo = $items->getListviewData();
@@ -2042,7 +1797,7 @@ class Util
else else
$lv[$loot['content']]['percent'] += $base['percent']; $lv[$loot['content']]['percent'] += $base['percent'];
} }
else else // in case of limited trash loot, check if $foo[<itemId>] exists
$lv[] = array_merge($foo[$loot['content']], $base, ['stack' => [$loot['min'], $loot['max']]]); $lv[] = array_merge($foo[$loot['content']], $base, ['stack' => [$loot['min'], $loot['max']]]);
} }
else if ($debug) // create dummy for ref-drop else if ($debug) // create dummy for ref-drop
@@ -2081,11 +1836,21 @@ class Util
else else
{ {
$fields = ['mode', 'reference']; $fields = ['mode', 'reference'];
$base = [];
$set = 0; $set = 0;
foreach ($lv as $foo) foreach ($lv as $foo)
{
foreach ($fields as $idx => $field) foreach ($fields as $idx => $field)
if (!empty($foo[$field])) {
if (!isset($base[$idx]))
$base[$idx] = @$foo[$field];
else if ($base[$idx] != @$foo[$field])
$set |= 1 << $idx; $set |= 1 << $idx;
}
if ($set == (pow(2, count($fields)) - 1))
break;
}
$debugCols[] = "Listview.funcBox.createSimpleCol('group', 'Group', '7%', 'group')"; $debugCols[] = "Listview.funcBox.createSimpleCol('group', 'Group', '7%', 'group')";
foreach ($fields as $idx => $field) foreach ($fields as $idx => $field)
@@ -2341,11 +2106,11 @@ class Util
foreach ($srcObj->iterate() as $_) foreach ($srcObj->iterate() as $_)
{ {
if ($tabId < 0 && $curTpl['type_flags'] & NPC_TYPEFLAG_HERBLOOT) if ($tabId < 0 && $curTpl['typeFlags'] & NPC_TYPEFLAG_HERBLOOT)
$tabId = 9; $tabId = 9;
else if ($tabId < 0 && $curTpl['type_flags'] & NPC_TYPEFLAG_ENGINEERLOOT) else if ($tabId < 0 && $curTpl['typeFlags'] & NPC_TYPEFLAG_ENGINEERLOOT)
$tabId = 8; $tabId = 8;
else if ($tabId < 0 && $curTpl['type_flags'] & NPC_TYPEFLAG_MININGLOOT) else if ($tabId < 0 && $curTpl['typeFlags'] & NPC_TYPEFLAG_MININGLOOT)
$tabId = 7; $tabId = 7;
else if ($tabId < 0) else if ($tabId < 0)
$tabId = abs($tabId); // general case (skinning) $tabId = abs($tabId); // general case (skinning)

279
localization/lang.class.php Normal file
View File

@@ -0,0 +1,279 @@
<?php
class Lang
{
public static $timeUnits;
public static $main;
public static $account;
public static $game;
public static $error;
public static $search;
public static $profiler;
public static $achievement;
public static $class;
public static $currency;
public static $event;
public static $faction;
public static $item;
public static $itemset;
public static $maps;
public static $npc;
public static $pet;
public static $quest;
public static $skill;
public static $spell;
public static $title;
public static $zone;
public static $colon;
public static $dateFmtLong;
public static $dateFmtShort;
public static function load($loc)
{
if (!file_exists('localization/locale_'.$loc.'.php'))
die('File for localization '.strToUpper($loc).' not found.');
else
require 'localization/locale_'.$loc.'.php';
foreach ($lang as $k => $v)
self::$$k = $v;
// *cough* .. reuse-hack
self::$item['cat'][2] = [self::$item['cat'][2], self::$spell['weaponSubClass']];
self::$item['cat'][2][1][14] .= ' ('.self::$item['cat'][2][0].')';
}
// todo: expand
public static function getInfoBoxForFlags($flags)
{
$tmp = [];
if ($flags & CUSTOM_DISABLED)
$tmp[] = '[tooltip name=disabledHint]'.Util::jsEscape(self::$main['disabledHint']).'[/tooltip][span class=tip tooltip=disabledHint]'.Util::jsEscape(self::$main['disabled']).'[/span]';
if ($flags & CUSTOM_SERVERSIDE)
$tmp[] = '[tooltip name=serversideHint]'.Util::jsEscape(self::$main['serversideHint']).'[/tooltip][span class=tip tooltip=serversideHint]'.Util::jsEscape(self::$main['serverside']).'[/span]';
if ($flags & CUSTOM_UNAVAILABLE)
$tmp[] = self::$main['unavailable'];
return $tmp;
}
public static function getLocks($lockId, $interactive = false)
{
$locks = [];
$lock = DB::Aowow()->selectRow('SELECT * FROM ?_lock WHERE id = ?d', $lockId);
if (!$lock)
return '';
for ($i = 1; $i <= 5; $i++)
{
$prop = $lock['properties'.$i];
$rank = $lock['reqSkill'.$i];
$name = '';
if ($lock['type'.$i] == 1) // opened by item
{
$name = ItemList::getName($prop);
if (!$name)
continue;
if ($interactive)
$name = '<a class="q1" href="?item='.$prop.'">'.$name.'</a>';
}
else if ($lock['type'.$i] == 2) // opened by skill
{
// exclude unusual stuff
if (!in_array($prop, [1, 2, 3, 4, 9, 16, 20]))
continue;
$txt = DB::Aowow()->selectRow('SELECT * FROM ?_locktype WHERE id = ?d', $prop); // todo (low): convert to static text
$name = Util::localizedString($txt, 'name');
if (!$name)
continue;
if ($interactive)
{
$skill = 0;
switch ($prop)
{
case 1: $skill = 633; break; // Lockpicking
case 2: $skill = 182; break; // Herbing
case 3: $skill = 186; break; // Mining
case 20: $skill = 773; break; // Scribing
}
if ($skill)
$name = '<a href="?skill='.$skill.'">'.$name.'</a>';
}
if ($rank > 0)
$name .= ' ('.$rank.')';
}
else
continue;
$locks[$lock['type'.$i] == 1 ? $i : -$i] = sprintf(Lang::$game['requires'], $name);
}
return $locks;
}
public static function getReputationLevelForPoints($pts)
{
if ($pts >= 41999)
return self::$game['rep'][REP_EXALTED];
else if ($pts >= 20999)
return self::$game['rep'][REP_REVERED];
else if ($pts >= 8999)
return self::$game['rep'][REP_HONORED];
else if ($pts >= 2999)
return self::$game['rep'][REP_FRIENDLY];
else /* if ($pts >= 1) */
return self::$game['rep'][REP_NEUTRAL];
}
public static function getRequiredItems($class, $mask, $short = true)
{
if (!in_array($class, [ITEM_CLASS_MISC, ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON]))
return '';
// not checking weapon / armor here. It's highly unlikely that they overlap
if ($short)
{
// misc - Mounts
if ($class == ITEM_CLASS_MISC)
return '';
// all basic armor classes
if ($class == ITEM_CLASS_ARMOR && ($mask & 0x1E) == 0x1E)
return '';
// all weapon classes
if ($class == ITEM_CLASS_WEAPON && ($mask & 0x1DE5FF) == 0x1DE5FF)
return '';
foreach (Lang::$spell['subClassMasks'] as $m => $str)
if ($mask == $m)
return $str;
}
if ($class == ITEM_CLASS_MISC) // yeah hardcoded.. sue me!
return Lang::$spell['cat'][-5];
$tmp = [];
$strs = Lang::$spell[$class == ITEM_CLASS_ARMOR ? 'armorSubClass' : 'weaponSubClass'];
foreach ($strs as $k => $str)
if ($mask & (1 << $k) && $str)
$tmp[] = $str;
return implode(', ', $tmp);
}
public static function getStances($stanceMask)
{
$stanceMask &= 0xFC27909F; // clamp to available stances/forms..
$tmp = [];
$i = 1;
while ($stanceMask)
{
if ($stanceMask & (1 << ($i - 1)))
{
$tmp[] = self::$game['st'][$i];
$stanceMask &= ~(1 << ($i - 1));
}
$i++;
}
return implode(', ', $tmp);
}
public static function getMagicSchools($schoolMask)
{
$schoolMask &= SPELL_ALL_SCHOOLS; // clamp to available schools..
$tmp = [];
$i = 0;
while ($schoolMask)
{
if ($schoolMask & (1 << $i))
{
$tmp[] = self::$game['sc'][$i];
$schoolMask &= ~(1 << $i);
}
$i++;
}
return implode(', ', $tmp);
}
public static function getClassString($classMask)
{
$classMask &= CLASS_MASK_ALL; // clamp to available classes..
if ($classMask == CLASS_MASK_ALL) // available to all classes
return false;
$tmp = [];
$i = 1;
while ($classMask)
{
if ($classMask & (1 << ($i - 1)))
{
$tmp[] = '<a href="?class='.$i.'" class="c'.$i.'">'.self::$game['cl'][$i].'</a>';
$classMask &= ~(1 << ($i - 1));
}
$i++;
}
return implode(', ', $tmp);
}
public static function getRaceString($raceMask)
{
$raceMask &= RACE_MASK_ALL; // clamp to available races..
if ($raceMask == RACE_MASK_ALL) // available to all races (we don't display 'both factions')
return false;
$tmp = [];
$side = 0;
$i = 1;
if (!$raceMask)
return array('side' => SIDE_BOTH, 'name' => self::$game['ra'][0]);
if ($raceMask == RACE_MASK_HORDE)
return array('side' => SIDE_HORDE, 'name' => self::$game['ra'][-2]);
if ($raceMask == RACE_MASK_ALLIANCE)
return array('side' => SIDE_ALLIANCE, 'name' => self::$game['ra'][-1]);
if ($raceMask & RACE_MASK_HORDE)
$side |= SIDE_HORDE;
if ($raceMask & RACE_MASK_ALLIANCE)
$side |= SIDE_ALLIANCE;
while ($raceMask)
{
if ($raceMask & (1 << ($i - 1)))
{
$tmp[] = '<a href="?race='.$i.'" class="q1">'.self::$game['ra'][$i].'</a>';
$raceMask &= ~(1 << ($i - 1));
}
$i++;
}
return array ('side' => $side, 'name' => implode(', ', $tmp));
}
}
?>

View File

@@ -145,9 +145,9 @@ $lang = array(
'npcs' => "NPCs", 'npcs' => "NPCs",
'pet' => "Begleiter", 'pet' => "Begleiter",
'pets' => "Begleiter", 'pets' => "Begleiter",
'requires' => "Benötigt %s",
'profile' => "", 'profile' => "",
'profiles' => "Profile", 'profiles' => "Profile",
'requires' => "Benötigt %s",
'requires2' => "Benötigt", 'requires2' => "Benötigt",
'reqLevel' => "Benötigt Stufe %s", 'reqLevel' => "Benötigt Stufe %s",
'reqLevelHlm' => "Benötigt Stufe %s", 'reqLevelHlm' => "Benötigt Stufe %s",
@@ -203,7 +203,7 @@ $lang = array(
), ),
'ct' => array( 'ct' => array(
"Nicht kategorisiert", "Wildtier", "Drachkin", "Dämon", "Elementar", "Riese", "Untoter", "Humanoid", "Nicht kategorisiert", "Wildtier", "Drachkin", "Dämon", "Elementar", "Riese", "Untoter", "Humanoid",
"Tier", "Mechanisch", "Nicht spezifiziert", "Totem", "Haustier", "Gas Wolke" "Tier", "Mechanisch", "Nicht spezifiziert", "Totem", "Haustier", "Gaswolke"
), ),
'fa' => array( 'fa' => array(
1 => "Wolf", 2 => "Katze", 3 => "Spinne", 4 => "Bär", 5 => "Eber", 6 => "Krokilisk", 7 => "Aasvogel", 8 => "Krebs", 1 => "Wolf", 2 => "Katze", 3 => "Spinne", 4 => "Bär", 5 => "Eber", 6 => "Krokilisk", 7 => "Aasvogel", 8 => "Krebs",
@@ -261,9 +261,32 @@ $lang = array(
'viewPubDesc' => "Die Beschreibung in deinem <a href=\"?user=%s\">öffentlichen Profil</a> ansehen", 'viewPubDesc' => "Die Beschreibung in deinem <a href=\"?user=%s\">öffentlichen Profil</a> ansehen",
), ),
'npc' => array( 'npc' => array(
'rank' => ['Normal', 'Elite', 'Rar Elite', 'Boss', 'Rar'] 'rank' => [0 => "Normal", 1 => "Elite", 4 => "Rar", 2 => "Rar Elite", 3 => "Boss"],
'classification'=> "Einstufung",
'petFamily' => "Tierart",
'react' => "Reaktion",
'worth' => "Wert",
'unkPosition' => "Der Aufenthaltsort dieses NPCs ist nicht bekannt.",
'difficultyPH' => "Dieser NPC ist ein Platzhalter für einen anderen Modus von",
'quotes' => "Zitate",
'gainsDesc' => "Nach dem Töten dieses NPCs erhaltet Ihr",
'repWith' => "Ruf mit der Fraktion",
'stopsAt' => "Stoppt bei %s",
'textTypes' => [null, "schreit", "sagt", "flüstert"],
'modes' => array(
1 => ["Normal", "Heroisch"],
2 => ["10-Spieler Normal", "25-Spieler Normal", "10-Spieler Heroisch", "25-Spieler Heroisch"]
),
'cat' => array(
"Nicht kategorisiert", "Wildtiere", "Drachkin", "Dämonen", "Elementare", "Riesen", "Untote", "Humanoide",
"Tiere", "Mechanisch", "Nicht spezifiziert", "Totems", "Haustiere", "Gaswolken"
)
), ),
'event' => array( 'event' => array(
'start' => "Anfang",
'end' => "Ende",
'interval' => "Intervall",
'inProgress' => "Ereignis findet gerade statt",
'category' => array("Nicht kategorisiert", "Feiertage", "Wiederkehrend", "Spieler vs. Spieler") 'category' => array("Nicht kategorisiert", "Feiertage", "Wiederkehrend", "Spieler vs. Spieler")
), ),
'achievement' => array( 'achievement' => array(
@@ -275,6 +298,7 @@ $lang = array(
'itemReward' => "Ihr bekommt:", 'itemReward' => "Ihr bekommt:",
'titleReward' => "Euch wird der Titel \"<a href=\"?title=%d\">%s</a>\" verliehen", 'titleReward' => "Euch wird der Titel \"<a href=\"?title=%d\">%s</a>\" verliehen",
'slain' => "getötet", 'slain' => "getötet",
'reqNumCrt' => "Benötigt"
), ),
'class' => array( 'class' => array(
'racialLeader' => "Volksanführer", 'racialLeader' => "Volksanführer",
@@ -322,6 +346,7 @@ $lang = array(
) )
), ),
'currency' => array( 'currency' => array(
'cap' => "Obergrenze",
'cat' => array( 'cat' => array(
1 => "Verschiedenes", 2 => "Spieler gegen Spieler", 4 => "Classic", 21 => "Wrath of the Lich King", 22 => "Dungeon und Schlachtzug", 23 => "Burning Crusade", 41 => "Test", 3 => "Unbenutzt" 1 => "Verschiedenes", 2 => "Spieler gegen Spieler", 4 => "Classic", 21 => "Wrath of the Lich King", 22 => "Dungeon und Schlachtzug", 23 => "Burning Crusade", 41 => "Test", 3 => "Unbenutzt"
) )
@@ -344,7 +369,7 @@ $lang = array(
'_pieces' => "Teile", '_pieces' => "Teile",
'_unavailable' => "Dieses Ausrüstungsset ist nicht für Spieler verfügbar.", '_unavailable' => "Dieses Ausrüstungsset ist nicht für Spieler verfügbar.",
'_tag' => "Tag", '_tag' => "Tag",
'summary' => "Zusammenfassung",
'notes' => array( 'notes' => array(
null, "Dungeon-Set 1", "Dungeon-Set 2", "Tier 1 Raid-Set", null, "Dungeon-Set 1", "Dungeon-Set 2", "Tier 1 Raid-Set",
"Tier 2 Raid-Set", "Tier 3 Raid-Set", "Level 60 PvP-Set (Rar)", "Level 60 PvP-Set (Rar, alt)", "Tier 2 Raid-Set", "Tier 3 Raid-Set", "Level 60 PvP-Set (Rar)", "Level 60 PvP-Set (Rar, alt)",
@@ -698,7 +723,9 @@ $lang = array(
"Unbekannter Bonus #%d (%d)", "Unbekannter Bonus #%d (%d)",
) )
), ),
'colon' => ': ' 'colon' => ': ',
'dateFmtShort' => "d.m.Y",
'dateFmtLong' => "d.m.Y \u\m H:i"
); );
?> ?>

View File

@@ -248,9 +248,32 @@ $lang = array(
'viewPubDesc' => "View your Public Description in your <a href=\"?user=%s\">Profile Page</a>", 'viewPubDesc' => "View your Public Description in your <a href=\"?user=%s\">Profile Page</a>",
), ),
'npc' => array( 'npc' => array(
'rank' => ['Normal', 'Elite', 'Rare Elite', 'Boss', 'Rare'] 'rank' => [0 => "Normal", 1 => "Elite", 4 => "Rare", 2 => "Rare Elite", 3 => "Boss"],
'classification'=> "Classification",
'petFamily' => "Pet familiy",
'react' => "React",
'worth' => "Worth",
'unkPosition' => "The location of this NPC is unknown.",
'difficultyPH' => "This NPC is a placeholder for a different mode of",
'quotes' => "Quotes",
'gainsDesc' => "After killing this NPC you will gain",
'repWith' => "reputation with",
'stopsAt' => "stops at %s",
'textTypes' => [null, "yells", "says", "whispers"],
'modes' => array(
1 => ["Normal", "Heroic"],
2 => ["10-player Normal", "25-player Normal", "10-player Heroic", "25-player Heroic"]
),
'cat' => array(
"Uncategorized", "Beasts", "Dragonkins", "Demons", "Elementals", "Giants", "Undead", "Humanoids",
"Critters", "Mechanicals", "Not specified", "Totems", "Non-combat Pets", "Gas Clouds"
),
), ),
'event' => array( 'event' => array(
'start' => "Start",
'end' => "End",
'interval' => "Interval",
'inProgress' => "Event is currently in progress",
'category' => array("Uncategorized", "Holidays", "Recurring", "Player vs. Player") 'category' => array("Uncategorized", "Holidays", "Recurring", "Player vs. Player")
), ),
'achievement' => array( 'achievement' => array(
@@ -262,6 +285,7 @@ $lang = array(
'itemReward' => "You will receive:", 'itemReward' => "You will receive:",
'titleReward' => "You shall be granted the title \"<a href=\"?title=%d\">%s</a>\"", 'titleReward' => "You shall be granted the title \"<a href=\"?title=%d\">%s</a>\"",
'slain' => "slain", 'slain' => "slain",
'reqNumCrt' => "Requires"
), ),
'class' => array( 'class' => array(
'racialLeader' => "Racial leader", 'racialLeader' => "Racial leader",
@@ -309,6 +333,7 @@ $lang = array(
) )
), ),
'currency' => array( 'currency' => array(
'cap' => "Total cap",
'cat' => array( 'cat' => array(
1 => "Miscellaneous", 2 => "Player vs. Player", 4 => "Classic", 21 => "Wrath of the Lich King", 22 => "Dungeon and Raid", 23 => "Burning Crusade", 41 => "Test", 3 => "Unused" 1 => "Miscellaneous", 2 => "Player vs. Player", 4 => "Classic", 21 => "Wrath of the Lich King", 22 => "Dungeon and Raid", 23 => "Burning Crusade", 41 => "Test", 3 => "Unused"
) )
@@ -331,7 +356,7 @@ $lang = array(
'_pieces' => "pieces", '_pieces' => "pieces",
'_unavailable' => "This item set is not available to players.", '_unavailable' => "This item set is not available to players.",
'_tag' => "Tag", '_tag' => "Tag",
'summary' => "Summary",
'notes' => array( 'notes' => array(
null, "Dungeon Set 1", "Dungeon Set 2", "Tier 1 Raid Set", null, "Dungeon Set 1", "Dungeon Set 2", "Tier 1 Raid Set",
"Tier 2 Raid Set", "Tier 3 Raid Set", "Level 60 PvP Rare Set", "Level 60 PvP Rare Set (Old)", "Tier 2 Raid Set", "Tier 3 Raid Set", "Level 60 PvP Rare Set", "Level 60 PvP Rare Set (Old)",
@@ -685,7 +710,9 @@ $lang = array(
"Unknown Bonus #%d (%d)", "Unknown Bonus #%d (%d)",
) )
), ),
'colon' => ': ' 'colon' => ': ',
'dateFmtShort' => "Y/m/d",
'dateFmtLong' => "Y/m/d \a\\t H:i"
); );
?> ?>

View File

@@ -219,9 +219,32 @@ $lang = array(
), ),
'account' => [], 'account' => [],
'npc' => array( 'npc' => array(
'rank' => ['Normal', 'Élite', 'Élite raro', 'Jefe', 'Raro'] 'rank' => [0 => "Normal", 1 => "Élite", 4 => "Raro", 2 => "Élite raro", 3 => "Jefe"],
'classification'=> "Clasificación",
'petFamily' => "Familia de mascota",
'react' => "Reacción",
'worth' => "Valor",
'unkPosition' => "No se conoce la ubicación de este PNJ.",
'difficultyPH' => "[Este PNJ es un marcador de posición para un modo diferente de]",
'quotes' => "Citas",
'gainsDesc' => "Tras acabar con este PNJ ganarás",
'repWith' => "reputación con",
'stopsAt' => "se detiene en %s",
'textTypes' => [null, "grita", "dice", "susurra"],
'modes' => array(
1 => ["Normal", "Heroico"],
2 => ["10 jugadores Normal", "25 jugadores Normal", "10 jugadores Heroico", "25 jugadores Heroico"]
),
'cat' => array(
"Sin categoría", "Bestia", "Dragonante", "Demonio", "Elemental", "Gigante", "No-muerto", "Humanoide",
"Alimaña", "Mecánico", "Sin especificar", "Tótem", "Mascota mansa", "Nube de gas"
)
), ),
'event' => array( 'event' => array(
'start' => "Empieza",
'end' => "Termina",
'interval' => "Intervalo",
'inProgress' => "El evento está en progreso actualmente",
'category' => array("Sin categoría", "Vacacionales", "Periódicos", "Jugador contra Jugador") 'category' => array("Sin categoría", "Vacacionales", "Periódicos", "Jugador contra Jugador")
), ),
'achievement' => array( 'achievement' => array(
@@ -233,6 +256,7 @@ $lang = array(
'itemReward' => "Recibirás:", 'itemReward' => "Recibirás:",
'titleReward' => "Deberías obtener el título \"<a href=\"?title=%d\">%s</a>\"", 'titleReward' => "Deberías obtener el título \"<a href=\"?title=%d\">%s</a>\"",
'slain' => "matado", 'slain' => "matado",
'reqNumCrt' => "Requiere"
), ),
'class' => array( 'class' => array(
'racialLeader' => "Lider racial", 'racialLeader' => "Lider racial",
@@ -280,6 +304,7 @@ $lang = array(
) )
), ),
'currency' => array( 'currency' => array(
'cap' => "Límite total",
'cat' => array( 'cat' => array(
1 => "Miscelánea", 2 => "Jugador contra Jugador", 4 => "Clásico", 21 => "Wrath of the Lich King", 22 => "Mazmorra y banda", 23 => "Burning Crusade", 41 => "Prueba", 3 => "No las uso" 1 => "Miscelánea", 2 => "Jugador contra Jugador", 4 => "Clásico", 21 => "Wrath of the Lich King", 22 => "Mazmorra y banda", 23 => "Burning Crusade", 41 => "Prueba", 3 => "No las uso"
) )
@@ -302,7 +327,7 @@ $lang = array(
'_pieces' => "piezas", '_pieces' => "piezas",
'_unavailable' => "Este conjunto de objetos no está disponible para jugadores.", '_unavailable' => "Este conjunto de objetos no está disponible para jugadores.",
'_tag' => "Etiqueta", '_tag' => "Etiqueta",
'summary' => "Resúmen",
'notes' => array( 'notes' => array(
null, "Set de mazmorra 1", "Set de mazmorra 2", "Set de banda tier 1", null, "Set de mazmorra 1", "Set de mazmorra 2", "Set de banda tier 1",
"Set de banda tier 2", "Set de banda tier 3", "Set JcJ nivel 60 superior", "Set JcJ nivel 60 superior (obsoleto)", "Set de banda tier 2", "Set de banda tier 3", "Set JcJ nivel 60 superior", "Set JcJ nivel 60 superior (obsoleto)",
@@ -656,7 +681,9 @@ $lang = array(
"Estadística no utilizada #%d (%d)", "Estadística no utilizada #%d (%d)",
) )
), ),
'colon' => ': ' 'colon' => ': ',
'dateFmtShort' => "d/m/Y",
'dateFmtLong' => "d/m/Y \a \l\a\s H:i"
); );
?> ?>

View File

@@ -219,9 +219,32 @@ $lang = array(
), ),
'account' => [], 'account' => [],
'npc' => array( 'npc' => array(
'rank' => ['Standard', 'Élite', 'Élite rare', 'Boss', 'Rare'] 'rank' => [0 => "Standard", 1 => "Élite", 4 => "Rare", 2 => "Élite rare", 3 =>"Boss"],
'classification'=> "Classification",
'petFamily' => "Familier",
'react' => "Réaction",
'worth' => "Vaut",
'unkPosition' => "L'emplacement de ce PNJ est inconnu.",
'difficultyPH' => "[Ce PNJ est un espace réservé pour un autre mode de]",
'quotes' => "Citations",
'gainsDesc' => "Après avoir tué ce PNJ vous allez obtenir",
'repWith' => "points de réputation avec",
'stopsAt' => "arrête à %s",
'textTypes' => [null, "crie", "dit", "chuchote"],
'modes' => array(
1 => ["Normal", "Héroïque"],
2 => ["10-joueurs Normal", "25-joueurs Normal", "10-joueurs Héroïque", "25-joueurs Héroïque"]
),
'cat' => array(
"Non classés", "Bêtes", "Draconien", "Démons", "Élémentaires", "Géants", "Mort-vivant", "Humanoïdes",
"Bestioles", "Mécaniques", "Non spécifié", "Totems", "Familier pacifique", "Nuages de gaz"
)
), ),
'event' => array( 'event' => array(
'start' => "Début",
'end' => "Fin",
'interval' => "Intervalle",
'inProgress' => "L'évènement est présentement en cours",
'category' => array("Non classés", "Vacances", "Récurrent", "Joueur ctr. Joueur") 'category' => array("Non classés", "Vacances", "Récurrent", "Joueur ctr. Joueur")
), ),
'achievement' => array( 'achievement' => array(
@@ -233,6 +256,7 @@ $lang = array(
'itemReward' => "Vous recevrez :", 'itemReward' => "Vous recevrez :",
'titleReward' => "Vous devriez recevoir le titre \"<a href=\"?title=%d\">%s</a>\"", 'titleReward' => "Vous devriez recevoir le titre \"<a href=\"?title=%d\">%s</a>\"",
'slain' => "tué", 'slain' => "tué",
'reqNumCrt' => "Nécessite"
), ),
'class' => array( 'class' => array(
'racialLeader' => "Leader racial", 'racialLeader' => "Leader racial",
@@ -280,6 +304,7 @@ $lang = array(
) )
), ),
'currency' => array( 'currency' => array(
'cap' => "Maximum total",
'cat' => array( 'cat' => array(
1 => "Divers", 2 => "JcJ", 4 => "Classique", 21 => "Wrath of the Lich King", 22 => "Raid", 23 => "Burning Crusade", 41 => "Test", 3 => "Inutilisées" 1 => "Divers", 2 => "JcJ", 4 => "Classique", 21 => "Wrath of the Lich King", 22 => "Raid", 23 => "Burning Crusade", 41 => "Test", 3 => "Inutilisées"
) )
@@ -302,7 +327,7 @@ $lang = array(
'_pieces' => "pièces", '_pieces' => "pièces",
'_unavailable' => "Cet objet n'est plus disponible aux joueurs.", '_unavailable' => "Cet objet n'est plus disponible aux joueurs.",
'_tag' => "Étiquette", '_tag' => "Étiquette",
'summary' => "Résumé",
'notes' => array( 'notes' => array(
null, "Ensemble de donjon 1", "Ensemble de donjon 2", "Ensemble de raid palier 1", null, "Ensemble de donjon 1", "Ensemble de donjon 2", "Ensemble de raid palier 1",
"Ensemble de raid palier 2", "Ensemble de raid palier 3", "Ensemble JcJ niveau 60 supérieur", "Ensemble JcJ niveau 60 supérieur (désuet)", "Ensemble de raid palier 2", "Ensemble de raid palier 3", "Ensemble JcJ niveau 60 supérieur", "Ensemble JcJ niveau 60 supérieur (désuet)",
@@ -606,7 +631,7 @@ $lang = array(
12 => "Quest", 12 => "Quest",
13 => "Keys", 13 => "Keys",
), ),
'statType' => array( 'statType' => array(
"Augmente vos points de mana de %d.", "Augmente vos points de mana de %d.",
"Augmente vos points de vie de %d.", "Augmente vos points de vie de %d.",
null, null,
@@ -656,7 +681,9 @@ $lang = array(
"Stat Inutilisée #%d (%d)", "Stat Inutilisée #%d (%d)",
) )
), ),
'colon' => ' : ' 'colon' => ' : ',
'dateFmtShort' => "Y-m-d",
'dateFmtLong' => "Y-m-d à H:i"
); );
?> ?>

View File

@@ -219,9 +219,32 @@ $lang = array(
), ),
'account' => [], 'account' => [],
'npc' => array( 'npc' => array(
'rank' => ['Обычный', 'Элитный', 'Редкий элитный', 'Босс', 'Редкий'] 'rank' => [0 => "Обычный", 1 => "Элитный", 4 => "Редкий", 2 => "Редкий элитный", 3 =>"Босс"],
'classification'=> "Классификация",
'petFamily' => "Семейство питомца",
'react' => "Реакция",
'worth' => "Деньги",
'unkPosition' => "Местоположение этого НИП неизвестно.",
'difficultyPH' => "[Этот НИП является прототипом для другого режима]",
'quotes' => "Цитаты",
'gainsDesc' => "В награду за убийство этого НИПа вы получите",
'repWith' => "репутации с",
'stopsAt' => 'останавливается на уровне "%s"',
'textTypes' => [null, "кричит", "говорит", "шепчет"],
'modes' => array(
1 => ["Обычный", "Героический"],
2 => ["10 нормал.", "25 нормал.", "10 героич.", "25 героич."]
),
'cat' => array(
"Разное", "Животные", "Дракон", "Демоны", "Элементали", "Великаны", "Нежить", "Гуманоиды",
"Существа", "Механизмы", "Не указано", "Тотемы", "Спутники", "Облака газа"
)
), ),
'event' => array( 'event' => array(
'start' => "Начало",
'end' => "Конец",
'interval' => "[Interval]",
'inProgress' => "Событие активно в данный момент",
'category' => array("Разное", "Праздники", "Периодические", "PvP") 'category' => array("Разное", "Праздники", "Периодические", "PvP")
), ),
'achievement' => array( 'achievement' => array(
@@ -233,6 +256,7 @@ $lang = array(
'itemReward' => "Вы получите:", 'itemReward' => "Вы получите:",
'titleReward' => "Наградное звание: \"<a href=\"?title=%d\">%s</a>\"", 'titleReward' => "Наградное звание: \"<a href=\"?title=%d\">%s</a>\"",
'slain' => "убито", 'slain' => "убито",
'reqNumCrt' => "Требуется"
), ),
'class' => array( 'class' => array(
'racialLeader' => "Лидер расы", 'racialLeader' => "Лидер расы",
@@ -280,6 +304,7 @@ $lang = array(
) )
), ),
'currency' => array( 'currency' => array(
'cap' => "Максимум всего",
'cat' => array( 'cat' => array(
1 => "Разное", 2 => "PvP", 4 => "World of Warcraft", 21 => "Wrath of the Lich King", 22 => "Подземелья и рейды", 23 => "Burning Crusade", 41 => "Test", 3 => "Неактивно" 1 => "Разное", 2 => "PvP", 4 => "World of Warcraft", 21 => "Wrath of the Lich King", 22 => "Подземелья и рейды", 23 => "Burning Crusade", 41 => "Test", 3 => "Неактивно"
) )
@@ -302,7 +327,7 @@ $lang = array(
'_pieces' => "частей", '_pieces' => "частей",
'_unavailable' => "Этот набор предметов не доступен игрокам.", '_unavailable' => "Этот набор предметов не доступен игрокам.",
'_tag' => "Тэг", '_tag' => "Тэг",
'summary' => "Сводка",
'notes' => array( 'notes' => array(
null, "Комплект подземелий 1", "Комплект подземелий 2", "Рейдовый комплект Tier 1", null, "Комплект подземелий 1", "Комплект подземелий 2", "Рейдовый комплект Tier 1",
"Рейдовый комплект Tier 2", "Рейдовый комплект Tier 3", "PvP Комплект для 60 уровня", "PvP Комплект для 60 уровня (старая версия)", "Рейдовый комплект Tier 2", "Рейдовый комплект Tier 3", "PvP Комплект для 60 уровня", "PvP Комплект для 60 уровня (старая версия)",
@@ -656,7 +681,9 @@ $lang = array(
"Unknown Bonus #%d (%d)", "Unknown Bonus #%d (%d)",
) )
), ),
'colon' => ': ' 'colon' => ': ',
'dateFmtShort' => "Y-m-d",
'dateFmtLong' => "Y-m-d в H:i"
); );
?> ?>

View File

@@ -55,19 +55,19 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$acv = new AchievementList(array(['id', $_id])); $acv = new AchievementList(array(['id', $_id]));
if ($acv->error) if ($acv->error)
$smarty->notFound(Lang::$game['achievement']); $smarty->notFound(Lang::$game['achievement'], $_id);
// create page title and path // create page title and path
$curCat = $acv->getField('category'); $curCat = $acv->getField('category');
$tmpPath = []; $path = [];
do do
{ {
array_unshift($tmpPath, $curCat); array_unshift($path, $curCat);
$curCat = DB::Aowow()->SelectCell('SELECT parentCategory FROM ?_achievementcategory WHERE id = ?d', $curCat); $curCat = DB::Aowow()->SelectCell('SELECT parentCategory FROM ?_achievementcategory WHERE id = ?d', $curCat);
} }
while ($curCat > 0); while ($curCat > 0);
array_unshift($tmpPath, 0, 9); array_unshift($path, 0, 9);
$acv->addGlobalsToJscript($smarty, GLOBALINFO_REWARDS); $acv->addGlobalsToJscript($smarty, GLOBALINFO_REWARDS);
@@ -130,20 +130,24 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
/* Main Content */ /* Main Content */
/****************/ /****************/
// menuId 9: Achievement g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'title' => $acv->getField('name', true),
'path' => $tmpPath,
'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null,
'series' => $series,
'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( 'page' => array(
'title' => $acv->getField('name', true).' - '.Util::ucfirst(Lang::$game['achievement']),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_ACHIEVEMENT,
'typeId' => $_id,
'headIcons' => $acv->getField('iconString'),
'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null,
'series' => $series,
'redButtons' => 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
),
'name' => $acv->getField('name', true), 'name' => $acv->getField('name', true),
'description' => $acv->getField('description', true), 'description' => $acv->getField('description', true),
'iconname' => $acv->getField('iconString'),
'count' => $acv->getField('reqCriteriaCount'), 'count' => $acv->getField('reqCriteriaCount'),
'reward' => $acv->getField('reward', true), 'reward' => $acv->getField('reward', true),
'nCriteria' => count($acv->getCriteria()), 'nCriteria' => count($acv->getCriteria()),
@@ -151,7 +155,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'itemReward' => [], 'itemReward' => [],
'criteria' => [], 'criteria' => [],
'icons' => [] 'icons' => []
) ),
'relTabs' => []
); );
// create rewards // create rewards
@@ -302,9 +307,9 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'text' => $crtName, 'text' => $crtName,
); );
break; break;
// link to title // link to title - todo (low): crosslink
case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE: case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE:
// todo: crosslink $tmp['extra_text'] = Util::ucFirst(Lang::$game['title']).Lang::$colon.$crtName;
break; break;
// link to achivement (/w icon) // link to achivement (/w icon)
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT: case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT:
@@ -322,10 +327,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
break; break;
// link to quest // link to quest
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST:
$crtName = QuestList::getName($obj); // $crtName = ;
$tmp['link'] = array( $tmp['link'] = array(
'href' => '?quest='.$obj, 'href' => '?quest='.$obj,
'text' => $crtName ? $crtName : $crtName, 'text' => $crtName ? $crtName : QuestList::getName($obj),
); );
break; break;
// link to spell (/w icon) // link to spell (/w icon)
@@ -334,7 +339,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL: case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL: case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2: case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
$text = !empty($crtName) ? $crtName : SpellList::getName($obj); $text = $crtName ? $crtName : SpellList::getName($obj);
$tmp['link'] = array( $tmp['link'] = array(
'href' => '?spell='.$obj, 'href' => '?spell='.$obj,
'text' => $text 'text' => $text
@@ -371,10 +376,9 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
break; break;
// link to faction (/w target reputation) // link to faction (/w target reputation)
case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION: case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION:
$crtName = FactionList::getName($obj);
$tmp['link'] = array( $tmp['link'] = array(
'href' => '?faction='.$obj, 'href' => '?faction='.$obj,
'text' => $crtName ? $crtName : $crtName, 'text' => $crtName ? $crtName : FactionList::getName($obj),
); );
$tmp['extra_text'] = ' ('.Lang::getReputationLevelForPoints($qty).')'; $tmp['extra_text'] = ' ('.Lang::getReputationLevelForPoints($qty).')';
break; break;
@@ -390,6 +394,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$tmp['standard'] = true; $tmp['standard'] = true;
// Add a gold coin icon // Add a gold coin icon
$tmp['extra_text'] = $displayMoney ? Util::formatMoney($qty) : $crtName; $tmp['extra_text'] = $displayMoney ? Util::formatMoney($qty) : $crtName;
var_dump($tmp);
break; break;
} }
// If the right column // If the right column
@@ -406,20 +411,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$smarty->saveCache($cacheKeyPage, $pageData); $smarty->saveCache($cacheKeyPage, $pageData);
} }
$smarty->updatePageVars($pageData['page']);
// menuId 9: Achievement g_initPath()
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => $pageData['title'].' - '.Util::ucfirst(Lang::$game['achievement']),
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_ACHIEVEMENT,
'typeId' => $_id
));
$smarty->assign('redButtons', $pageData['buttons']);
$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, ['colon' => Lang::$colon])); $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$achievement, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['relTabs']);
// load the page // load the page
$smarty->display('achievement.tpl'); $smarty->display('achievement.tpl');

View File

@@ -40,11 +40,11 @@ if (!Util::isValidPage($validCats, $cats))
if (!$smarty->loadCache($cacheKey, $pageData, $filter)) if (!$smarty->loadCache($cacheKey, $pageData, $filter))
{ {
// include child categories if current category is empty // include child categories if current category is empty
$condition = !$cats[0] ? null : (int)end($cats); $condition = !empty($cats) ? [['category', (int)end($cats)]] : [];
$acvList = new AchievementList($condition ? [['category', $condition]] : [], true); $acvList = new AchievementList($condition, true);
if (!$acvList->getMatches()) if (!$acvList->getMatches())
{ {
$curCats = $catList = [$condition ? $condition : 0]; $curCats = $catList = [!empty($cats) ? (int)end($cats) : 0];
while ($curCats) while ($curCats)
{ {
$curCats = DB::Aowow()->SelectCol('SELECT Id FROM ?_achievementCategory WHERE parentCategory IN (?a)', $curCats); $curCats = DB::Aowow()->SelectCol('SELECT Id FROM ?_achievementCategory WHERE parentCategory IN (?a)', $curCats);
@@ -59,24 +59,32 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
$filter['fi'] = $acvList->filterGetForm(); $filter['fi'] = $acvList->filterGetForm();
// create page title and path // create page title and path
if (is_array($cats)) if ($cats)
{ {
$catrows = DB::Aowow()->Select('SELECT * FROM ?_achievementcategory WHERE id IN (?a)', $catrows = DB::Aowow()->Select('SELECT * FROM ?_achievementcategory WHERE id IN (?a)', $cats);
$cats
);
foreach ($catrows as $cat) foreach ($catrows as $cat)
{ {
$path[] = $cat['id']; $path[] = $cat['id'];
$title[] = Util::localizedString($cat, 'name'); $title[] = Util::localizedString($cat, 'name');
} }
array_unshift($title, Util::ucFirst(Lang::$game['achievements'])); array_unshift($title, Util::ucFirst(Lang::$game['achievements']));
} }
// listview content // page content
// menuId 9: Achievement g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'data' => $acvList->getListviewData(), 'page' => array(
'params' => [] 'title' => implode(" - ", $title),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0,
'subCat' => $pageParam ? '='.$pageParam : '',
'reqJS' => ['template/js/filters.js']
),
'lv' => array(
'data' => $acvList->getListviewData(),
'params' => []
)
); );
// fill g_items, g_titles, g_achievements // fill g_items, g_titles, g_achievements
@@ -84,20 +92,20 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
// if we are have different cats display field // if we are have different cats display field
if ($acvList->hasDiffFields(['category'])) if ($acvList->hasDiffFields(['category']))
$pageData['params']['visibleCols'] = "$['category']"; $pageData['lv']['params']['visibleCols'] = "$['category']";
if (!empty($filter['fi']['extraCols'])) if (!empty($filter['fi']['extraCols']))
$pageData['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)'; $pageData['lv']['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
// create note if search limit was exceeded // create note if search limit was exceeded
if ($acvList->getMatches() > SQL_LIMIT_DEFAULT) if ($acvList->getMatches() > SQL_LIMIT_DEFAULT)
{ {
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), SQL_LIMIT_DEFAULT); $pageData['lv']['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_achievementsfound', $acvList->getMatches(), SQL_LIMIT_DEFAULT);
$pageData['params']['_truncated'] = 1; $pageData['lv']['params']['_truncated'] = 1;
} }
if ($acvList->filterGetError()) if ($acvList->filterGetError())
$pageData['params']['_errors'] = '$1'; $pageData['lv']['params']['_errors'] = '$1';
$smarty->saveCache($cacheKey, $pageData, $filter); $smarty->saveCache($cacheKey, $pageData, $filter);
} }
@@ -106,20 +114,10 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
// sort for dropdown-menus // sort for dropdown-menus
asort(Lang::$game['si']); asort(Lang::$game['si']);
// menuId 9: Achievement g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => implode(" - ", $title),
'path' => "[".implode(", ", $path)."]",
'tab' => 0,
'subCat' => $pageParam ? '='.$pageParam : '',
'reqJS' => array(
'template/js/filters.js'
)
));
$smarty->assign('filter', $filter); $smarty->assign('filter', $filter);
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$achievement, ['colon' => Lang::$colon])); $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$achievement, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
$smarty->display('achievements.tpl'); $smarty->display('achievements.tpl');

View File

@@ -16,7 +16,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$cl = new CharClassList(array(['id', $_id])); $cl = new CharClassList(array(['id', $_id]));
if ($cl->error) if ($cl->error)
$smarty->notFound(Lang::$game['class']); $smarty->notFound(Lang::$game['class'], $_id);
/***********/ /***********/
/* Infobox */ /* Infobox */
@@ -61,22 +61,28 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
/* Main Content */ /* Main Content */
/****************/ /****************/
// menuId 12: Class g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array ( $pageData = 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( 'page' => array(
'title' => $cl->getField('name', true).' - '.Util::ucFirst(Lang::$game['class']),
'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_CLASS,
'typeId' => $_id,
'reqJS' => ['template/js/swfobject.js'],
'name' => $cl->getField('name', true), 'name' => $cl->getField('name', true),
'icon' => 'class_'.strtolower($cl->getField('fileString')), 'expansion' => Util::$expansionString[$cl->getField('expansion')],
'expansion' => Util::$expansionString[$cl->getField('expansion')] 'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
) 'headIcons' => ['class_'.strtolower($cl->getField('fileString'))],
'redButtons' => 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
)
),
'relTabs' => [],
); );
/**************/ /**************/
@@ -91,7 +97,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// '$LANG.tab_talents', // '$LANG.tab_talents',
$conditions = array( $conditions = array(
['s.typeCat', [-13, -11, -2, 7]], ['s.typeCat', [-13, -11, -2, 7]],
[['s.cuFlags', (SPELL_CU_TRIGGERED | SPELL_CU_EXCLUDE_CATEGORY_SEARCH), '&'], 0], [['s.cuFlags', (SPELL_CU_TRIGGERED | CUSTOM_EXCLUDE_FOR_LISTVIEW), '&'], 0],
[ [
'OR', 'OR',
['s.reqClassMask', $_mask, '&'], // Glyphs, Proficiencies ['s.reqClassMask', $_mask, '&'], // Glyphs, Proficiencies
@@ -150,7 +156,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'hiddenCols' => isset($hidden) ? $hidden : null, 'hiddenCols' => isset($hidden) ? $hidden : null,
'computeDataFunc' => '$Listview.funcBox.initSubclassFilter', 'computeDataFunc' => '$Listview.funcBox.initSubclassFilter',
'onAfterCreate' => '$Listview.funcBox.addSubclassIndicator', 'onAfterCreate' => '$Listview.funcBox.addSubclassIndicator',
'note' => sprintf(Util::$filterResultString, '?items&filter=cr=152;crs=4;crv=0'), 'note' => sprintf(Util::$filterResultString, '?items&filter=cr=152;crs='.$_id.';crv=0'),
'_truncated' => 1 '_truncated' => 1
) )
); );
@@ -191,8 +197,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// Tab: Trainer // Tab: Trainer
$conditions = array( $conditions = array(
['npcflag', 0x30, '&'], // is trainer ['npcflag', 0x30, '&'], // is trainer
['trainer_type', 0], // trains class spells ['trainerType', 0], // trains class spells
['trainer_class', $_id] ['trainerClass', $_id]
); );
$trainer = new CreatureList($conditions); $trainer = new CreatureList($conditions);
@@ -222,24 +228,12 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
// menuId 12: Class g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => $pageData['title'],
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_CLASS,
'typeId' => $_id,
'reqJS' => array(
'template/js/swfobject.js'
)
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_CLASS, $_id)); // comments, screenshots, videos $smarty->assign('community', CommunityContent::getAll(TYPE_CLASS, $_id)); // comments, screenshots, videos
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['relTabs']);
// load the page // load the page
$smarty->display('class.tpl'); $smarty->display('detail-page-generic.tpl');
?> ?>

View File

@@ -10,8 +10,15 @@ if (!$smarty->loadCache($cacheKey, $pageData))
{ {
$classes = new CharClassList(); $classes = new CharClassList();
// menuId 12: Class g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'listviews' => array( 'page' => array(
'title' => Util::ucFirst(Lang::$game['classes']),
'path' => "[0, 12]",
'tab' => 0
),
'lv' => array(
array( array(
'file' => 'class', 'file' => 'class',
'data' => $classes->getListviewData(), 'data' => $classes->getListviewData(),
@@ -24,17 +31,11 @@ if (!$smarty->loadCache($cacheKey, $pageData))
} }
// menuId 12: Class g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => Util::ucFirst(Lang::$game['classes']),
'path' => "[0, 12]",
'tab' => 0
));
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
$smarty->display('generic-no-filter.tpl'); $smarty->display('list-page-generic.tpl');
?> ?>

View File

@@ -4,7 +4,25 @@ if (!defined('AOWOW_REVISION'))
die('invalid access'); die('invalid access');
$pageData = ['items' => null, 'summary' => '[]'];
// tabId 1: Tools g_initHeader()
$pageData = array(
'items' => null,
'summary' => '[]',
'title' => Lang::$main['compareTool'],
'tab' => 1,
'reqCSS' => array(
['path' => 'template/css/Summary.css'],
['path' => 'template/css/Summary_ie6.css', 'ieCond' => 'lte IE 6'],
),
'reqJS' => array(
'template/js/Draggable.js',
'template/js/filters.js',
'template/js/Summary.js',
'template/js/swfobject.js',
'?data=weight-presets.gems.enchants.itemsets'
)
);
$compareString = ''; $compareString = '';
// prefer $_GET over $_COOKIE // prefer $_GET over $_COOKIE
@@ -16,7 +34,7 @@ else if (!empty($_COOKIE['compare_groups']))
if ($compareString) if ($compareString)
{ {
$sets = explode(";", $compareString); $sets = explode(";", $compareString);
$items = []; $items = $outSet = [];
foreach ($sets as $set) foreach ($sets as $set)
{ {
$itemsting = explode(":", $set); $itemsting = explode(":", $set);
@@ -54,23 +72,7 @@ if ($compareString)
} }
// tabId 1: Tools g_initHeader() $smarty->updatePageVars($pageData);
$smarty->updatePageVars(array(
'title' => Lang::$main['compareTool'],
'tab' => 1,
'reqCSS' => array(
['path' => 'template/css/Summary.css'],
['path' => 'template/css/Summary_ie6.css', 'ieCond' => 'lte IE 6'],
),
'reqJS' => array(
'template/js/Draggable.js',
'template/js/filters.js',
'template/js/Summary.js',
'template/js/swfobject.js',
'?data=weight-presets.gems.enchants.itemsets'
),
));
$smarty->assign('lvData', $pageData);
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
// load the page // load the page

View File

@@ -4,52 +4,52 @@ if (!defined('AOWOW_REVISION'))
die('illegal access'); die('illegal access');
$cat = Util::extractURLParams($pageParam)[0]; $cat = Util::extractURLParams($pageParam);
$path = [0, 15]; $path = [0, 15];
$validCats = [1, 2, 3, 22]; $validCats = [1, 2, 3, 22];
$title = [Util::ucFirst(Lang::$game['currencies'])]; $title = [Util::ucFirst(Lang::$game['currencies'])];
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_CURRENCY, -1, isset($cat) ? $cat : -1, User::$localeId]); $cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_CURRENCY, -1, $cat ? $cat[0] : -1, User::$localeId]);
if (!Util::isValidPage($validCats, $cat)) if (!Util::isValidPage($validCats, $cat))
$smarty->error(); $smarty->error();
if (isset($cat)) if ($cat)
{ {
$path[] = $cat; // should be only one parameter anyway $path[] = $cat[0]; // should be only one parameter anyway
array_unshift($title, Lang::$currency['cat'][$cat]); array_unshift($title, Lang::$currency['cat'][$cat[0]]);
} }
if (!$smarty->loadCache($cacheKey, $pageData)) if (!$smarty->loadCache($cacheKey, $pageData))
{ {
$pageData = array( $money = new CurrencyList($cat ? array(['category', (int)$cat[0]]) : []);
'listviews' => []
);
$money = new CurrencyList(isset($cat) ? array(['category', (int)$cat]) : []);
$pageData['listviews'][] = array(
'file' => 'currency',
'data' => $money->getListviewData(),
'params' => []
);
$money->addGlobalsToJscript($smarty); $money->addGlobalsToJscript($smarty);
// menuId 15: Currency g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array(
'page' => array(
'tab' => 0,
'title' => implode(" - ", $title),
'path' => json_encode($path, JSON_NUMERIC_CHECK)
),
'lv' => array(
array(
'file' => 'currency',
'data' => $money->getListviewData(),
'params' => []
)
)
);
$smarty->saveCache($cacheKey, $pageData); $smarty->saveCache($cacheKey, $pageData);
} }
// menuId 15: Currency g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'tab' => 0,
'title' => implode(" - ", $title),
'path' => "[".implode(", ", $path)."]"
));
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
$smarty->display('generic-no-filter.tpl'); $smarty->display('list-page-generic.tpl');
?> ?>

View File

@@ -6,7 +6,8 @@ if (!defined('AOWOW_REVISION'))
require 'includes/community.class.php'; require 'includes/community.class.php';
$_id = intVal($pageParam); $_id = intVal($pageParam);
$_path = [0, 15];
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_CURRENCY, $_id, -1, User::$localeId]); $cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_CURRENCY, $_id, -1, User::$localeId]);
@@ -14,34 +15,47 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$currency = new CurrencyList(array(['id', $_id])); $currency = new CurrencyList(array(['id', $_id]));
if ($currency->error) if ($currency->error)
$smarty->notFound(Lang::$game['skill']); $smarty->notFound(Lang::$game['skill'], $_id);
$_cat = $currency->getField('category'); $_cat = $currency->getField('category');
$_itemId = $currency->getField('itemId'); $_itemId = $currency->getField('itemId');
$_isSpecial = $_id == 103 || $_id == 104; // honor && arena points are not handled as items $_isSpecial = $_id == 103 || $_id == 104; // honor && arena points are not handled as items
$_path[] = $_cat;
/***********/
/* Infobox */
/**********/
$infobox = '';
if ($_id == 103) // Arena Points
$infobox = '[ul][li]'.Lang::$currency['cap'].Lang::$colon.'10\'000[/li][/ul]';
else if ($_id == 104) // Honor
$infobox = '[ul][li]'.Lang::$currency['cap'].Lang::$colon.'75\'000[/li][/ul]';
/****************/ /****************/
/* Main Content */ /* Main Content */
/****************/ /****************/
// menuId 14: Skill g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'title' => $currency->getField('name', true),
'path' => [0, 15],
'relTabs' => [],
'buttons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => true
),
'page' => array( 'page' => array(
'name' => $currency->getField('name', true), 'title' => $currency->getField('name', true)." - ".Util::ucfirst(Lang::$game['skill']),
'icon' => $currency->getField('iconString'), 'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'id' => $_id 'tab' => 0,
'type' => TYPE_CURRENCY,
'typeId' => $_id,
'infobox' => $infobox,
'name' => $currency->getField('name', true),
'headIcons' => [$currency->getField('iconString')],
'redButtons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => true
)
), ),
'relTabs' => []
); );
if ($_cat)
$pageData['path'][] = $_cat;
/**************/ /**************/
/* Extra Tabs */ /* Extra Tabs */
/**************/ /**************/
@@ -148,7 +162,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// tab: created by (spell) [for items its handled in Util::getLootSource()] // tab: created by (spell) [for items its handled in Util::getLootSource()]
if ($_id == 104) if ($_id == 104)
{ {
$createdBy = new SpellList(array(['effect1Id', 45], ['effect2Id', 45], ['effect3Id', 45], 'OR'])); $createdBy = new SpellList(array(['effect1Id', 45], ['effect2Id', 45], ['effect3Id', 45], 'OR'));
if (!$createdBy->error) if (!$createdBy->error)
{ {
if ($createdBy->hasSetFields(['reagent1'])) if ($createdBy->hasSetFields(['reagent1']))
@@ -203,21 +217,12 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$smarty->saveCache($cacheKeyPage, $pageData); $smarty->saveCache($cacheKeyPage, $pageData);
} }
// menuId 14: Skill g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => $pageData['title']." - ".Util::ucfirst(Lang::$game['skill']),
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_CURRENCY,
'typeId' => $_id
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_CURRENCY, $_id)); // comments, screenshots, videos $smarty->assign('community', CommunityContent::getAll(TYPE_CURRENCY, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main)); $smarty->assign('lang', array_merge(Lang::$main));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['relTabs']);
// load the page // load the page
$smarty->display('skill.tpl'); $smarty->display('detail-page-generic.tpl');
?> ?>

190
pages/event.php Normal file
View File

@@ -0,0 +1,190 @@
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
require 'includes/community.class.php';
$_id = intVal($pageParam);
$_path = [0, 11];
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_WORLDEVENT, $_id, -1, User::$localeId]);
if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
$conditions = [];
if ($_id < 0)
$conditions[] = ['id', -$_id];
else
$conditions[] = ['holidayId', $_id];
$event = new WorldEventList($conditions);
if ($event->error)
$smarty->notFound(Lang::$game['event'], $_id);
$hId = $event->getField('holidayId');
// redirect if associated with a holiday
if ($hId && $_id != $hId)
header('Location: '.STATIC_URL.'?event='.$hId);
if ($hId)
{
switch ($event->getField('scheduleType'))
{
case -1: $_path[] = 1; break;
case 0:
case 1: $_path[] = 2; break;
case 2: $_path[] = 3; break;
}
}
else
$_path[] = 0;
/***********/
/* Infobox */
/***********/
$infobox = [];
// - boss
// - faction (only darkmoon faire)
// finalized after the cache is handled
/****************/
/* Main Content */
/****************/
// menuId 11: Event g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array(
'dates' => array(
'firstDate' => $event->getField('startTime'),
'lastDate' => $event->getField('endTime'),
'length' => $event->getField('length'),
'rec' => $event->getField('occurence')
),
'page' => array(
'title' => $event->getField('name', true).' - '.Util::ucFirst(Lang::$game['event']),
'name' => $event->getField('name', true),
'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_WORLDEVENT,
'typeId' => $_id,
'infobox' => $infobox,
'headIcons' => [$event->getField('iconString')],
'redButtons' => array(
BUTTON_WOWHEAD => $_id > 0,
BUTTON_LINKS => true
)
),
'relTabs' => []
);
/**************/
/* Extra Tabs */
/**************/
// NPC spawns
// GO spawns
// Quests
// Items requiring Holiday
// tab: see also (event conditions)
$eId = $event->getField('eventBak');
if($rel = DB::Aowow()->selectCol('SELECT IF(eventEntry = prerequisite_event, NULL, IF(eventEntry = ?d, -prerequisite_event, eventEntry)) FROM game_event_prerequisite WHERE prerequisite_event = ?d OR eventEntry = ?d', $eId, $eId, $eId))
{
$list = [];
array_walk($rel, function(&$v, $k) use (&$list) {
if ($v > 0)
$list[] = $v;
else if ($v == null)
Util::$pageTemplate->internalNotice(U_GROUP_EMPLOYEE, 'game_event_prerequisite: this event has itself as prerequisite');
});
$relEvents = new WorldEventList(array(['id', $list]));
$relEvents->addGlobalsToJscript(Util::$pageTemplate);
$relData = $relEvents->getListviewData(true);
foreach ($relEvents->iterate() as $id => $__)
{
$relData[$id]['condition'] = array(
'type' => TYPE_WORLDEVENT,
'typeId' => -$eId,
'status' => 2
);
}
$event->addGlobalsToJscript(Util::$pageTemplate);
foreach ($rel as $r)
{
if ($r >= 0)
continue;
Util::$pageTemplate->extendGlobalIds(TYPE_WORLDEVENT, -$r);
$d = $event->getListviewData(true);
$d[-$eId]['condition'] = array(
'type' => TYPE_WORLDEVENT,
'typeId' => $r,
'status' => 2
);
$relData= array_merge($relData, $d);
}
$pageData['relTabs'][] = array(
'file' => 'event',
'data' => $relData,
'params' => array(
'id' => 'see-also',
'name' => '$LANG.tab_seealso',
'tabs' => '$tabsRelated',
'hiddenCols' => "$['date']",
'extraCols' => '$[Listview.extraCols.condition]'
)
);
}
$smarty->saveCache($cacheKeyPage, $pageData);
}
/***********/
/* Infobox */
/***********/
$updated = WorldEventList::updateDates($pageData['dates']);
// in progress
if ($updated['start'] < time() && $updated['end'] > time())
array_unshift($pageData['page']['infobox'], '[span class=q2]'.Lang::$event['inProgress'].'[/span]');
// occurence
if ($updated['rec'] > 0)
array_unshift($pageData['page']['infobox'], Lang::$event['interval'].Lang::$colon.Util::formatTime($updated['rec'] * 1000));
// end
if ($updated['end'])
array_unshift($pageData['page']['infobox'], Lang::$event['end'].Lang::$colon.date(Lang::$dateFmtLong, $updated['end']));
// start
if ($updated['end'])
array_unshift($pageData['page']['infobox'], Lang::$event['start'].Lang::$colon.date(Lang::$dateFmtLong, $updated['start']));
$pageData['page']['infobox'] = '[ul][li]'.implode('[/li][li]', $pageData['page']['infobox']).'[/li][/ul]';
$smarty->updatePageVars($pageData['page']);
$smarty->assign('community', CommunityContent::getAll(TYPE_WORLDEVENT, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main));
$smarty->assign('lvData', $pageData['relTabs']);
// load the page
$smarty->display('detail-page-generic.tpl');
?>

View File

@@ -4,61 +4,59 @@ if (!defined('AOWOW_REVISION'))
die('illegal access'); die('illegal access');
$cat = Util::extractURLParams($pageParam)[0]; $cat = Util::extractURLParams($pageParam);
$condition = []; $condition = [];
$path = [0, 11]; $path = [0, 11];
$validCats = [0, 1, 2, 3]; $validCats = [0, 1, 2, 3];
$title = [Lang::$game['events']]; $title = [Lang::$game['events']];
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_WORLDEVENT, -1, $cat, User::$localeId]); $cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_WORLDEVENT, -1, $cat ? $cat[0] : -1, User::$localeId]);
if (!Util::isValidPage($validCats, $cat)) if (!Util::isValidPage($validCats, $cat))
$smarty->error(); $smarty->error();
$path[] = $cat;
if (isset($cat))
array_unshift($title, Lang::$event['category'][$cat]);
if (!$smarty->loadCache($cacheKey, $pageData)) if (!$smarty->loadCache($cacheKey, $pageData))
{ {
if ($cat !== null) if ($cat)
{ {
switch ($cat) $path[] = $cat[0];
array_unshift($title, Lang::$event['category'][$cat[0]]);
switch ($cat[0])
{ {
case 0: case 0: $condition[] = ['e.holidayId', 0]; break;
$condition[] = ['holidayId', 0]; case 1: $condition[] = ['h.scheduleType', -1]; break;
break; case 2: $condition[] = ['h.scheduleType', [0, 1]]; break;
case 1: case 3: $condition[] = ['h.scheduleType', 2]; break;
$condition[] = ['scheduleType', -1];
break;
case 2:
$condition[] = ['scheduleType', [0, 1]];
break;
case 3:
$condition[] = ['scheduleType', 2];
break;
} }
} }
$events = new WorldEventList($condition); $events = new WorldEventList($condition);
$events->addGlobalsToJScript($smarty);
$deps = []; $deps = [];
foreach ($events->iterate() as $__) foreach ($events->iterate() as $__)
if ($d = $events->getField('requires')) if ($d = $events->getField('requires'))
$deps[$events->id] = $d; $deps[$events->id] = $d;
// menuId 11: Event g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'listviews' => [], 'page' => array(
'deps' => $deps 'tab' => 0,
'title' => implode(" - ", $title),
'path' => json_encode($path, JSON_NUMERIC_CHECK)
),
'lv' => [],
'deps' => $deps
); );
$pageData['listviews'][] = array( $pageData['lv'][] = array(
'file' => 'event', 'file' => 'event',
'data' => $events->getListviewData(), 'data' => $events->getListviewData(),
'params' => ['tabs' => '$myTabs'] 'params' => ['tabs' => '$myTabs']
); );
$pageData['listviews'][] = array( $pageData['lv'][] = array(
'file' => 'calendar', 'file' => 'calendar',
'data' => array_filter($events->getListviewData(), function($x) {return $x['id'] > 0;}), 'data' => array_filter($events->getListviewData(), function($x) {return $x['id'] > 0;}),
'params' => array( 'params' => array(
@@ -67,13 +65,11 @@ if (!$smarty->loadCache($cacheKey, $pageData))
) )
); );
$events->addGlobalsToJScript($smarty);
$smarty->saveCache($cacheKey, $pageData); $smarty->saveCache($cacheKey, $pageData);
} }
// recalculate dates with now(); can't be cached, obviously // recalculate dates with now(); can't be cached, obviously
foreach ($pageData['listviews'] as &$views) foreach ($pageData['lv'] as &$views)
{ {
foreach ($views['data'] as &$data) foreach ($views['data'] as &$data)
{ {
@@ -81,27 +77,24 @@ foreach ($pageData['listviews'] as &$views)
if (!empty($pageData['deps'][$data['id']])) if (!empty($pageData['deps'][$data['id']]))
{ {
$data['startDate'] = $data['endDate'] = false; $data['startDate'] = $data['endDate'] = false;
unset($data['_date']);
continue; continue;
} }
$updated = WorldEventList::updateDates($data['startDate'], $data['endDate'], $data['rec']); $updated = WorldEventList::updateDates($data['_date']);
$data['startDate'] = $updated['start'] ? date(Util::$dateFormatLong, $updated['start']) : false; unset($data['_date']);
$data['endDate'] = $updated['end'] ? date(Util::$dateFormatLong, $updated['end']) : false; $data['startDate'] = $updated['start'] ? date(Util::$dateFormatInternal, $updated['start']) : false;
$data['endDate'] = $updated['end'] ? date(Util::$dateFormatInternal, $updated['end']) : false;
$data['rec'] = $updated['rec'];
} }
} }
// menuId 11: Event g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => implode(" - ", $title),
'path' => "[".implode(", ", $path)."]",
'tab' => 0
));
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
$smarty->display('generic-no-filter.tpl'); $smarty->display('list-page-generic.tpl');
?> ?>

View File

@@ -6,7 +6,8 @@ if (!defined('AOWOW_REVISION'))
require 'includes/community.class.php'; require 'includes/community.class.php';
$_id = intVal($pageParam); $_id = intVal($pageParam);
$_path = [0, 7];
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_FACTION, $_id, -1, User::$localeId]); $cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_FACTION, $_id, -1, User::$localeId]);
@@ -14,12 +15,17 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$faction = new FactionList(array(['id', $_id])); $faction = new FactionList(array(['id', $_id]));
if ($faction->error) if ($faction->error)
$smarty->notFound(Lang::$game['faction']); $smarty->notFound(Lang::$game['faction'], $_id);
if ($_ = $faction->getField('cat2'))
$_path[] = $_;
if ($_ = $faction->getField('cat'))
$_path[] = $_;
/***********/ /***********/
/* Infobox */ /* Infobox */
/***********/ /***********/
$infobox = []; $infobox = [];
// Quartermaster if any // Quartermaster if any
@@ -51,29 +57,36 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
/* Main Content */ /* Main Content */
/****************/ /****************/
// menuId 7: Faction g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'title' => $faction->getField('name', true), 'page' => array(
'path' => [0, 7], 'title' => $faction->getField('name', true)." - ".Util::ucfirst(Lang::$game['faction']),
'relTabs' => [], 'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'spillover' => null, 'tab' => 0,
'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null, 'type' => TYPE_FACTION,
'buttons' => array( 'typeId' => $_id,
BUTTON_WOWHEAD => true, 'extraText' => '',
BUTTON_LINKS => true 'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null,
), 'redButtons' => array(
'page' => array( BUTTON_WOWHEAD => true,
'name' => $faction->getField('name', true), BUTTON_LINKS => true
'id' => $_id ),
'name' => $faction->getField('name', true)
), ),
'relTabs' => []
); );
if ($_ = $faction->getField('cat2'))
$pageData['path'][] = $_;
if ($_ = $faction->getField('cat'))
$pageData['path'][] = $_;
// Spillover Effects // Spillover Effects
/* todo (low): also check on reputation_spillover_template (but its data is identical to calculation below
$rst = DB::Aowow()->selectRow('SELECT
CONCAT_WS(" ", faction1, faction2, faction3, faction4) AS faction,
CONCAT_WS(" ", rate_1, rate_2, rate_3, rate_4) AS rate,
CONCAT_WS(" ", rank_1, rank_2, rank_3, rank_4) AS rank
FROM reputation_spillover_template WHERE faction = ?d', $_id);
*/
$conditions = array( $conditions = array(
['id', $_id, '!'], // not self ['id', $_id, '!'], // not self
['reputationIndex', -1, '!'] // only gainable ['reputationIndex', -1, '!'] // only gainable
@@ -93,7 +106,36 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$buff[] = '[tr][td][faction='.$spillId.'][/td][td][span class=q'.($val > 0 ? '2]+' : '10]').$val.'%[/span][/td][td]'.Lang::$game['rep'][$spillover->getField('spilloverMaxRank')].'[/td][/tr]'; $buff[] = '[tr][td][faction='.$spillId.'][/td][td][span class=q'.($val > 0 ? '2]+' : '10]').$val.'%[/span][/td][td]'.Lang::$game['rep'][$spillover->getField('spilloverMaxRank')].'[/td][/tr]';
if ($buff) if ($buff)
$pageData['spillover'] = '[h3 class=clear]'.Lang::$faction['spillover'].'[/h3][div margin=15px]'.Lang::$faction['spilloverDesc'].'[/div][table class=grid width=400px][tr][td width=150px][b]'.Util::ucFirst(Lang::$game['faction']).'[/b][/td][td width=100px][b]'.Lang::$spell['_value'].'[/b][/td][td width=150px][b]'.Lang::$faction['maxStanding'].'[/b][/td][/tr]'.implode('', $buff).'[/table]'; $pageData['page']['extraText'] .= '[h3 class=clear]'.Lang::$faction['spillover'].'[/h3][div margin=15px]'.Lang::$faction['spilloverDesc'].'[/div][table class=grid width=400px][tr][td width=150px][b]'.Util::ucFirst(Lang::$game['faction']).'[/b][/td][td width=100px][b]'.Lang::$spell['_value'].'[/b][/td][td width=150px][b]'.Lang::$faction['maxStanding'].'[/b][/td][/tr]'.implode('', $buff).'[/table]';
// reward rates
if ($rates = DB::Aowow()->selectRow('SELECT * FROM reputation_reward_rate WHERE faction = ?d', $_id))
{
$buff = '[h3 class=clear][Custom Reward Rate][/h3][table width=100px]';
foreach ($rates as $k => $v)
{
if ($v == 1)
continue;
switch ($k)
{
case 'quest_rate': $buff .= '[tr][td]Quests:[/td]'; break;
case 'quest_daily_rate': $buff .= '[tr][td]Daily Quests:[/td]'; break;
case 'quest_weekly_rate': $buff .= '[tr][td]Weekly Quests:[/td]'; break;
case 'quest_monthly_rate': $buff .= '[tr][td]Monthly Quests:[/td]'; break;
case 'creature_rate': $buff .= '[tr][td]Creatures:[/td]'; break;
case 'spell_rate': $buff .= '[tr][td]Spells:[/td]'; break;
}
$buff .= '[td]x'.number_format($v, 1).'[/td][/tr]';
}
$buff .= '[/table]';
$pageData['page']['extraText'] .= $buff;
}
/**************/ /**************/
/* Extra Tabs */ /* Extra Tabs */
@@ -119,25 +161,32 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
// tab: creatures with onKill reputation // tab: creatures with onKill reputation
$cIds = DB::Aowow()->selectCol('SELECT DISTINCT creature_id FROM creature_onkill_reputation cor, ?_factions f WHERE if ($faction->getField('reputationIndex') != -1) // only if you can actually gain reputation by kills
(RewOnKillRepValue1 > 0 AND (RewOnKillRepFaction1 = ?d OR (cor.RewOnKillRepFaction1 = f.id AND f.parentFactionId = ?d AND IsTeamAward1 <> 0))) OR
(RewOnKillRepValue2 > 0 AND (RewOnKillRepFaction2 = ?d OR (cor.RewOnKillRepFaction2 = f.id AND f.parentFactionId = ?d AND IsTeamAward2 <> 0)))',
$_id, $faction->getField('parentFactionId'),
$_id, $faction->getField('parentFactionId')
);
$killCreatures = new CreatureList(array(['id', $cIds]));
if (!$killCreatures->error)
{ {
$killCreatures->addGlobalsToJscript($smarty); $cIds = DB::Aowow()->selectCol('SELECT DISTINCT cor.creature_id FROM creature_onkill_reputation cor, ?_factions f WHERE
(cor.RewOnKillRepValue1 > 0 AND (cor.RewOnKillRepFaction1 = ?d OR (cor.RewOnKillRepFaction1 = f.id AND f.parentFactionId = ?d AND cor.IsTeamAward1 <> 0))) OR
$pageData['relTabs'][] = array( (cor.RewOnKillRepValue2 > 0 AND (cor.RewOnKillRepFaction2 = ?d OR (cor.RewOnKillRepFaction2 = f.id AND f.parentFactionId = ?d AND cor.IsTeamAward2 <> 0)))',
'file' => 'npc', $_id, $faction->getField('parentFactionId'),
'data' => $killCreatures->getListviewData(), $_id, $faction->getField('parentFactionId')
'showRep' => true,
'params' => array(
'tabs' => '$tabsRelated',
)
); );
if ($cIds)
{
$killCreatures = new CreatureList(array(['id', $cIds]));
if (!$killCreatures->error)
{
$killCreatures->addGlobalsToJscript($smarty);
$pageData['relTabs'][] = array(
'file' => 'creature',
'data' => $killCreatures->getListviewData(),
'showRep' => true,
'params' => array(
'tabs' => '$tabsRelated',
)
);
}
}
} }
// tab: members // tab: members
@@ -153,12 +202,12 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$killCreatures->addGlobalsToJscript($smarty); $killCreatures->addGlobalsToJscript($smarty);
$pageData['relTabs'][] = array( $pageData['relTabs'][] = array(
'file' => 'npc', 'file' => 'creature',
'data' => $killCreatures->getListviewData(), 'data' => $killCreatures->getListviewData(),
'showRep' => true, 'showRep' => true,
'params' => array( 'params' => array(
'id' => 'member', 'id' => 'member',
'name' => '$LANG.tab_member', 'name' => '$LANG.tab_members',
'tabs' => '$tabsRelated', 'tabs' => '$tabsRelated',
) )
); );
@@ -216,21 +265,12 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
// menuId 7: Faction g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => $pageData['title']." - ".Util::ucfirst(Lang::$game['skill']),
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_FACTION,
'typeId' => $_id
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_FACTION, $_id)); // comments, screenshots, videos $smarty->assign('community', CommunityContent::getAll(TYPE_FACTION, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, [Lang::$colon])); $smarty->assign('lang', array_merge(Lang::$main, [Lang::$colon]));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['relTabs']);
// load the page // load the page
$smarty->display('faction.tpl'); $smarty->display('detail-page-generic.tpl');
?> ?>

View File

@@ -22,7 +22,7 @@ if (!$smarty->loadCache($cacheKey, $pageData))
{ {
$conditions = []; $conditions = [];
if (User::isInGroup(U_GROUP_STAFF)) if (!User::isInGroup(U_GROUP_STAFF))
$conditions[] = ['reputationIndex', -1, '!']; // unlisted factions $conditions[] = ['reputationIndex', -1, '!']; // unlisted factions
if (isset($cats[0]) && empty($cats[1])) if (isset($cats[0]) && empty($cats[1]))
@@ -48,10 +48,15 @@ if (!$smarty->loadCache($cacheKey, $pageData))
$factions = new FactionList($conditions); $factions = new FactionList($conditions);
// menuId 7: Faction g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'title' => $title, 'page' => array(
'path' => $path, 'title' => implode(' - ', $title),
'listviews' => array( 'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0
),
'lv' => array(
array( array(
'file' => 'faction', 'file' => 'faction',
'data' => $factions->getListviewData(), 'data' => $factions->getListviewData(),
@@ -64,17 +69,11 @@ if (!$smarty->loadCache($cacheKey, $pageData))
} }
// menuId 7: Faction g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => implode(' - ', $title),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0
));
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
$smarty->display('generic-no-filter.tpl'); $smarty->display('list-page-generic.tpl');
?> ?>

View File

@@ -9,7 +9,8 @@ if (isset($_GET['xml']))
require 'includes/community.class.php'; require 'includes/community.class.php';
$_id = intVal($pageParam); $_id = intVal($pageParam);
$_path = [0, 0];
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ITEM, $_id, -1, User::$localeId]); $cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ITEM, $_id, -1, User::$localeId]);
@@ -247,65 +248,80 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
$cmpUpg = in_array($_class, [ITEM_CLASS_WEAPON, ITEM_CLASS_ARMOR]) || $item->getField('gemEnchantmentId'); $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'); $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' => [],
'tooltip' => $item->renderTooltip([], true),
'path' => [0, 0],
'title' => [$item->getField('name', true), Util::ucFirst(Lang::$game['item'])],
'pageText' => [],
'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(
'quality' => $item->getField('quality'),
'icon' => $item->getField('iconString'),
'name' => $item->getField('name', true),
'stack' => $item->getField('stackable'),
)
);
// path // path
if (in_array($_class, [5, 8, 14])) if (in_array($_class, [5, 8, 14]))
{ {
$pageData['path'][] = 15; // misc. $_path[] = 15; // misc.
if ($_class == 5) // reagent if ($_class == 5) // reagent
$pageData['path'][] = 1; $_path[] = 1;
else else
$pageData['path'][] = 4; // other $_path[] = 4; // other
} }
else else
{ {
$pageData['path'][] = $_class; $_path[] = $_class;
if (!in_array($_class, [ITEM_CLASS_MONEY, ITEM_CLASS_QUEST, ITEM_CLASS_KEY])) if (!in_array($_class, [ITEM_CLASS_MONEY, ITEM_CLASS_QUEST, ITEM_CLASS_KEY]))
$pageData['path'][] = $_subClass; $_path[] = $_subClass;
if ($_class == ITEM_CLASS_ARMOR && in_array($_subClass, [1, 2, 3, 4])) if ($_class == ITEM_CLASS_ARMOR && in_array($_subClass, [1, 2, 3, 4]))
{ {
if ($_ = $_slot); if ($_ = $_slot);
$pageData['path'][] = $_; $_path[] = $_;
} }
else if (($_class == ITEM_CLASS_CONSUMABLE && $_subClass == 2) || $_class == ITEM_CLASS_GLYPH) else if (($_class == ITEM_CLASS_CONSUMABLE && $_subClass == 2) || $_class == ITEM_CLASS_GLYPH)
$pageData['path'][] = $item->getField('subSubClass'); $_path[] = $item->getField('subSubClass');
} }
// pageText // pageText
$pageText = [];
if ($next = $item->getField('pageTextId')) if ($next = $item->getField('pageTextId'))
{ {
while ($next) while ($next)
{ {
$row = DB::Aowow()->selectRow('SELECT *, text as Text_loc0 FROM page_text pt LEFT JOIN locales_page_text lpt ON pt.entry = lpt.entry WHERE pt.entry = ?d', $next); $row = DB::Aowow()->selectRow('SELECT *, text as Text_loc0 FROM page_text pt LEFT JOIN locales_page_text lpt ON pt.entry = lpt.entry WHERE pt.entry = ?d', $next);
$next = $row['next_page']; $next = $row['next_page'];
$pageData['pageText'][] = Util::parseHtmlText(Util::localizedString($row, 'Text')); $pageText[] = Util::parseHtmlText(Util::localizedString($row, 'Text'));
} }
} }
// menuId 0: Item g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array(
'page' => array(
'quality' => $item->getField('quality'),
'headIcons' => [$item->getField('iconString'), $item->getField('stackable')],
'name' => $item->getField('name', true),
'infobox' => $quickInfo ? '[ul][li]'.implode('[/li][li]', $quickInfo).'[/li][/ul]' : null,
'tooltip' => $item->renderTooltip([], true),
'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'title' => $item->getField('name', true).' - '.Util::ucFirst(Lang::$game['item']),
'pageText' => $pageText,
'tab' => 0,
'type' => TYPE_ITEM,
'typeId' => $_id,
'reqJS' => array(
$pageText ? 'template/js/Book.js' : null,
'template/js/swfobject.js',
'template/js/profile.js',
'template/js/filters.js',
'?data=weight-presets'
),
'reqCSS' => array(
$pageText ? ['path' => 'template/css/Book.css'] : null,
),
'redButtons' => 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
),
),
'relTabs' => []
);
// subItems // subItems
$item->initSubItems(); $item->initSubItems();
if (!empty($item->subItems[$_id])) if (!empty($item->subItems[$_id]))
@@ -686,7 +702,7 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
// tab: same model as // tab: same model as
if (($model = $item->getField('model')) && $_slot) if (($model = $item->getField('model')) && $_slot)
{ {
$sameModel = new ItemList(array(['model', $model], ['id', $_id, '!'])); $sameModel = new ItemList(array(['model', $model], ['id', $_id, '!'], ['slot', $_slot]));
if (!$sameModel->error) if (!$sameModel->error)
{ {
$sameModel->addGlobalsToJscript($smarty, GLOBALINFO_SELF); $sameModel->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
@@ -731,42 +747,38 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
$currency[] = [-$id, $qty]; $currency[] = [-$id, $qty];
} }
if ($_ = $vendors[$k]['event']) $row['stock'] = $vendors[$k]['maxcount'];
$row['cost'] = [$item->getField('buyPrice')];
if ($e = $vendors[$k]['eventId'])
{ {
if (count($extraCols) == 3) // not already pushed if (count($extraCols) == 3)
$extraCols[] = 'Listview.extraCols.condition'; $extraCols[] = 'Listview.extraCols.condition';
$holidays[$_] = 0; // applied as back ref. Util::$pageTemplate->extendGlobalIds(TYPE_WORLDEVENT, $e);
$row['condition'] = array( $row['condition'] = array(
'type' => TYPE_WORLDEVENT, 'type' => TYPE_WORLDEVENT,
'typeId' => &$holidays[$_], 'typeId' => -$e,
'status' => 1 'status' => 1
); );
} }
$row['stock'] = $vendors[$k]['stock'];
$row['stack'] = $item->getField('buyCount');
$row['cost'] = [$this->getField('buyPrice')];
if ($currency || $tokens) // fill idx:3 if required if ($currency || $tokens) // fill idx:3 if required
$row['cost'][] = $currency; $row['cost'][] = $currency;
if ($tokens) if ($tokens)
$row['cost'][] = $tokens; $row['cost'][] = $tokens;
if ($x = $item->getField('buyPrice'))
$row['buyprice'] = $x;
if ($x = $item->getField('sellPrice'))
$row['sellprice'] = $x;
if ($x = $item->getField('buyCount'))
$row['stack'] = $x;
} }
if ($holidays)
{
$hObj = new WorldEventList(array(['id', array_keys($holidays)]));
$hObj->addGlobalsToJscript($smarty);
foreach ($hObj->iterate() as $id => $tpl)
{
if ($_ = $tpl['holidayId'])
$holidays[$tpl['eventBak']] = $_;
else
$holidays[-$id] = $id;
}
}
$pageData['relTabs'][] = array( $pageData['relTabs'][] = array(
'file' => 'creature', 'file' => 'creature',
@@ -872,29 +884,11 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
$smarty->saveCache($cacheKeyPage, $pageData); $smarty->saveCache($cacheKeyPage, $pageData);
} }
// menuId 0: Item g_initPath()
// tabId 0: Database g_initHeader() $smarty->updatePageVars($pageData['page']);
$smarty->updatePageVars(array(
'title' => implode(" - ", $pageData['title']),
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_ITEM,
'typeId' => $_id,
'reqJS' => array(
$pageData['pageText'] ? 'template/js/Book.js' : null,
'template/js/swfobject.js',
'template/js/profile.js',
'template/js/filters.js',
'?data=weight-presets'
),
'reqCSS' => 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('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('lang', array_merge(Lang::$main, Lang::$game, Lang::$item, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['relTabs']);
// load the page // load the page
$smarty->display('item.tpl'); $smarty->display('item.tpl');

View File

@@ -76,12 +76,12 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
$visibleCols = []; $visibleCols = [];
$hiddenCols = []; $hiddenCols = [];
if ($cats[0] !== null) if ($cats)
$path = array_merge($path, $cats); $path = array_merge($path, $cats);
// display available submenu and slot, if applicable // display available submenu and slot, if applicable
$type = $slot = [[], null]; $type = $slot = [[], null];
if ($cats[0] === null) if (!$cats)
{ {
$slot = [Lang::$item['inventoryType'], null]; $slot = [Lang::$item['inventoryType'], null];
asort($slot[0]); asort($slot[0]);
@@ -172,7 +172,8 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
if (preg_match('/gb\=(1|2|3)/i', $_SERVER['QUERY_STRING'], $match)) if (preg_match('/gb\=(1|2|3)/i', $_SERVER['QUERY_STRING'], $match))
$filter['gb'] = $match[1]; $filter['gb'] = $match[1];
$conditions[] = ['i.class', $cats[0]]; if (isset($cats[0]))
$conditions[] = ['i.class', $cats[0]];
if (isset($cats[1])) if (isset($cats[1]))
$conditions[] = ['i.subClass', $cats[1]]; $conditions[] = ['i.subClass', $cats[1]];
if (isset($cats[2])) if (isset($cats[2]))
@@ -197,21 +198,33 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
if (array_intersect([63, 64], $xCols)) // 63:buyPrice; 64:sellPrice if (array_intersect([63, 64], $xCols)) // 63:buyPrice; 64:sellPrice
$infoMask |= ITEMINFO_VENDOR; $infoMask |= ITEMINFO_VENDOR;
// menuId 0: Item g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'page' => [], 'page' => array(
'data' => $items->getListviewData($infoMask), 'title' => implode(' - ', $title),
'title' => $title, 'path' => json_encode($path, JSON_NUMERIC_CHECK),
'path' => $path, 'tab' => 0,
'params' => [] 'subCat' => $pageParam !== null ? '='.$pageParam : '',
'reqJS' => array(
'template/js/filters.js',
'template/js/swfobject.js',
'?data=weight-presets'
)
),
'lv' => array(
'data' => $items->getListviewData($infoMask),
'params' => []
)
); );
if ($items->filterGetError()) if ($items->filterGetError())
$pageData['params']['_errors'] = '$1'; $pageData['lv']['params']['_errors'] = '$1';
if (!empty($filter['upg'])) if (!empty($filter['upg']))
{ {
// upgrade-item got deleted by filter // upgrade-item got deleted by filter
if (empty($pageData['data'][$filter['upg']])) if (empty($pageData['lv']['data'][$filter['upg']]))
{ {
$w = $items->filterGetForm('setWeights', true); $w = $items->filterGetForm('setWeights', true);
$upgItem = new ItemList(array(['id', $filter['upg']]), false, ['wt' => $w[0], 'wtv' => $w[1]]); $upgItem = new ItemList(array(['id', $filter['upg']]), false, ['wt' => $w[0], 'wtv' => $w[1]]);
@@ -220,14 +233,14 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
if (!$upgItem->error) if (!$upgItem->error)
{ {
$upgItem->addGlobalsToJScript($smarty); $upgItem->addGlobalsToJScript($smarty);
$pageData['data'][$filter['upg']] = $upgItem->getListviewData($infoMask)[$filter['upg']]; $pageData['lv']['data'][$filter['upg']] = $upgItem->getListviewData($infoMask)[$filter['upg']];
} }
} }
if (!empty($filter['gb'])) if (!empty($filter['gb']))
$pageData['params']['customFilter'] = '$fi_filterUpgradeListview'; $pageData['lv']['params']['customFilter'] = '$fi_filterUpgradeListview';
$pageData['params']['_upgradeIds'] = "$[".$filter['upg']."]"; $pageData['lv']['params']['_upgradeIds'] = "$[".$filter['upg']."]";
} }
/* /*
by level: max 10 itemlevel steps (Level X) +1x Other|Autre|Anderes|Otros|Другое levels by level: max 10 itemlevel steps (Level X) +1x Other|Autre|Anderes|Otros|Другое levels
@@ -272,14 +285,14 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
{ {
$gem = empty($filter['gm']) ? 0 : $filter['gm']; $gem = empty($filter['gm']) ? 0 : $filter['gm'];
$cost = array_intersect([63], $xCols) ? 1 : 0; $cost = array_intersect([63], $xCols) ? 1 : 0;
$pageData['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, '.$gem.', '.$cost.')'; $pageData['lv']['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, '.$gem.', '.$cost.')';
} }
if (!empty($filter['fi']['setWeights'])) if (!empty($filter['fi']['setWeights']))
{ {
if (!empty($filter['gm'])) if (!empty($filter['gm']))
{ {
$pageData['params']['computeDataFunc'] = '$fi_scoreSockets'; $pageData['lv']['params']['computeDataFunc'] = '$fi_scoreSockets';
$w = $items->filterGetForm('setWeights', true); $w = $items->filterGetForm('setWeights', true);
$q = intVal($filter['gm']); $q = intVal($filter['gm']);
@@ -310,9 +323,9 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
$pageData['page']['gemScores'] = json_encode($pageData['page']['gemScores'], JSON_NUMERIC_CHECK); $pageData['page']['gemScores'] = json_encode($pageData['page']['gemScores'], JSON_NUMERIC_CHECK);
} }
$pageData['params']['onBeforeCreate'] = '$fi_initWeightedListview'; $pageData['lv']['params']['onBeforeCreate'] = '$fi_initWeightedListview';
$pageData['params']['onAfterCreate'] = '$fi_addUpgradeIndicator'; $pageData['lv']['params']['onAfterCreate'] = '$fi_addUpgradeIndicator';
$pageData['params']['sort'] = "$['-score', 'name']"; $pageData['lv']['params']['sort'] = "$['-score', 'name']";
if ($items->hasSetFields(['armor'])) if ($items->hasSetFields(['armor']))
$visibleCols[] = 'armor'; $visibleCols[] = 'armor';
@@ -323,15 +336,15 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
// create note if search limit was exceeded; overwriting 'note' is intentional // create note if search limit was exceeded; overwriting 'note' is intentional
if ($items->getMatches() > SQL_LIMIT_DEFAULT && empty($filter['upg'])) if ($items->getMatches() > SQL_LIMIT_DEFAULT && empty($filter['upg']))
{ {
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), SQL_LIMIT_DEFAULT); $pageData['lv']['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), SQL_LIMIT_DEFAULT);
$pageData['params']['_truncated'] = 1; $pageData['lv']['params']['_truncated'] = 1;
} }
if ($hiddenCols) if ($hiddenCols)
$pageData['params']['hiddenCols'] = '$'.json_encode($hiddenCols); $pageData['lv']['params']['hiddenCols'] = '$'.json_encode($hiddenCols);
if ($visibleCols) if ($visibleCols)
$pageData['params']['visibleCols'] = '$'.json_encode($visibleCols); $pageData['lv']['params']['visibleCols'] = '$'.json_encode($visibleCols);
$smarty->saveCache($cacheKey, $pageData, $filter); $smarty->saveCache($cacheKey, $pageData, $filter);
} }
@@ -341,22 +354,10 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
asort(Lang::$game['ra']); asort(Lang::$game['ra']);
asort(Lang::$game['cl']); asort(Lang::$game['cl']);
// menuId 0: Item g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => implode(' - ', $pageData['title']),
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'subCat' => $pageParam !== null ? '='.$pageParam : '',
'reqJS' => array(
'template/js/filters.js',
'template/js/swfobject.js',
'?data=weight-presets'
)
));
$smarty->assign('filter', $filter); $smarty->assign('filter', $filter);
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$item, ['colon' => Lang::$colon])); $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$item, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
$smarty->display('items.tpl'); $smarty->display('items.tpl');

View File

@@ -15,7 +15,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$iSet = new ItemsetList(array(['id', $_id])); $iSet = new ItemsetList(array(['id', $_id]));
if ($iSet->error) if ($iSet->error)
$smarty->notFound(Lang::$game['itemset']); $smarty->notFound(Lang::$game['itemset'], $_id);
$_ta = $iSet->getField('contentGroup'); $_ta = $iSet->getField('contentGroup');
$_ty = $iSet->getField('type'); $_ty = $iSet->getField('type');
@@ -169,36 +169,43 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$skill = ''; $skill = '';
if ($_sk) if ($_sk)
{ {
// todo (med): kill this Lang::monstrosity with Skills
$spellLink = sprintf('<a href="?spells=11.%s">%s</a> (%s)', $_sk, Lang::$spell['cat'][11][$_sk][0], $iSet->getField('skillLevel')); $spellLink = sprintf('<a href="?spells=11.%s">%s</a> (%s)', $_sk, Lang::$spell['cat'][11][$_sk][0], $iSet->getField('skillLevel'));
$skill = ' &ndash; <small><b>'.sprintf(Lang::$game['requires'], $spellLink).'</b></small>'; $skill = ' &ndash; <small><b>'.sprintf(Lang::$game['requires'], $spellLink).'</b></small>';
} }
// menuId 2: Itemset g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'title' => $_na, // for header
'path' => $path,
'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null,
'relTabs' => [],
'pieces' => $pieces,
'spells' => $spells,
'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,
'level' => $_lvl
),
'page' => array( 'page' => array(
'name' => $_na, // for page content 'name' => $_na, // for page content
'id' => $_id,
'bonusExt' => $skill, 'bonusExt' => $skill,
'description' => $_ta ? sprintf(Lang::$itemset['_desc'], $_na, Lang::$itemset['notes'][$_ta], $_cnt) : sprintf(Lang::$itemset['_descTagless'], $_na, $_cnt), 'description' => $_ta ? sprintf(Lang::$itemset['_desc'], $_na, Lang::$itemset['notes'][$_ta], $_cnt) : sprintf(Lang::$itemset['_descTagless'], $_na, $_cnt),
'unavailable' => (bool)($iSet->getField('cuFlags') & CUSTOM_UNAVAILABLE) 'unavailable' => (bool)($iSet->getField('cuFlags') & CUSTOM_UNAVAILABLE),
) 'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null,
'title' => $_na." - ".Util::ucfirst(Lang::$game['itemset']),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_ITEMSET,
'typeId' => $_id,
'reqJS' => array(
'template/js/Summary.js',
'template/js/swfobject.js'
),
'pieces' => $pieces,
'spells' => $spells,
'redButtons' => 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,
'level' => $_lvl
),
),
'relTabs' => []
); );
$iSet->addGlobalsToJscript($smarty); $iSet->addGlobalsToJscript($smarty);
@@ -263,23 +270,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
// menuId 2: Itemset g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => $pageData['title']." - ".Util::ucfirst(Lang::$game['itemset']),
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_ITEMSET,
'typeId' => $_id,
'reqJS' => array(
'template/js/Summary.js',
'template/js/swfobject.js'
)
));
$smarty->assign('redButtons', $pageData['buttons']);
$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, ['colon' => Lang::$colon])); $smarty->assign('lang', array_merge(Lang::$main, Lang::$itemset, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['relTabs']);
// load the page // load the page
$smarty->display('itemset.tpl'); $smarty->display('itemset.tpl');

View File

@@ -12,12 +12,6 @@ $cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_ITEMSET, -1, $filterHash, User:
if (!$smarty->loadCache($cacheKey, $pageData, $filter)) if (!$smarty->loadCache($cacheKey, $pageData, $filter))
{ {
$itemsets = new ItemsetList([], true); // class selection is via filter, nothing applies here $itemsets = new ItemsetList([], true); // class selection is via filter, nothing applies here
$pageData = array(
'data' => $itemsets->getListviewData(), // listview content
'params' => []
);
$itemsets->addGlobalsToJscript($smarty); $itemsets->addGlobalsToJscript($smarty);
// recreate form selection // recreate form selection
@@ -25,21 +19,44 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
$filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL; $filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
$filter['fi'] = $itemsets->filterGetForm(); $filter['fi'] = $itemsets->filterGetForm();
if (!empty($filter['fi']['extraCols']))
$pageData['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
if (isset($filter['cl'])) if (isset($filter['cl']))
$path[] = $filter['cl']; $path[] = $filter['cl'];
// menuId 2: Itemset g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array(
'page' => array(
'title' => Util::ucFirst(Lang::$game['itemsets']),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0,
'subCat' => $pageParam ? '='.$pageParam : '',
'reqJS' => array(
'template/js/filters.js',
'?data=weight-presets'
)
),
'lv' => []
);
$lv = array(
'data' => $itemsets->getListviewData(), // listview content
'params' => []
);
if (!empty($filter['fi']['extraCols']))
$lv['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
// create note if search limit was exceeded // create note if search limit was exceeded
if ($itemsets->getMatches() > SQL_LIMIT_DEFAULT) if ($itemsets->getMatches() > SQL_LIMIT_DEFAULT)
{ {
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), SQL_LIMIT_DEFAULT); $lv['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), SQL_LIMIT_DEFAULT);
$pageData['params']['_truncated'] = 1; $lv['params']['_truncated'] = 1;
} }
if ($itemsets->filterGetError()) if ($itemsets->filterGetError())
$pageData['params']['_errors'] = '$1'; $lv['params']['_errors'] = '$1';
$pageData['lv'] = $lv;
$smarty->saveCache($cacheKey, $pageData, $filter); $smarty->saveCache($cacheKey, $pageData, $filter);
} }
@@ -49,21 +66,10 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
asort(Lang::$itemset['notes'], SORT_NATURAL); asort(Lang::$itemset['notes'], SORT_NATURAL);
asort(Lang::$game['cl']); asort(Lang::$game['cl']);
// menuId 2: Itemset g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => Util::ucFirst(Lang::$game['itemsets']),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0,
'subCat' => $pageParam ? '='.$pageParam : '',
'reqJS' => array(
'template/js/filters.js',
'?data=weight-presets'
)
));
$smarty->assign('filter', $filter); $smarty->assign('filter', $filter);
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$itemset, Lang::$item, ['colon' => lang::$colon])); $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$itemset, Lang::$item, ['colon' => lang::$colon]));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
$smarty->display('itemsets.tpl'); $smarty->display('itemsets.tpl');

View File

@@ -105,7 +105,7 @@ switch ($pageCall)
$lv = []; $lv = [];
break; break;
default: default:
$smarty->notFound(); $smarty->error();
} }
if (strstr($pageCall, 'latest') || $pageCall == 'most-comments') if (strstr($pageCall, 'latest') || $pageCall == 'most-comments')

View File

@@ -6,7 +6,10 @@ if (!defined('AOWOW_REVISION'))
require 'includes/community.class.php'; require 'includes/community.class.php';
$_id = intVal($pageParam); $_id = intVal($pageParam);
$_path = [0, 4];
$_altIds = [];
$_altNPCs = null;
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, 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]); $cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_NPC, $_id, -1, User::$localeId]);
@@ -43,475 +46,549 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$npc = new CreatureList(array(['ct.id', $_id])); $npc = new CreatureList(array(['ct.id', $_id]));
if ($npc->error) if ($npc->error)
$smarty->notFound(Lang::$game['npc']); $smarty->notFound(Lang::$game['npc'], $_id);
// reconstruct path
$_path[] = $npc->getField('type');
$_typeFlags = $npc->getField('typeFlags');
$_name = $npc->getField('name', true);
if ($_ = $npc->getField('family'))
$_path[] = $_;
$position = null;
// difficulty entrys of self
if ($npc->getField('cuFlags') & NPC_CU_DIFFICULTY_DUMMY)
{
// find and create link to regular creature
$regNPC = new CreatureList(array(['OR', ['difficultyEntry1', $_id], ['difficultyEntry2', $_id], ['difficultyEntry3', $_id]]));
$position = [$regNPC->id, $regNPC->getField('name', true)];
}
else
{
for ($i = 1; $i < 4; $i++)
if ($_ = $npc->getField('difficultyEntry'.$i))
$_altIds[$_] = $i;
if ($_altIds)
$_altNPCs = new CreatureList(array(['id', array_keys($_altIds)]));
}
// map mode
$mapType = 0;
$maps = DB::Aowow()->selectCol('SELECT DISTINCT map from creature WHERE id = ?d', $_id);
if (count($maps) == 1) // should only exist in one instance
{
$map = new ZoneList(array(1, ['mapId', $maps[0]]));
// $mapType = $map->getField('areaType');
}
/***********/
/* Infobox */
/***********/
$infobox = [];
// Level
if ($npc->getField('rank') != NPC_RANK_BOSS)
{
$level = $npc->getField('minLevel');
$maxLvl = $npc->getField('maxLevel');
if ($level < $maxLvl)
$level .= ' - '.$maxLvl;
}
else // Boss Level
$level = '??';
$infobox[] = Lang::$game['level'].Lang::$colon.$level;
// Classification
if ($_ = $npc->getField('rank')) // != NPC_RANK_NORMAL
{
$str = $_typeFlags & 0x4 ? '[span class=boss-icon]'.Lang::$npc['rank'][$_].'[/span]' : Lang::$npc['rank'][$_];
$infobox[] = Lang::$npc['classification'].Lang::$colon.$str;
}
// Reaction
$_ = function ($r)
{
if ($r == 1) return 2;
if ($r == -1) return 10;
return;
};
$infobox[] = Lang::$npc['react'].Lang::$colon.'[color=q'.$_($npc->getField('A')).']A[/color] [color=q'.$_($npc->getField('H')).']H[/color]';
// Faction
Util::$pageTemplate->extendGlobalIds(TYPE_FACTION, $npc->getField('factionId'));
$infobox[] = Util::ucFirst(Lang::$game['faction']).Lang::$colon.'[faction='.$npc->getField('factionId').']';
// Wealth
if ($_ = intVal(($npc->getField('minGold') + $npc->getField('maxGold')) / 2))
$infobox[] = Lang::$npc['worth'].Lang::$colon.'[tooltip=tooltip_avgmoneydropped][money='.$_.'][/tooltip]';
// AI
if (User::isInGroup(U_GROUP_STAFF))
{
if ($_ = $npc->getField('aiName'))
$infobox[] = 'AI'.Lang::$colon.$_;
else if ($_ = $npc->getField('scriptName'))
$infobox[] = 'Script'.Lang::$colon.$_;
}
$_nf = function ($num) { return number_format($num, 0, '', '.'); };
// Health
$health = $npc->getField('healthMin');
$maxHealth = $npc->getField('healthMax');
$health = $health < $maxHealth ? $_nf($health).' - '.$_nf($maxHealth) : $_nf($health);
$modes = [];
$tipp = '[tooltip name=healthModes][table cellspacing=10][tr]%s[/tr][/table][/tooltip][span class=tip tooltip=healthModes]%s[/span]';
if ($mapType == 1 || $mapType == 2) // Dungeon or Raid
{
foreach ($_altIds as $mode => $id)
{
foreach ($_altNPCs->iterate() as $dId => $__)
{
if ($dId != $id)
continue;
$hp = $_altNPCs->getField('healthMin');
$hpMax = $_altNPCs->getField('healthMax');
$hp = $hp < $hpMax ? $_nf($hp).' - '.$_nf($hpMax) : $_nf($hp);
$modes[] = '[tr][td]'.Lang::$npc['modes'][$mapType][$mode].'&nbsp;&nbsp;[/td][td]'.$hp.'[/td][/tr]';
break;
}
}
if ($modes)
$health = Lang::$spell['powerTypes'][-2].' ('.Lang::$npc['modes'][$mapType][0].')'.Lang::$colon.$health;
}
if ($modes)
$infobox[] = sprintf($tipp, implode('[/tr][tr]', $modes), $health);
else
$infobox[] = Lang::$spell['powerTypes'][-2].Lang::$colon.$health;
// Mana
$mana = $npc->getField('manaMin');
$maxMana = $npc->getField('manaMax');
if ($maxMana)
{
$mana = $mana < $maxMana ? $_nf($mana).' - '.$_nf($maxMana) : $_nf($mana);
$infobox[] = Lang::$spell['powerTypes'][0].Lang::$colon.$mana;
}
// not yet implemented -> chicken out
$smarty->error();
/* /*
<table class="infobox"> if damage
<tr><th>{#Quick_Facts#}</th></tr> <li><div>{#Damage#}: {$npc.mindmg} - {$npc.maxdmg}</div></li>
<tr><td><div class="infobox-spacer"></div>
<ul> if armor
<li><div>{#Level#}: {if $npc.minlevel<>$npc.maxlevel}{$npc.minlevel} - {/if}{$npc.maxlevel}</div></li> <li><div>{#Armor#}: {$npc.armor}</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);
// Ищем NPC: /****************/
$npc = array(); /* Main Content */
$path = [0, 4, $npc['type']]; /****************/
$row = $DB->selectRow(' // reputations (by mode)
SELECT $spilledParents = [];
?#, c.entry, c.name, $reputation = [];
{ $_repFunc = function ($entries, &$spillover)
l.name_loc'.$_SESSION['locale'].' as `name_loc`, {
l.subname_loc'.$_SESSION['locale'].' as `subname_loc`, $q = 'SELECT f.id, f.parentFactionId, cor.creature_id AS npc,
?, IF(f.id = RewOnKillRepFaction1, RewOnKillRepValue1, RewOnKillRepValue2) AS qty,
} IF(f.id = RewOnKillRepFaction1, MaxStanding1, MaxStanding2) AS maxRank,
f.name_loc'.$_SESSION['locale'].' as `faction-name`, ft.factionID as `factionID`, IF(f.id = RewOnKillRepFaction1, isTeamAward1, isTeamAward2) AS spillover
((CASE exp WHEN 0 THEN mincls.basehp0 WHEN 1 THEN mincls.basehp1 WHEN 2 THEN mincls.basehp2 END)*Health_mod) AS minhealth, FROM aowow_factions f JOIN creature_onkill_reputation cor ON f.Id = cor.RewOnKillRepFaction1 OR f.Id = cor.RewOnKillRepFaction2 WHERE cor.creature_id IN (?a)';
((CASE exp WHEN 0 THEN maxcls.basehp0 WHEN 1 THEN maxcls.basehp1 WHEN 2 THEN maxcls.basehp2 END)*Health_mod) AS maxhealth,
(mincls.basemana*Mana_mod) AS minmana, $result = [];
(maxcls.basemana*Mana_mod) AS maxmana, $repData = DB::Aowow()->select($q, (array)$entries);
(maxcls.basearmor*Armor_mod) AS armor
FROM ?_factiontemplate ft, ?_factions f, creature_template c foreach ($repData as $_)
LEFT JOIN creature_classlevelstats mincls ON mincls.level=minlevel AND mincls.class=unit_class
LEFT JOIN creature_classlevelstats maxcls ON maxcls.level=maxlevel AND maxcls.class=unit_class
{ {
LEFT JOIN (locales_creature l) $set = array(
ON l.entry = c.entry AND ? 'id' => $_['id'],
'qty' => $_['qty'],
'name' => FactionList::getName($_['id']), // << this sucks .. maybe format this whole table with markdown and add name via globals?
'npc' => $_['npc'],
'cap' => $_['maxRank'] && $_['maxRank'] < REP_EXALTED ? Lang::$game['rep'][$_['maxRank']] : null
);
if ($_['spillover'])
{
$spillover[$_['parentFactionId']] = [intVal($_['qty'] / 2), $_['maxRank']];
$set['spillover'] = $_['parentFactionId'];
}
$result[] = $set;
} }
WHERE
c.entry = ? return $result;
AND ft.factiontemplateID = c.faction_A };
AND f.factionID = ft.factionID
LIMIT 1 // base NPC
', if ($base = $_repFunc($_id, $spilledParents))
$npc_cols[1], $reputation[] = [Lang::$npc['modes'][1][0], $base];
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP, // difficulty dummys
$_id if ($_altIds)
{
$alt = [];
$rep = $_repFunc(array_keys($_altIds), $spilledParents);
// order by difficulty
foreach ($rep as $r)
$alt[$_altIds[$r['npc']]][] = $r;
// apply by difficulty
foreach ($alt as $mode => $dat)
$reputation[] = [Lang::$npc['modes'][$mapType][$mode], $dat];
}
// get spillover factions and apply
if ($spilledParents)
{
$spilled = new FactionList(array(['parentFactionId', array_keys($spilledParents)]));
foreach($reputation as &$sets)
{
foreach ($sets[1] as &$row)
{
if (empty($row['spillover']))
continue;
foreach ($spilled->iterate() as $spId => $__)
{
// find parent
if ($spilled->getField('parentFactionId') != $row['spillover'])
continue;
// don't readd parent
if ($row['id'] == $spId)
continue;
$spMax = $spilledParents[$row['spillover']][1];
$sets[1][] = array(
'id' => $spId,
'qty' => $spilledParents[$row['spillover']][0],
'name' => $spilled->getField('name', true),
'cap' => $spMax && $spMax < REP_EXALTED ? Lang::$game['rep'][$spMax] : null
);
}
}
}
}
// Quotes
$quotes = [];
if ($texts = DB::Aowow()->select('SELECT ct.*, ct.groupid AS ARRAY_KEY, ct.id as ARRAY_KEY2, lct.text_loc2, lct.text_loc3, lct.text_loc6, lct.text_loc8 FROM creature_text ct LEFT JOIN locales_creature_text lct ON ct.entry = lct.entry AND ct.groupid = lct.groupid AND ct.id = lct.id WHERE ct.entry = ?d', $_id))
{
$nQuotes = 0;
foreach ($texts as $text)
{
$group = [];
foreach ($text as $t)
{
// fixup .. either set %s for emotes or dont >.<
$text = Util::localizedString($t, 'text');
if (in_array($t['type'], [2, 3, 16, 41]) && strpos($text, '%s') === false)
$text = '%s '.$text;
$line = array(
'type' => 2, // [type: 0, 12] say: yellow-ish
'lang' => !empty($t['language']) ? Lang::$game['languages'][$t['language']] : null,
'text' => sprintf(Util::parseHtmlText(htmlentities($text)), $_name),
);
switch ($t['type'])
{
case 1: // yell:
case 14: $line['type'] = 1; break; // - dark red
case 2: // emote:
case 16: // "
case 3: // boss emote:
case 41: $line['type'] = 4; break; // - orange
case 4: // whisper:
case 15: // "
case 5: // boss whisper:
case 42: $line['type'] = 3; break; // - pink-ish
}
$nQuotes++;
$group[] = $line;
}
$quotes[] = $group;
}
$quotes = [$quotes, $nQuotes];
}
// get spawns and such
// menuId 4: NPC g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array(
'page' => array(
'name' => $_name,
'subname' => $npc->getField('subname', true),
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
'difficultyPH' => isset($difficultyPH) ? $difficultyPH : null,
// 'mapper' => true,
'position' => $position,
'quotes' => $quotes,
'reputation' => $reputation,
'title' => $_name.' - '.Util::ucFirst(Lang::$game['npc']),
'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_NPC,
'typeId' => $_id,
'reqJS' => ['template/js/swfobject.js'],
'redButtons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => true,
BUTTON_VIEW3D => ['type' => TYPE_NPC, 'typeId' => $_id, 'displayId' => $npc->getRandomModelId()]
)
),
'relTabs' => []
); );
if($row) /**************/
/* Extra Tabs */
/**************/
// tab: SAI
// hmm, how should this loot like
// tab: abilities
// for spell in template and smartScripts if set
// tab: teaches
// pet spells, class spells, trade spells
// tab: sells
if ($sells = DB::Aowow()->selectCol('SELECT item FROM npc_vendor nv WHERE entry = ?d UNION SELECT item FROM game_event_npc_vendor genv JOIN creature c ON genv.guid = c.guid WHERE c.id = ?d', $_id, $_id))
{ {
$npc = $row; $soldItems = new ItemList(array(['id', $sells]));
$npc['name'] = localizedName($row); if (!$soldItems->error)
$npc['subname'] = localizedName($row, 'subname');
if($npc['rank'] == 3)
{ {
$npc['minlevel'] = '??'; $soldItems->addGlobalsToJscript(Util::$pageTemplate);
$npc['maxlevel'] = '??';
}
$npc['mindmg'] = round(($row['mindmg'] + $row['attackpower']) * $row['dmg_multiplier']);
$npc['maxdmg'] = round(($row['maxdmg'] + $row['attackpower']) * $row['dmg_multiplier']);
$toDiv = array('minhealth', 'maxmana', 'minmana', 'maxhealth', 'armor', 'mindmg', 'maxdmg'); $pageData['relTabs'][] = array(
// Разделяем на тысячи (ххххххххх => ххх,ххх,ххх) 'file' => 'item',
foreach($toDiv as $e) 'data' => $soldItems->getListviewData(ITEMINFO_VENDOR, [TYPE_NPC => $_id]),
$npc[$e] = number_format($npc[$e]); 'params' => [
'tabs' => '$tabsRelated',
$npc['rank'] = $smarty->get_config_vars('rank'.$npc['rank']); 'name' => '$LANG.tab_sells',
// faction_A = faction_H 'id' => 'currency-for',
$npc['faction_num'] = $row['factionID']; 'extraCols' => "$[Listview.extraCols.condition, Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack'), Listview.extraCols.cost]"
$npc['faction'] = $row['faction-name']; ]
// Деньги
$money = ($row['mingold']+$row['maxgold']) / 2;
$npc = array_merge($npc, money2coins($money));
// Героик/нормал копия НПС
if($npc['difficulty_entry_1'])
{
// это нормал НПС, ищем героика
if($tmp = creatureinfo($npc['difficulty_entry_1']))
{
$npc['heroic'] = array(
'type' => 0,
'entry' => $tmp['entry'],
'name' => str_replace(LOCALE_HEROIC, '', $tmp['name'])
);
unset($tmp);
}
}
else
{
// А может быть героик НПС одним для нескольких нормалов?
// считаем что нет
$tmp = $DB->selectRow('
SELECT c.entry, c.name
{
, l.name_loc?d as `name_loc`
}
FROM creature_template c
{
LEFT JOIN (locales_creature l)
ON l.entry = c.entry AND ?
}
WHERE
c.difficulty_entry_1 = ?d
LIMIT 1
',
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$npc['entry']
); );
if($tmp)
{
$npc['heroic'] = array(
'type' => 1,
'entry' => $tmp['entry'],
'name' => localizedName($tmp)
);
$npc['name'] = str_replace(' (1)', '', $npc['name']);
$normal_entry = $tmp['entry'];
unset($tmp);
}
} }
// Дроп }
$lootid=$row['lootid'];
$skinid=$row['skinloot']; // tabs: this creature contains..
$pickpocketid=$row['pickpocketloot']; $skinTab = ['tab_skinning', 'skinned-from'];
// Используемые спеллы if ($_typeFlags & NPC_TYPEFLAG_HERBLOOT)
$npc['ablities'] = array(); $skinTab = ['tab_gatheredfromnpc', 'gathered-from-npc'];
$tmp = array(); else if ($_typeFlags & NPC_TYPEFLAG_MININGLOOT)
for($j=0;$j<=4;++$j) $skinTab = ['tab_minedfromnpc', 'mined-from-npc'];
else if ($_typeFlags & NPC_TYPEFLAG_ENGINEERLOOT)
$skinTab = ['tab_salvagedfrom', 'salvaged-from-npc'];
/*
extraCols: [Listview.extraCols.count, Listview.extraCols.percent, Listview.extraCols.mode],
_totalCount: 22531,
computeDataFunc: Listview.funcBox.initLootTable,
onAfterCreate: Listview.funcBox.addModeIndicator,
modes:{"mode":1,"1":{"count":4408,"outof":16013},"4":{"count":4408,"outof":22531}}
*/
$sourceFor = array(
[LOOT_CREATURE, $npc->getField('lootId'), '$LANG.tab_drops', 'drops', ['Listview.extraCols.percent'], [] , []],
[LOOT_PICKPOCKET, $npc->getField('pickpocketLootId'), '$LANG.tab_pickpocketing', 'pickpocketing', ['Listview.extraCols.percent'], ['side', 'slot', 'reqlevel'], []],
[LOOT_SKINNING, $npc->getField('skinLootId'), '$LANG.'.$skinTab[0], $skinTab[1], ['Listview.extraCols.percent'], ['side', 'slot', 'reqlevel'], []]
);
// temp: manually add loot for difficulty-versions
$langref = array(
"-2" => '$LANG.tab_heroic',
"-1" => '$LANG.tab_normal',
1 => '$$WH.sprintf(LANG.tab_normalX, 10)',
2 => '$$WH.sprintf(LANG.tab_normalX, 25)',
3 => '$$WH.sprintf(LANG.tab_heroicX, 10)',
4 => '$$WH.sprintf(LANG.tab_heroicX, 25)'
);
if ($_altIds)
{
$sourceFor[0][2] = $langref[1];
foreach ($_altNPCs->iterate() as $id => $__)
{ {
if($row['spell'.$j] && !in_array($row['spell'.$j], $tmp)) $mode = $_altIds[$id];
{ array_splice($sourceFor, 1, 0, [[LOOT_CREATURE, $_altNPCs->getField('lootId'), $langref[$mode + 1], 'drops-'.$mode, ['Listview.extraCols.percent'], [], []]]);
$tmp[] = $row['spell'.$j];
if($data = spellinfo($row['spell'.$j], 0))
{
if($data['name'])
$npc['abilities'][] = $data;
}
}
} }
for($j=1;$j<4;$j++) }
$reqQuest = [];
foreach ($sourceFor as $sf)
{
if ($itemLoot = Util::handleLoot($sf[0], $sf[1], User::isInGroup(U_GROUP_STAFF), $sf[4]))
{ {
$tmp2 = $DB->select(' foreach ($itemLoot as $l => $lv)
SELECT action?d_param1 {
FROM creature_ai_scripts if (!$lv['quest'])
WHERE continue;
creature_id=?d
AND action?d_type=11 $sf[4][] = 'Listview.extraCols.condition';
',
$j, $reqQuest[$lv['id']] = 0;
$npc['entry'],
$j $itemLoot[$l]['condition'] = ['type' => TYPE_QUEST, 'typeId' => &$reqQuest[$lv['id']], 'status' => 1];
}
$pageData['relTabs'][] = array(
'file' => 'item',
'data' => $itemLoot,
'params' => [
'tabs' => '$tabsRelated',
'name' => $sf[2],
'id' => $sf[3],
'extraCols' => $sf[4] ? "$[".implode(', ', array_unique($sf[4]))."]" : null,
'hiddenCols' => $sf[5] ? "$".json_encode($sf[5]) : null,
'visibleCols' => $sf[6] ? '$'.json_encode($sf[6]) : null,
'sort' => "$['-percent', 'name']",
]
); );
if($tmp2)
foreach($tmp2 as $i=>$tmp3)
if(!in_array($tmp2[$i]['action'.$j.'_param1'], $tmp))
{
$tmp[] = $tmp2[$i]['action'.$j.'_param1'];
if($data = spellinfo($tmp2[$i]['action'.$j.'_param1'], 0))
{
if($data['name'])
$npc['abilities'][] = $data;
}
}
} }
if(!$npc['ablities']) }
unset($npc['ablities']);
// Обучает: if ($reqIds = array_keys($reqQuest)) // apply quest-conditions as back-reference
// Если это пет со способностью: {
/* // Временно закомментировано $conditions = array(
$row = $DB->selectRow(' 'OR',
SELECT Spell1, Spell2, Spell3, Spell4 ['requiredSourceItemId1', $reqIds], ['requiredSourceItemId2', $reqIds],
FROM petcreateinfo_spell ['requiredSourceItemId3', $reqIds], ['requiredSourceItemId4', $reqIds],
WHERE ['requiredItemId1', $reqIds], ['requiredItemId2', $reqIds], ['requiredItemId3', $reqIds],
entry=?d ['requiredItemId4', $reqIds], ['requiredItemId5', $reqIds], ['requiredItemId6', $reqIds]
',
$npc['entry']
); );
if($row)
$reqQuests = new QuestList($conditions);
$reqQuests->addGlobalsToJscript($smarty);
foreach ($reqQuests->iterate() as $qId => $__)
{ {
$npc['teaches'] = array(); if (empty($reqQuests->requires[$qId][TYPE_ITEM]))
for($j=1;$j<=4;$j++) continue;
if($row['Spell'.$j])
for($k=1;$k<=3;$k++)
{
$spellrow = $DB->selectRow('
SELECT ?#, spellID
FROM ?_spell, ?_spellicons
WHERE
spellID=(SELECT effect'.$k.'triggerspell FROM ?_spell WHERE spellID=?d AND (effect'.$k.'id IN (36,57)))
AND id=spellicon
LIMIT 1
',
$spell_cols[2],
$row['Spell'.$j]
);
if($spellrow)
{
$num = count($npc['teaches']);
$npc['teaches'][$num] = array();
$npc['teaches'][$num] = spellinfo2($spellrow);
}
}
}
unset ($row);*/
// Если это просто тренер foreach ($reqIds as $rId)
$teachspells = $DB->select(' if (in_array($rId, $reqQuests->requires[$qId][TYPE_ITEM]))
SELECT ?#, spellID $reqQuest[$rId] = $reqQuests->id;
FROM npc_trainer, ?_spell, ?_spellicons }
WHERE }
(
-entry IN (SELECT spell FROM npc_trainer WHERE entry = ?) // tab: starts quest (questrelation)
OR (entry = ? AND npc_trainer.spell > 0) if ($starts = DB::Aowow()->selectCol('SELECT quest FROM creature_questrelation WHERE id = ?d', $_id))
) {
AND spellID = npc_trainer.spell $started = new QuestList(array(['id', $starts]));
AND id=spellicon if (!$started->error)
',
$spell_cols[2],
$npc['entry'],
$npc['entry']
);
if($teachspells)
{ {
if(!(IsSet($npc['teaches']))) $started->addGlobalsToJScript(Util::$pageTemplate);
$npc['teaches'] = array();
foreach($teachspells as $teachspell)
{
$num = count($npc['teaches']);
$npc['teaches'][$num] = array();
$npc['teaches'][$num] = spellinfo2($teachspell);
}
}
unset ($teachspells);
// Продает: $pageData['relTabs'][] = array(
$rows_s = $DB->select(' 'file' => 'quest',
SELECT ?#, i.entry, i.maxcount, n.`maxcount` as `drop-maxcount`, n.ExtendedCost 'data' => $started->getListviewData(),
{, l.name_loc?d AS `name_loc`} 'params' => [
FROM npc_vendor n, ?_icons, item_template i 'tabs' => '$tabsRelated',
{LEFT JOIN (locales_item l) ON l.entry=i.entry AND ?d} 'name' => '$LANG.tab_starts',
WHERE 'id' => 'starts'
n.entry=? ]
AND i.entry=n.item
AND id=i.displayid
',
$item_cols[2],
($_SESSION['locale'])? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale'])? 1: DBSIMPLE_SKIP,
$_id
);
if($rows_s)
{
$npc['sells'] = array();
foreach($rows_s as $numRow=>$row)
{
$npc['sells'][$numRow] = array();
$npc['sells'][$numRow] = iteminfo2($row);
$npc['sells'][$numRow]['maxcount'] = $row['drop-maxcount'];
$npc['sells'][$numRow]['cost'] = array();
if($row['ExtendedCost'])
{
$extcost = $DB->selectRow('SELECT * FROM ?_item_extended_cost WHERE extendedcostID=?d LIMIT 1', abs($row['ExtendedCost']));
if($extcost['reqhonorpoints']>0)
$npc['sells'][$numRow]['cost']['honor'] = (($npc['A']==1)? 1: -1) * $extcost['reqhonorpoints'];
if($extcost['reqarenapoints']>0)
$npc['sells'][$numRow]['cost']['arena'] = $extcost['reqarenapoints'];
$npc['sells'][$numRow]['cost']['items'] = array();
for($j=1;$j<=5;$j++)
if(($extcost['reqitem'.$j]>0) and ($extcost['reqitemcount'.$j]>0))
{
allitemsinfo($extcost['reqitem'.$j], 0);
$npc['sells'][$numRow]['cost']['items'][] = array('item' => $extcost['reqitem'.$j], 'count' => $extcost['reqitemcount'.$j]);
}
}
if($row['BuyPrice']>0)
$npc['sells'][$numRow]['cost']['money'] = $row['BuyPrice'];
}
unset ($row);
unset ($numRow);
unset ($extcost);
}
unset ($rows_s);
// Дроп
if(!($npc['drop'] = loot('creature_loot_template', $lootid)))
unset ($npc['drop']);
// Кожа
if(!($npc['skinning'] = loot('skinning_loot_template', $skinid)))
unset ($npc['skinning']);
// Воруеццо
if(!($npc['pickpocketing'] = loot('pickpocketing_loot_template', $pickpocketid)))
unset ($npc['pickpocketing']);
// Начиниают квесты...
$rows_qs = $DB->select('
SELECT q.?#
FROM quest_template q
LEFT JOIN creature_questrelation c on q.id = c.quest
WHERE
c.id=?
',
$quest_cols[2],
$_id
); );
if($rows_qs)
{
$npc['starts'] = array();
foreach($rows_qs as $numRow=>$row) {
$npc['starts'][] = GetQuestInfo($row, 0xFFFFFF);
}
} }
unset ($rows_qs); }
// Начиниают event-only квесты... // tab: ends quest (involvedrelation)
$rows_qse = event_find(array('quest_creature_id' => $_id)); if ($ends = DB::Aowow()->selectCol('SELECT quest FROM creature_involvedrelation WHERE id = ?d', $_id))
if($rows_qse) {
$ended = new QuestList(array(['id', $ends]));
if (!$ended->error)
{ {
if (!isset($npc['starts'])) $ended->addGlobalsToJScript(Util::$pageTemplate);
$npc['starts'] = array();
foreach($rows_qse as $event)
foreach($event['creatures_quests_id'] as $ids)
$npc['starts'][] = GetDBQuestInfo($ids['quest'], 0xFFFFFF);
}
unset ($rows_qse);
// Заканчивают квесты... $pageData['relTabs'][] = array(
$rows_qe = $DB->select(' 'file' => 'quest',
SELECT q.?# 'data' => $ended->getListviewData(),
FROM quest_template q 'params' => [
LEFT JOIN creature_involvedrelation c on q.id = c.quest 'tabs' => '$tabsRelated',
WHERE 'name' => '$LANG.tab_ends',
c.id=? 'id' => 'ends'
', ]
$quest_cols[2], );
$_id }
}
// tab: objective of quest
$conditions = array(
'OR',
['AND', ['RequiredNpcOrGo1', $_id], ['RequiredNpcOrGoCount1', 0, '>']],
['AND', ['RequiredNpcOrGo2', $_id], ['RequiredNpcOrGoCount2', 0, '>']],
['AND', ['RequiredNpcOrGo3', $_id], ['RequiredNpcOrGoCount3', 0, '>']],
['AND', ['RequiredNpcOrGo4', $_id], ['RequiredNpcOrGoCount4', 0, '>']],
);
$objectiveOf = new QuestList($conditions);
if (!$objectiveOf->error)
{
$objectiveOf->addGlobalsToJScript(Util::$pageTemplate);
$pageData['relTabs'][] = array(
'file' => 'quest',
'data' => $objectiveOf->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_objectiveof',
'id' => 'objective-of'
]
); );
if($rows_qe) }
{
$npc['ends'] = array();
foreach($rows_qe as $numRow=>$row) {
$npc['ends'][] = GetQuestInfo($row, 0xFFFFFF);
}
}
unset ($rows_qe);
// Необходимы для квеста.. // tab: criteria of [ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE have no data set to check for]
$rows_qo = $DB->select(' $conditions = array(
SELECT ?# ['ac.type', [ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE]],
FROM quest_template ['ac.value1', $_id]
WHERE );
RequiredNpcOrGo1=?
OR RequiredNpcOrGo2=? $crtOf = new AchievementList($conditions);
OR RequiredNpcOrGo3=? if (!$crtOf->error)
OR RequiredNpcOrGo4=? {
', $crtOf->addGlobalsToJScript(Util::$pageTemplate);
$quest_cols[2],
$_id, $_id, $_id, $_id $pageData['relTabs'][] = array(
'file' => 'achievement',
'data' => $crtOf->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_criteriaof',
'id' => 'criteria-of'
]
); );
if($rows_qo)
{
$npc['objectiveof'] = array();
foreach($rows_qo as $numRow=>$row)
$npc['objectiveof'][] = GetQuestInfo($row, 0xFFFFFF);
}
unset ($rows_qo);
// Цель критерии
$rows = $DB->select('
SELECT a.id, a.faction, a.name_loc?d AS name, a.description_loc?d AS description, a.category, a.points, s.iconname, z.areatableID
FROM ?_spellicons s, ?_achievementcriteria c, ?_achievement a
LEFT JOIN (?_zones z) ON a.map != -1 AND a.map = z.mapID
WHERE
a.icon = s.id
AND a.id = c.refAchievement
AND c.type IN (?a)
AND c.value1 = ?d
GROUP BY a.id
ORDER BY a.name_loc?d
',
$_SESSION['locale'],
$_SESSION['locale'],
array(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE),
$npc['entry'],
$_SESSION['locale']
);
if($rows)
{
$npc['criteria_of'] = array();
foreach($rows as $row)
{
allachievementsinfo2($row['id']);
$npc['criteria_of'][] = achievementinfo2($row);
}
}
// Положения созданий божих (для героик НПС не задана карта, юзаем из нормала):
if($normal_entry)
// мы - героик НПС, определяем позицию по нормалу
$npc['position'] = position($normal_entry, 'creature', 2);
else
// мы - нормал НПС или НПС без сложности
$npc['position'] = position($npc['entry'], 'creature', 1);
// Исправить type, чтобы подсвечивались event-овые NPC
if ($npc['position'])
foreach ($npc['position'] as $z => $zone)
foreach ($zone['points'] as $p => $pos)
if ($pos['type'] == 0 && ($events = event_find(array('creature_guid' => $pos['guid']))))
{
$names = array_select_key(event_name($events), 'name');
$npc['position'][$z]['points'][$p]['type'] = 4;
$npc['position'][$z]['points'][$p]['events'] = implode(", ", $names);
}
} }
$smarty->saveCache($cacheKeyPage, $pageData); $smarty->saveCache($cacheKeyPage, $pageData);
} }
$smarty->updatePageVars($pageData['page']);
// menuId 4: NPC g_initPath()
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'mapper' => true,
'title' => implode(" - ", $pageData['title']),
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_NPC,
'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('lang', array_merge(Lang::$main, Lang::$game, Lang::$npc, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['relTabs']);
// load the page // load the page
$smarty->display('npc.tpl'); $smarty->display('npc.tpl');

88
pages/npcs.php Normal file
View File

@@ -0,0 +1,88 @@
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
$filter = [];
$cats = Util::extractURLParams($pageParam);
$path = [0, 4];
$title = [Util::ucFirst(Lang::$game['npcs'])];
$filterHash = !empty($_GET['filter']) ? sha1(serialize($_GET['filter'])) : -1;
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_NPC, -1, ($cats ? $cats[0] : -1).$filterHash, User::$localeId]);
$validCats = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
if (!Util::isValidPage($validCats, $cats))
$smarty->error();
if (!$smarty->loadCache($cacheKey, $pageData, $filter))
{
$conditions = [];
if ($cats)
{
$conditions[] = ['type', $cats[0]];
$path[] = $cats[0];
array_unshift($title, Lang::$npc['cat'][$cats[0]]);
}
$npcs = new CreatureList($conditions, true); // beast subtypes are selected via filter
// recreate form selection
$filter = array_merge($npcs->filterGetForm('form'), $filter);
$filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
$filter['fi'] = $npcs->filterGetForm();
if (isset($filter['fa']))
$path[] = $filter['fa'];
// menuId 4: NPC g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array(
'page' => array(
'petFamPanel' => ($cats && $cats[0] == 1),
'title' => implode(' - ', $title),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0,
'subCat' => $pageParam ? '='.$pageParam : '',
'reqJS' => array(
'template/js/filters.js'
)
),
'lv' => []
);
$lv = array(
'data' => $npcs->getListviewData(), // listview content
'params' => []
);
if (!empty($filter['fi']['extraCols']))
$lv['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
// create note if search limit was exceeded
if ($npcs->getMatches() > SQL_LIMIT_DEFAULT)
{
$lv['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_npcsfound', $npcs->getMatches(), SQL_LIMIT_DEFAULT);
$lv['params']['_truncated'] = 1;
}
if ($npcs->filterGetError())
$lv['params']['_errors'] = '$1';
$pageData['lv'] = $lv;
$smarty->saveCache($cacheKey, $pageData);
}
// sort for dropdown-menus
asort(Lang::$game['fa']);
$smarty->updatePageVars($pageData['page']);
$smarty->assign('filter', $filter);
$smarty->assign('lang', array_merge(Lang::$main, Lang::$npc, Lang::$game, ['colon' => lang::$colon]));
$smarty->assign('lvData', $pageData['lv']);
// load the page
$smarty->display('npcs.tpl');
?>

View File

@@ -43,7 +43,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$object = new GameObjectList(array(['entry', $_id])); $object = new GameObjectList(array(['entry', $_id]));
if ($object->error) if ($object->error)
$smarty->notFound(Lang::$game['gameObject']); $smarty->notFound(Lang::$game['gameObject'], $_id);
/* /*
ListView for fishing holes ListView for fishing holes

View File

@@ -14,7 +14,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$pet = new PetList(array(['id', $_id])); $pet = new PetList(array(['id', $_id]));
if ($pet->error) if ($pet->error)
$smarty->notFound(Lang::$game['pet']); $smarty->notFound(Lang::$game['pet'], $_id);
/***********/ /***********/
/* Infobox */ /* Infobox */
@@ -33,22 +33,28 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
/* Main Content */ /* Main Content */
/****************/ /****************/
// menuId 8: Pets g_initPath()
// tabid 0: Database g_initHeader()
$pageData = array( $pageData = array(
'title' => $pet->getField('name', true), 'page' => array(
'path' => '[0, 8, '.$pet->getField('type').']', 'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]', 'headIcons' => [$pet->getField('iconString')],
'relTabs' => [], 'redButtons' => array(
'buttons' => array( BUTTON_WOWHEAD => true,
BUTTON_WOWHEAD => true, BUTTON_LINKS => 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]
BUTTON_TALENT => ['href' => '?petcalc#'.Util::$tcEncoding[(int)($_id / 10)] . Util::$tcEncoding[(2 * ($_id % 10) + ($pet->getField('exotic') ? 1 : 0))], 'pet' => true] ),
), 'name' => $pet->getField('name', true),
'page' => array( 'id' => $_id,
'name' => $pet->getField('name', true), 'expansion' => Util::$expansionString[$pet->getField('expansion')],
'id' => $_id, 'title' => $pet->getField('name', true)." - ".Util::ucfirst(Lang::$game['pet']),
'icon' => $pet->getField('iconString'), 'path' => '[0, 8, '.$pet->getField('type').']',
'expansion' => Util::$expansionString[$pet->getField('expansion')] 'tab' => 0,
'type' => TYPE_PET,
'typeId' => $_id,
'reqJS' => ['template/js/swfobject.js']
), ),
'relTabs' => []
); );
/**************/ /**************/
@@ -190,24 +196,12 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
// menuId 8: Pets g_initPath() $smarty->updatePageVars($pageData['page']);
// tabid 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => $pageData['title']." - ".Util::ucfirst(Lang::$game['pet']),
'path' => $pageData['path'],
'tab' => 0,
'type' => TYPE_PET,
'typeId' => $_id,
'reqJS' => array(
'template/js/swfobject.js'
)
));
$smarty->assign('redButtons', $pageData['buttons']);
$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('lang', array_merge(Lang::$main, Lang::$game));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['relTabs']);
// load the page // load the page
$smarty->display('pet.tpl'); $smarty->display('detail-page-generic.tpl');
?> ?>

View File

@@ -4,27 +4,25 @@ if (!defined('AOWOW_REVISION'))
die('illegal access'); die('illegal access');
$cat = Util::extractURLParams($pageParam)[0]; $cat = Util::extractURLParams($pageParam);
$path = [0, 8]; $path = [0, 8];
$validCats = [0, 1, 2]; $validCats = [0, 1, 2];
$title = [Util::ucFirst(Lang::$game['pets'])]; $title = [Util::ucFirst(Lang::$game['pets'])];
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_PET, -1, isset($cat) ? $cat : -1, User::$localeId]); $cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_PET, -1, $cat ? $cat[0] : -1, User::$localeId]);
if (!Util::isValidPage($validCats, $cat)) if (!Util::isValidPage($validCats, $cat))
$smarty->error(); $smarty->error();
$path[] = $cat; // should be only one parameter anyway if ($cat)
{
if (isset($cat)) $path[] = $cat;
array_unshift($title, Lang::$pet['cat'][$cat]); array_unshift($title, Lang::$pet['cat'][$cat[0]]);
}
if (!$smarty->loadCache($cacheKey, $pageData)) if (!$smarty->loadCache($cacheKey, $pageData))
{ {
$pets = new PetList(isset($cat) ? array(['type', (int)$cat]) : []); $pets = new PetList($cat ? array(['type', (int)$cat[0]]) : []);
$pets->addGlobalsToJscript($smarty, GLOBALINFO_RELATED);
$pageData = array(
'listviews' => []
);
$lvPet = array( $lvPet = array(
'file' => 'pet', 'file' => 'pet',
@@ -34,28 +32,29 @@ if (!$smarty->loadCache($cacheKey, $pageData))
) )
); );
if (($mask = $pets->hasDiffFields(['type'])) == 0x0) if (!$pets->hasDiffFields(['type']))
$lvPet['params']['hiddenCols'] = "$['type']"; $lvPet['params']['hiddenCols'] = "$['type']";
$pageData['listviews'][] = $lvPet; // menuId 8: Pets g_initPath()
// tabid 0: Database g_initHeader()
$pets->addGlobalsToJscript($smarty, GLOBALINFO_RELATED); $pageData = array(
'page' => array(
'title' => implode(" - ", $title),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0
),
'lv' => [$lvPet]
);
$smarty->saveCache($cacheKey, $pageData); $smarty->saveCache($cacheKey, $pageData);
} }
// menuId 8: Pets g_initPath() $smarty->updatePageVars($pageData['page']);
// tabid 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => implode(" - ", $title),
'path' => "[".implode(", ", $path)."]",
'tab' => 0
));
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
$smarty->display('generic-no-filter.tpl'); $smarty->display('list-page-generic.tpl');
?> ?>

View File

@@ -40,7 +40,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$quest = new QuestList(array(['qt.id', $_id])); $quest = new QuestList(array(['qt.id', $_id]));
if ($quest->error) if ($quest->error)
$smarty->notFound(Lang::$game['quest']); $smarty->notFound(Lang::$game['quest'], $_id);

View File

@@ -31,7 +31,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$race = new CharRaceList(array(['id', $_id])); // should this be limited to playable races..? $race = new CharRaceList(array(['id', $_id])); // should this be limited to playable races..?
if ($race->error) if ($race->error)
$smarty->notFound(Lang::$game['race']); $smarty->notFound(Lang::$game['race'], $_id);
/***********/ /***********/
/* Infobox */ /* Infobox */
@@ -68,20 +68,28 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
/* Main Content */ /* Main Content */
/****************/ /****************/
// menuId 13: Race g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array ( $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( 'page' => array(
'name' => $race->getField('name', true), 'name' => $race->getField('name', true),
'icon' => strtolower($race->getField('fileString')), 'expansion' => Util::$expansionString[$race->getField('expansion')],
'expansion' => Util::$expansionString[$race->getField('expansion')] 'title' => $race->getField('name', true).' - '.Util::ucFirst(Lang::$game['race']),
) 'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_RACE,
'typeId' => $_id,
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',
'headIcons' => array(
'race_'.strtolower($race->getField('fileString')).'_male',
'race_'.strtolower($race->getField('fileString')).'_female'
),
'redButtons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => true
)
),
'relTabs' => []
); );
/**************/ /**************/
@@ -187,21 +195,12 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
// menuId 13: Race g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => $pageData['title'],
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
'tab' => 0,
'type' => TYPE_RACE,
'typeId' => $_id
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_RACE, $_id)); // comments, screenshots, videos $smarty->assign('community', CommunityContent::getAll(TYPE_RACE, $_id)); // comments, screenshots, videos
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData);
// load the page // load the page
$smarty->display('race.tpl'); $smarty->display('detail-page-generic.tpl');
?> ?>

View File

@@ -10,8 +10,15 @@ if (!$smarty->loadCache($cacheKey, $pageData))
{ {
$races = new CharRaceList(array(['side', 0, '!'])); // only playable $races = new CharRaceList(array(['side', 0, '!'])); // only playable
// menuId 13: Race g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'listviews' => array( 'page' => array(
'title' => Util::ucFirst(Lang::$game['races']),
'path' => "[0, 13]",
'tab' => 0
),
'lv' => array(
array( array(
'file' => 'race', 'file' => 'race',
'data' => $races->getListviewData(), 'data' => $races->getListviewData(),
@@ -24,17 +31,11 @@ if (!$smarty->loadCache($cacheKey, $pageData))
} }
// menuId 13: Race g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => Util::ucFirst(Lang::$game['races']),
'path' => "[0, 13]",
'tab' => 0
));
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
$smarty->display('generic-no-filter.tpl'); $smarty->display('list-page-generic.tpl');
?> ?>

View File

@@ -14,7 +14,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$skill = new SkillList(array(['id', $_id])); $skill = new SkillList(array(['id', $_id]));
if ($skill->error) if ($skill->error)
$smarty->notFound(Lang::$game['skill']); $smarty->notFound(Lang::$game['skill'], $_id);
$_cat = $skill->getField('typeCat'); $_cat = $skill->getField('typeCat');
@@ -26,13 +26,13 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'title' => $skill->getField('name', true), 'title' => $skill->getField('name', true),
'path' => [0, 14], 'path' => [0, 14],
'relTabs' => [], 'relTabs' => [],
'icons' => [$skill->getField('iconString')],
'buttons' => array( 'buttons' => array(
BUTTON_WOWHEAD => true, BUTTON_WOWHEAD => true,
BUTTON_LINKS => true BUTTON_LINKS => true
), ),
'page' => array( 'page' => array(
'name' => $skill->getField('name', true), 'name' => $skill->getField('name', true),
'icon' => $skill->getField('iconString'),
'id' => $_id 'id' => $_id
), ),
); );
@@ -364,6 +364,6 @@ $smarty->assign('lang', array_merge(Lang::$main));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData);
// load the page // load the page
$smarty->display('skill.tpl'); $smarty->display('detail-page-generic.tpl');
?> ?>

View File

@@ -52,6 +52,6 @@ $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData);
// load the page // load the page
$smarty->display('generic-no-filter.tpl'); $smarty->display('list-page-generic.tpl');
?> ?>

View File

@@ -6,7 +6,8 @@ if (!defined('AOWOW_REVISION'))
require 'includes/community.class.php'; require 'includes/community.class.php';
$_id = intVal($pageParam); $_id = intVal($pageParam);
$_path = [0, 1];
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, 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]); $cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_SPELL, $_id, -1, User::$localeId]);
@@ -53,15 +54,15 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$spell = new SpellList(array(['s.id', $_id])); $spell = new SpellList(array(['s.id', $_id]));
if ($spell->error) if ($spell->error)
$smarty->notFound(Lang::$game['spell']); $smarty->notFound(Lang::$game['spell'], $_id);
$spell->addGlobalsToJScript($smarty, GLOBALINFO_ANY); $spell->addGlobalsToJScript($smarty, GLOBALINFO_ANY);
$_cat = $spell->getField('typeCat'); $_cat = $spell->getField('typeCat');
$path = [0, 1, $_cat];
$l = [null, 'A', 'B', 'C']; $l = [null, 'A', 'B', 'C'];
$_path[] = $_cat;
// reconstruct path / title // reconstruct path
switch($_cat) switch($_cat)
{ {
case -2: case -2:
@@ -74,7 +75,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
if ($cl & (1 << ($i - 1))) if ($cl & (1 << ($i - 1)))
{ {
$path[] = $i; $_path[] = $i;
break; break;
} }
$i++; $i++;
@@ -82,32 +83,32 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($_cat == -13) if ($_cat == -13)
{ {
$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; break;
} }
case 9: case 9:
case -3: case -3:
case 11: case 11:
$path[] = $spell->getField('skillLines')[0]; $_path[] = $spell->getField('skillLines')[0];
if ($_cat == 11) if ($_cat == 11)
if ($_ = $spell->getField('reqSpellId')) if ($_ = $spell->getField('reqSpellId'))
$path[] = $_; $_path[] = $_;
break; break;
case -11: case -11:
foreach (SpellList::$skillLines as $line => $skills) foreach (SpellList::$skillLines as $line => $skills)
if (in_array($spell->getField('skillLines')[0], $skills)) if (in_array($spell->getField('skillLines')[0], $skills))
$path[] = $line; $_path[] = $line;
break; break;
case -7: // only spells unique in skillLineAbility will always point to the right skillLine :/ case -7: // only spells unique in skillLineAbility will always point to the right skillLine :/
$_ = $spell->getField('cuFlags'); $_ = $spell->getField('cuFlags');
if ($_ & SPELL_CU_PET_TALENT_TYPE0) if ($_ & SPELL_CU_PET_TALENT_TYPE0)
$path[] = 411; // Ferocity $_path[] = 411; // Ferocity
else if ($_ & SPELL_CU_PET_TALENT_TYPE1) else if ($_ & SPELL_CU_PET_TALENT_TYPE1)
$path[] = 409; // Tenacity $_path[] = 409; // Tenacity
else if ($_ & SPELL_CU_PET_TALENT_TYPE2) else if ($_ & SPELL_CU_PET_TALENT_TYPE2)
$path[] = 410; // Cunning $_path[] = 410; // Cunning
} }
// has difficulty versions of itself // has difficulty versions of itself
@@ -400,7 +401,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$pageData = array( $pageData = array(
'title' => $spell->getField('name', true), 'title' => $spell->getField('name', true),
'path' => json_encode($path, JSON_NUMERIC_CHECK), 'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'infobox' => $infobox, 'infobox' => $infobox,
'relTabs' => [], 'relTabs' => [],
'buttons' => array( 'buttons' => array(
@@ -1073,6 +1074,25 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
unset($foo); // clear reference unset($foo); // clear reference
// factionchange-equivalent
/* nyi
$pendant = DB::Aowow()->selectCell('SELECT IF(horde_id = ?d, alliance_id, -horde_id) FROM player_factionchange_items WHERE alliance_id = ?d OR horde_id = ?d', $_id, $_id, $_id);
if ($pendant)
{
$altiSpell = new SpellList(array(['id', abs($pendant)]));
if (!$altSpell->error)
{
$pageData['page']['transfer'] = array(
'id' => $altItem->id,
'icon' => $altItem->getField('iconString'),
'name' => $altItem->getField('name', true),
'facInt' => $pendant > 0 ? 'alliance' : 'horde',
'facName' => $pendant > 0 ? Lang::$game['si'][1] : Lang::$game['si'][2]
);
)
}
*/
/**************/ /**************/
/* Extra Tabs */ /* Extra Tabs */
/**************/ /**************/
@@ -1195,7 +1215,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if (!$saSpells->error) if (!$saSpells->error)
{ {
$data = $saSpells->getListviewData(); $data = $saSpells->getListviewData();
if ($difficulties) // needs a way to distinguish between dungeon and raid :x if ($difficulties) // needs a way to distinguish between dungeon and raid :x; creature using this -> map -> areaType
{ {
$saE = '$[Listview.extraCols.mode]'; $saE = '$[Listview.extraCols.mode]';

View File

@@ -255,7 +255,7 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
array_unshift($title, Lang::$game['cl'][$cats[1]]); array_unshift($title, Lang::$game['cl'][$cats[1]]);
$conditions[] = ['s.typeCat', [7, -2]]; $conditions[] = ['s.typeCat', [7, -2]];
$conditions[] = [['s.cuFlags', (SPELL_CU_TRIGGERED | SPELL_CU_TALENT | SPELL_CU_EXCLUDE_CATEGORY_SEARCH), '&'], 0]; $conditions[] = [['s.cuFlags', (SPELL_CU_TRIGGERED | SPELL_CU_TALENT | CUSTOM_EXCLUDE_FOR_LISTVIEW), '&'], 0];
// Runeforging listed multiple times, exclude from explicit skill-listing // Runeforging listed multiple times, exclude from explicit skill-listing
// if (isset($cats[1]) && $cats[1] == 6 && isset($cats[2]) && $cats[2] != 776) // if (isset($cats[1]) && $cats[1] == 6 && isset($cats[2]) && $cats[2] != 776)
@@ -378,7 +378,7 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
$conditions[] = array( $conditions[] = array(
'OR', 'OR',
['s.typeCat', 0], ['s.typeCat', 0],
['s.cuFlags', SPELL_CU_EXCLUDE_CATEGORY_SEARCH, '&'] ['s.cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&']
); );
break; break;

View File

@@ -14,7 +14,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$title = new TitleList(array(['id', $_id])); $title = new TitleList(array(['id', $_id]));
if ($title->error) if ($title->error)
$smarty->notFound(Lang::$game['title']); $smarty->notFound(Lang::$game['title'], $_id);
/***********/ /***********/
/* Infobox */ /* Infobox */
@@ -38,25 +38,31 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
/* Main Content */ /* Main Content */
/****************/ /****************/
// menuId 10: Title g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $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( 'page' => array(
'name' => $title->getHtmlizedName(), 'title' => Util::ucFirst(trim(str_replace('%s', '', str_replace(',', '', $title->getField('male', true)))))." - ".Util::ucfirst(Lang::$game['title']),
'expansion' => Util::$expansionString[$title->getField('expansion')] 'path' => '[0, 10, '.$title->getField('category').']',
) 'tab' => 0,
'type' => TYPE_TITLE,
'typeId' => $_id,
'name' => $title->getHtmlizedName(),
'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null,
'expansion' => Util::$expansionString[$title->getField('expansion')],
'redButtons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => true
),
),
'relTabs' => []
); );
/**************/ /**************/
/* Extra Tabs */ /* Extra Tabs */
/**************/ /**************/
// tab: sources
if (!empty($title->sources[$_id])) if (!empty($title->sources[$_id]))
{ {
foreach ($title->sources[$_id] as $type => $entries) foreach ($title->sources[$_id] as $type => $entries)
@@ -101,25 +107,18 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
} }
// tab: criteria of (to be added by TC)
$smarty->saveCache($cacheKeyPage, $pageData); $smarty->saveCache($cacheKeyPage, $pageData);
} }
// menuId 10: Title g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => $pageData['title']." - ".Util::ucfirst(Lang::$game['title']),
'path' => $pageData['path'],
'tab' => 0,
'type' => TYPE_TITLE,
'typeId' => $_id
));
$smarty->assign('redButtons', $pageData['buttons']);
$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('lang', array_merge(Lang::$main));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['relTabs']);
// load the page // load the page
$smarty->display('title.tpl'); $smarty->display('detail-page-generic.tpl');
?> ?>

View File

@@ -4,26 +4,34 @@ if (!defined('AOWOW_REVISION'))
die('illegal access'); die('illegal access');
$cat = Util::extractURLParams($pageParam)[0]; $cat = Util::extractURLParams($pageParam);
$path = [0, 10]; $path = [0, 10];
$validCats = [0, 1, 2, 3, 4, 5, 6]; $validCats = [0, 1, 2, 3, 4, 5, 6];
$title = [Util::ucFirst(Lang::$game['titles'])]; $title = [Util::ucFirst(Lang::$game['titles'])];
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_TITLE, -1, isset($cat) ? $cat : -1, User::$localeId]); $cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_TITLE, -1, $cat ? $cat[0] : -1, User::$localeId]);
if (!in_array($cat, $validCats)) if ($cat)
$smarty->error(); {
if (!in_array($cat[0], $validCats))
$smarty->error();
$path[] = $cat; // should be only one parameter anyway $path[] = $cat[0]; // should be only one parameter anyway
array_unshift($title, Lang::$title['cat'][$cat[0]]);
if (isset($cat)) }
array_unshift($title, Lang::$title['cat'][$cat]);
if (!$smarty->loadCache($cacheKey, $pageData)) if (!$smarty->loadCache($cacheKey, $pageData))
{ {
$titles = new TitleList(isset($cat) ? array(['category', (int)$cat]) : []); $titles = new TitleList($cat ? array(['category', (int)$cat[0]]) : []);
// menuId 10: Title g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'listviews' => [] 'page' => array(
'title' => implode(" - ", $title),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0
),
'lv' => []
); );
$lvTitles = array( $lvTitles = array(
@@ -38,23 +46,17 @@ if (!$smarty->loadCache($cacheKey, $pageData))
if (!$titles->hasAnySource()) if (!$titles->hasAnySource())
$lvTitles['params']['hiddenCols'] = "$['source']"; $lvTitles['params']['hiddenCols'] = "$['source']";
$pageData['listviews'][] = $lvTitles; $pageData['lv'][] = $lvTitles;
$smarty->saveCache($cacheKey, $pageData); $smarty->saveCache($cacheKey, $pageData);
} }
// menuId 10: Title g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => implode(" - ", $title),
'path' => "[".implode(", ", $path)."]",
'tab' => 0
));
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
$smarty->display('generic-no-filter.tpl'); $smarty->display('list-page-generic.tpl');
?> ?>

View File

@@ -146,6 +146,6 @@ $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData);
// load the page // load the page
$smarty->display('generic-no-filter.tpl'); $smarty->display('list-page-generic.tpl');
?> ?>

View File

@@ -238,9 +238,11 @@ if ($searchMask & 0x8)
foreach ($data as &$d) foreach ($data as &$d)
{ {
$updated = WorldEventList::updateDates($d['startDate'], $d['endDate'], $d['rec']); $updated = WorldEventList::updateDates($d);
$d['startDate'] = date(Util::$dateFormatLong, $updated['start']); unset($d['_date']);
$d['endDate'] = date(Util::$dateFormatLong, $updated['end']); $d['startDate'] = $updated['start'] ? date(Util::$dateFormatInternal, $updated['start']) : false;
$d['endDate'] = $updated['end'] ? date(Util::$dateFormatInternal, $updated['end']) : false;
$d['rec'] = $updated['rec'];
} }
$found['event'] = array( $found['event'] = array(

View File

@@ -12,8 +12,8 @@
<div class="pad3"></div> <div class="pad3"></div>
<div class="inputbox"> <div class="inputbox">
<h1>{$page.subject} #{$page.id}</h1> <h1>{$subject} #{$id}</h1>
<div id="inputbox-error">{$page.notFound}</div> <div id="inputbox-error">{$notFound}</div>
<!-- --> <!-- -->
</div> </div>
</div> </div>

View File

@@ -12,34 +12,31 @@
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{include file='bricks/community.tpl'} {include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"quotes"}'{rdelim}; // username:XXX in profiles var g_pageInfo = {ldelim}type: {$type}, typeId: {$typeId}, name: '{$name|escape:"quotes"}'{rdelim}; // username:XXX in profiles
g_initPath({$page.path}); g_initPath({$path});
//]]></script> //]]></script>
{include file='bricks/infobox.tpl' info=$lvData.infobox series=$lvData.series} {include file='bricks/infobox.tpl' info=$infobox series=$series}
<div class="text"> <div class="text">
{include file='bricks/headIcons.tpl'}
{include file='bricks/redButtons.tpl'} {include file='bricks/redButtons.tpl'}
<div id="h1-icon-generic" class="h1-icon"></div> <h1{if isset($expansion)} class="h1-icon"><span class="{$expansion}-icon-right">{$name}</span>{else}>{$name}{/if}</h1>
<script type="text/javascript">//<![CDATA[
$WH.ge('h1-icon-generic').appendChild(Icon.create('{$lvData.page.iconname|escape:"javascript"}', 1));
//]]></script>
<h1 class="h1-icon">{$lvData.page.name}</h1> {$description}
{$lvData.page.description} {if !empty($criteria)}<h3>{$lang.criteria}{if $count} &ndash; <small><b>{$lang.reqNumCrt} {$count} {$lang.outOf} {$nCriteria}</b></small>{/if}</h3>{/if}
{if !empty($lvData.page.criteria)}<h3>{$lang.criteria}{if $lvData.page.count} &ndash; <small><b>{$lang.requires} {$lvData.page.count} {$lang.outOf} {$lvData.page.nCriteria}</b></small>{/if}</h3>{/if}
<div style="float: left; margin-right: 25px"> <div style="float: left; margin-right: 25px">
<table class="iconlist"> <table class="iconlist">
{strip} {strip}
{foreach from=$lvData.page.criteria item=cr name=criteria} {foreach from=$criteria item=cr name=criteria}
<tr> <tr>
<th{if isset($cr.icon)} align="right" id="iconlist-icon{$cr.icon}"{/if}> <th{if isset($cr.icon)} align="right" id="iconlist-icon{$cr.icon}"{/if}>
{* for reference and standard entries *} {* for reference and standard entries *}
{if !isset($cr.icon) && (isset($cr.link) || $cr.standard)} {if !isset($cr.icon) && (isset($cr.link) || isset($cr.standard))}
<ul><li><var>&nbsp;</var></li></ul> <ul><li><var>&nbsp;</var></li></ul>
{/if} {/if}
</th> </th>
@@ -52,7 +49,7 @@
</td> </td>
</tr> </tr>
{* If the first column is over (it may be a greater element) *} {* If the first column is over (it may be a greater element) *}
{if $smarty.foreach.criteria.index+1 == round(count($lvData.page.criteria) / 2)} {if $smarty.foreach.criteria.index+1 == round(count($criteria) / 2)}
</table> </table>
</div> </div>
<div style="float: left"> <div style="float: left">
@@ -64,22 +61,22 @@
</div> </div>
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{foreach from=$lvData.page.icons key=k item=ic} {foreach from=$icons key=k item=ic}
$WH.ge('iconlist-icon{$ic.itr}').appendChild({$ic.type}.createIcon({$ic.id}, 0, {if isset($ic.count) && $ic.count > 0}{$ic.count}{else}0{/if})); $WH.ge('iconlist-icon{$ic.itr}').appendChild({$ic.type}.createIcon({$ic.id}, 0, {if isset($ic.count) && $ic.count > 0}{$ic.count}{else}0{/if}));
{/foreach} {/foreach}
//]]></script> //]]></script>
<div style="clear: left"></div> <div style="clear: left"></div>
{if $lvData.page.itemReward} {* for items *} {if $itemReward} {* for items *}
<h3>{$lang.rewards}</h3> <h3>{$lang.rewards}</h3>
{$lang.itemReward}<table class="icontab"> {$lang.itemReward}<table class="icontab">
<tr> <tr>
{foreach from=$lvData.page.itemReward item=i name=item key=id} {foreach from=$itemReward item=i name=item key=id}
<th id="icontab-icon{$smarty.foreach.item.index}"></th><td><span class="q{$i.quality}"><a href="?item={$id}">{$i.name}</a></span></td> <th id="icontab-icon{$smarty.foreach.item.index}"></th><td><span class="q{$i.quality}"><a href="?item={$id}">{$i.name}</a></span></td>
{/foreach} {/foreach}
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{foreach from=$lvData.page.itemReward item=i name=item key=id} {foreach from=$itemReward item=i name=item key=id}
$WH.ge('icontab-icon{$smarty.foreach.item.index}').appendChild(g_items.createIcon({$id}, 1, 1)); $WH.ge('icontab-icon{$smarty.foreach.item.index}').appendChild(g_items.createIcon({$id}, 1, 1));
{/foreach} {/foreach}
//]]></script> //]]></script>
@@ -87,27 +84,26 @@
</table> </table>
{/if} {/if}
{if $lvData.page.titleReward} {* for titles *} {if $titleReward} {* for titles *}
<h3>{$lang.gains}</h3> <h3>{$lang.gains}</h3>
<ul> <ul>
{foreach from=$lvData.page.titleReward item=i} {foreach from=$titleReward item=i}
<li><div>{$i}</div></li> <li><div>{$i}</div></li>
{/foreach} {/foreach}
</ul> </ul>
{/if} {/if}
{if !$lvData.page.titleReward && !$lvData.page.itemReward && $lvData.page.reward} {if !$titleReward && !$itemReward && $reward}
<h3>{$lang.rewards}</h3> <h3>{$lang.rewards}</h3>
<ul> <ul>
<li><div>{$lvData.page.reward}</div></li> <li><div>{$reward}</div></li>
</ul> </ul>
{/if} {/if}
<h2 class="clear">{$lang.related}</h2>
<h2>{$lang.related}</h2>
</div> </div>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs} {include file='bricks/tabsRelated.tpl' tabs=$lvData}
{include file='bricks/contribute.tpl'} {include file='bricks/contribute.tpl'}

View File

@@ -11,14 +11,14 @@
{/if} {/if}
<script type="text/javascript"> <script type="text/javascript">
g_initPath({$page.path}, {if empty($filter.query)}0{else}1{/if}); g_initPath({$path}, {if empty($filter.query)}0{else}1{/if});
{if isset($filter.query)} {if isset($filter.query)}
Menu.modifyUrl(Menu.findItem(mn_database, [9]), {ldelim} filter: '+={$filter.query|escape:'quotes'}' {rdelim}, {ldelim} onAppendCollision: fi_mergeFilterParams, onAppendEmpty: fi_setFilterParams, menuUrl: Menu.getItemUrl(Menu.findItem(mn_database, [9])) {rdelim}); Menu.modifyUrl(Menu.findItem(mn_database, [9]), {ldelim} filter: '+={$filter.query|escape:'quotes'}' {rdelim}, {ldelim} onAppendCollision: fi_mergeFilterParams, onAppendEmpty: fi_setFilterParams, menuUrl: Menu.getItemUrl(Menu.findItem(mn_database, [9])) {rdelim});
{/if} {/if}
</script> </script>
<div id="fi" style="display: {if empty($filter.query)}none{else}block{/if};"> <div id="fi" style="display: {if empty($filter.query)}none{else}block{/if};">
<form action="?achievements{$page.subCat}&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)"> <form action="?achievements{$subCat}&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
<table> <table>
<tr> <tr>
<td>{$lang.name|ucFirst}{$lang.colon}</td> <td>{$lang.name|ucFirst}{$lang.colon}</td>

View File

@@ -0,0 +1,10 @@
{if !empty($headIcons)}
{foreach from=$headIcons key='k' item='v'}
<div id="h1-icon-{$k}" class="h1-icon"></div>
{/foreach}
<script type="text/javascript">//<![CDATA[
{foreach from=$headIcons key='k' item='v'}
$WH.ge('h1-icon-{$k}').appendChild(Icon.create('{$v}', 1));
{/foreach}
//]]></script>
{/if}

View File

@@ -1,5 +1,5 @@
<table class="infobox"> <table class="infobox">
{if !empty($info)} {if !empty($infobox)}
<tr><th id="infobox-quick-facts">{$lang.quickFacts}</th></tr> <tr><th id="infobox-quick-facts">{$lang.quickFacts}</th></tr>
<tr><td><div class="infobox-spacer"></div><div id="infobox-contents0"></div></td></tr> <tr><td><div class="infobox-spacer"></div><div id="infobox-contents0"></div></td></tr>
{/if} {/if}
@@ -14,7 +14,7 @@
<td><div> <td><div>
{foreach name=itemItr from=$itr item='i'} {foreach name=itemItr from=$itr item='i'}
{if $i.side == 1}<span class="alliance-icon-padded">{elseif $i.side == 2}<span class="horde-icon-padded">{/if} {if $i.side == 1}<span class="alliance-icon-padded">{elseif $i.side == 2}<span class="horde-icon-padded">{/if}
{if ($i.typeId == $page.typeId)} {if ($i.typeId == $typeId)}
<b>{$i.name}</b> <b>{$i.name}</b>
{else} {else}
<a href="?{$i.typeStr}={$i.typeId}">{$i.name}</a> <a href="?{$i.typeStr}={$i.typeId}">{$i.name}</a>
@@ -39,8 +39,8 @@
{if $user.id > 0} {if $user.id > 0}
<script type="text/javascript">vi_appendSticky()</script> <script type="text/javascript">vi_appendSticky()</script>
{/if} {/if}
{if !empty($info)} {if !empty($infobox)}
<script type="text/javascript"> <script type="text/javascript">
Markup.printHtml("{$info}", "infobox-contents0", {ldelim} allow: Markup.CLASS_STAFF, dbpage: true {rdelim}); Markup.printHtml("{$infobox}", "infobox-contents0", {ldelim} allow: Markup.CLASS_STAFF, dbpage: true {rdelim});
</script> </script>
{/if} {/if}

View File

@@ -14,14 +14,12 @@
data:[ data:[
{foreach name=i from=$data item=curr} {foreach name=i from=$data item=curr}
{ldelim} {ldelim}
{if $curr.rec} {foreach from=$curr key='name' item=val}
rec:{$curr.rec}, {if $name != 'id'}
{/if} {$name}:{$val|@json_encode:$smarty.const.JSON_NUMERIC_CHECK},
category:{$curr.category}, {/if}
id:{$curr.id}, {/foreach}
name:'{$curr.name|escape:"javascript"}', id:{$curr.id}
startDate:'{$curr.startDate}',
endDate:'{$curr.endDate}'
{rdelim} {rdelim}
{if $smarty.foreach.i.last}{else},{/if} {if $smarty.foreach.i.last}{else},{/if}
{/foreach} {/foreach}

View File

@@ -3,14 +3,6 @@ found this button(?) in item.tpl .. no script, data or style found for this id
<div id="sdlkgnfdlkgndfg4"></div> <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])} {if isset($redButtons[$smarty.const.BUTTON_WOWHEAD])}
{assign var='b' value=$redButtons[$smarty.const.BUTTON_WOWHEAD]} {assign var='b' value=$redButtons[$smarty.const.BUTTON_WOWHEAD]}
{if $b} {if $b}
@@ -19,6 +11,14 @@ found this button(?) in item.tpl .. no script, data or style found for this id
<a href="javascript:;" class="button-red button-red-disabled"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a> <a href="javascript:;" class="button-red button-red-disabled"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
{/if} {/if}
{/if} {/if}
{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: '{$name|escape:"javascript"}', {/if}type: {$type}, typeId: {$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_VIEW3D])} {if isset($redButtons[$smarty.const.BUTTON_VIEW3D])}
{assign var='b' value=$redButtons[$smarty.const.BUTTON_VIEW3D]} {assign var='b' value=$redButtons[$smarty.const.BUTTON_VIEW3D]}
{if $b} {if $b}
@@ -30,7 +30,7 @@ found this button(?) in item.tpl .. no script, data or style found for this id
{if isset($redButtons[$smarty.const.BUTTON_COMPARE])} {if isset($redButtons[$smarty.const.BUTTON_COMPARE])}
{assign var='b' value=$redButtons[$smarty.const.BUTTON_COMPARE]} {assign var='b' value=$redButtons[$smarty.const.BUTTON_COMPARE]}
{if $b} {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> <a href="javascript:;" class="button-red" onclick="this.blur(); su_addToSaved('{if isset($b.eqList)}{$b.eqList}{else}{$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} {else}
<a href="javascript:;" class="button-red button-red-disabled"><em><b><i>{$lang.compare}</i></b><span>{$lang.compare}</span></em></a> <a href="javascript:;" class="button-red button-red-disabled"><em><b><i>{$lang.compare}</i></b><span>{$lang.compare}</span></em></a>
{/if} {/if}
@@ -38,7 +38,7 @@ found this button(?) in item.tpl .. no script, data or style found for this id
{if isset($redButtons[$smarty.const.BUTTON_UPGRADE])} {if isset($redButtons[$smarty.const.BUTTON_UPGRADE])}
{assign var='b' value=$redButtons[$smarty.const.BUTTON_UPGRADE]} {assign var='b' value=$redButtons[$smarty.const.BUTTON_UPGRADE]}
{if $b} {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> <a href="javascript:;" class="button-red" onclick="this.blur(); pr_showClassPresetMenu(this, {$typeId}, {$b.class}, {$b.slot}, event);"><em><b><i>{$lang.findUpgrades}</i></b><span>{$lang.findUpgrades}</span></em></a>
{else} {else}
<a href="javascript:;" class="button-red button-red-disabled"><em><b><i>{$lang.findUpgrades}</i></b><span>{$lang.findUpgrades}</span></em></a> <a href="javascript:;" class="button-red button-red-disabled"><em><b><i>{$lang.findUpgrades}</i></b><span>{$lang.findUpgrades}</span></em></a>
{/if} {/if}

View File

@@ -1,28 +1,28 @@
<div id="ic{$page.typeId}" style="float: left"></div> <div id="ic{$typeId}" style="float: left"></div>
<div id="tt{$page.typeId}" class="tooltip" style="float: left; padding-top: 1px"></div> <div id="tt{$typeId}" class="tooltip" style="float: left; padding-top: 1px"></div>
<div style="clear: left"></div> <div style="clear: left"></div>
<div id="sl{$page.typeId}" style="margin-left: 70px; margin-top: 4px;"></div> <div id="sl{$typeId}" style="margin-left: 70px; margin-top: 4px;"></div>
<div id="ks{$page.typeId}" style="margin-left: 70px; margin-top: 4px;"></div> <div id="ks{$typeId}" style="margin-left: 70px; margin-top: 4px;"></div>
{if !empty($jsGlobals[6][2].buff)} {* not set with items *} {if !empty($jsGlobals[6][2].buff)} {* not set with items *}
<h3>{$lang._aura}</h3> <h3>{$lang._aura}</h3>
<div id="btt{$page.typeId}" class="tooltip"></div> <div id="btt{$typeId}" class="tooltip"></div>
{/if} {/if}
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
$WH.ge('ic{$page.typeId}').appendChild(Icon.create('{$lvData.page.icon}', 2, null, 0, {$lvData.page.stack})); $WH.ge('ic{$typeId}').appendChild(Icon.create('{$headIcons[0]}', 2, null, 0, {$headIcons[1]}));
var var
tt = $WH.ge('tt{$page.typeId}'), tt = $WH.ge('tt{$typeId}'),
{if !empty($jsGlobals[6][2].buff)} {if !empty($jsGlobals[6][2].buff)}
btt = $WH.ge('btt{$page.typeId}'), btt = $WH.ge('btt{$typeId}'),
{/if} {/if}
sl = $WH.ge('sl{$page.typeId}'), sl = $WH.ge('sl{$typeId}'),
ks = $WH.ge('ks{$page.typeId}'); ks = $WH.ge('ks{$typeId}');
tt.innerHTML = '<table><tr><td>' + ($WH.g_enhanceTooltip.bind(tt))({$page.typeId}, true, true, sl, null, [{$page.typeId}], ks, null) + '</td><th style="background-position: top right"></th></tr><tr><th style="background-position: bottom left"></th><th style="background-position: bottom right"></th></tr></table>'; tt.innerHTML = '<table><tr><td>' + ($WH.g_enhanceTooltip.bind(tt))({$typeId}, true, true, sl, null, [{$typeId}], ks, null) + '</td><th style="background-position: top right"></th></tr><tr><th style="background-position: bottom left"></th><th style="background-position: bottom right"></th></tr></table>';
$WH.Tooltip.fixSafe(tt, 1, 1); $WH.Tooltip.fixSafe(tt, 1, 1);
{if !empty($jsGlobals[6][2].buff)} {if !empty($jsGlobals[6][2].buff)}
btt.innerHTML = '<table><tr><td>' + ($WH.g_enhanceTooltip.bind(btt))({$page.typeId}, true, true, sl, tt, [{$page.typeId}], ks) + '</td><th style="background-position: top right"></th></tr><tr><th style="background-position: bottom left"></th><th style="background-position: bottom right"></th></tr></table>'; btt.innerHTML = '<table><tr><td>' + ($WH.g_enhanceTooltip.bind(btt))({$typeId}, true, true, sl, tt, [{$typeId}], ks) + '</td><th style="background-position: top right"></th></tr><tr><th style="background-position: bottom left"></th><th style="background-position: bottom right"></th></tr></table>';
$WH.Tooltip.fixSafe(btt, 1, 1); $WH.Tooltip.fixSafe(btt, 1, 1);
{/if} {/if}
//]]></script> //]]></script>

View File

@@ -1,43 +0,0 @@
{include file='header.tpl'}
<div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents">
{if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
<script type="text/javascript">//<![CDATA[
{include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"quotes"}'{rdelim};
g_initPath({$page.path});
//]]></script>
{include file='bricks/infobox.tpl' info=$lvData.infobox}
<div class="text">
<div id="headicon-generic" class="h1-icon"></div>
<script type="text/javascript">
$WH.ge('headicon-generic').appendChild(Icon.create('{$lvData.page.icon}', 1));
</script>
{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'}
<h2 class="clear">{$lang.related}</h2>
</div>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}
{include file='bricks/contribute.tpl'}
</div><!-- main-contents -->
</div><!-- main -->
{include file='footer.tpl'}

View File

@@ -13,10 +13,10 @@
<div class="text"> <div class="text">
<div id="compare-generic"></div> <div id="compare-generic"></div>
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{foreach name=cmpItems from=$lvData.items item=curr} {foreach name=cmpItems from=$items item=curr}
g_items.add({$curr[0]}, {ldelim}name_{$user.language}:'{$curr[1]}', quality:{$curr[2]}, icon:'{$curr[3]}', jsonequip:{$curr[4]}{rdelim}); g_items.add({$curr[0]}, {ldelim}name_{$user.language}:'{$curr[1]}', quality:{$curr[2]}, icon:'{$curr[3]}', jsonequip:{$curr[4]}{rdelim});
{/foreach} {/foreach}
new Summary({ldelim}template:'compare',id:'compare',parent:'compare-generic',groups:{$lvData.summary}{rdelim}); new Summary({ldelim}template:'compare',id:'compare',parent:'compare-generic',groups:{$summary}{rdelim});
//]]></script> //]]></script>
</div> </div>
<div class="clear"></div> <div class="clear"></div>

View File

@@ -141,6 +141,7 @@ a span.moneyitem, a span.moneysocketmeta, a span.moneysocketred, a span.moneysoc
.s1 { color: #ff3f40 !important } /* Yell */ .s1 { color: #ff3f40 !important } /* Yell */
.s2 { color: #fffb9f !important } /* Say */ .s2 { color: #fffb9f !important } /* Say */
.s3 { color: #ffb2eb !important } /* Whisper */ .s3 { color: #ffb2eb !important } /* Whisper */
.s4 { color: #ff8040 !important } /* Emote */
/*****************/ /*****************/
/* SOCKETS ICONS */ /* SOCKETS ICONS */

View File

@@ -190,6 +190,12 @@ a.selected, a.selected:hover
color: #909090; color: #909090;
} }
.text span.rep-difficulty {
font-weight: bold;
text-shadow: 0 0 6px gray;
filter: dropshadow(color=gray,offx=0,offy=0);
}
h1 a, h2 a, h3 a, h4 a, h5 a, h1 a.icontiny span, h2 a.icontiny span, h3 a.icontiny span, h4 a.icontiny span, h5 a.icontiny span h1 a, h2 a, h3 a, h4 a, h5 a, h1 a.icontiny span, h2 a.icontiny span, h3 a.icontiny span, h4 a.icontiny span, h5 a.icontiny span
{ {
text-decoration:none !important; text-decoration:none !important;
@@ -3407,6 +3413,11 @@ a:hover, a.open, .infobox li div, .text b
padding-left: 26px; padding-left: 26px;
} }
.text ol ul, .text ol ol, .text ul ol, .text ul ul {
margin-bottom: 0px;
margin-top: 0px;
}
.text ul.first, .text ol.first, .comment-body h3.first .text ul.first, .text ol.first, .comment-body h3.first
{ {
margin-top: 0; margin-top: 0;
@@ -3419,7 +3430,7 @@ a:hover, a.open, .infobox li div, .text b
.text ul li, .comment-body ul li .text ul li, .comment-body ul li
{ {
color: #c3030b; /* color: #c3030b; */
list-style-type: square; list-style-type: square;
} }
@@ -3827,6 +3838,11 @@ div.modelviewer, div.screenshotviewer
border-radius: 6px; border-radius: 6px;
} }
.reputation-negative-amount span {
color: red;
font-weight: bold;
}
div.announcement-pagetop div.announcement-inner { div.announcement-pagetop div.announcement-inner {
margin-top: 10px; margin-top: 10px;
} }

View File

@@ -12,24 +12,25 @@
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{include file='bricks/community.tpl'} {include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"quotes"}'{rdelim}; var g_pageInfo = {ldelim}type: {$type}, typeId: {$typeId}, name: '{$name|escape:"quotes"}'{rdelim};
g_initPath({$page.path}); g_initPath({$path});
//]]></script> //]]></script>
{include file='bricks/infobox.tpl' info=$lvData.infobox} {include file='bricks/infobox.tpl'}
<div class="text"> <div class="text">
{include file='bricks/headIcons.tpl'}
{include file='bricks/redButtons.tpl'} {include file='bricks/redButtons.tpl'}
<h1>{$lvData.page.name}</h1> <h1{if isset($expansion)} class="h1-icon"><span class="{$expansion}-icon-right">{$name}</span>{else}>{$name}{/if}</h1>
{include file='bricks/article.tpl'} {include file='bricks/article.tpl'}
{if $lvData.spillover} {if isset($extraText)}
<div id="spillover" class="left"></div> <div id="text-generic" class="left"></div>
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
Markup.printHtml("{$lvData.spillover}", "spillover", {strip}{ldelim} Markup.printHtml("{$extraText}", "text-generic", {strip}{ldelim}
allow: Markup.CLASS_ADMIN, allow: Markup.CLASS_ADMIN,
dbpage: true dbpage: true
{rdelim}{/strip}); {rdelim}{/strip});
@@ -38,10 +39,15 @@
<div class="pad2"></div> <div class="pad2"></div>
{/if} {/if}
{if isset($unavailable)}
<div class="pad"></div>
<b style="color: red">{$lang._unavailable}</b>
{/if}
<h2 class="clear">{$lang.related}</h2> <h2 class="clear">{$lang.related}</h2>
</div> </div>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs} {include file='bricks/tabsRelated.tpl' tabs=$lvData}
{include file='bricks/contribute.tpl'} {include file='bricks/contribute.tpl'}

View File

@@ -1,20 +0,0 @@
{include file='header.tpl'}
<div id="main">
<div id="main-precontents"></div>
<div id="main-contents" class="main-contents">
<script type="text/javascript">
g_initPath({$page.path});
</script>
<div id="lv-factions" class="listview"></div>
<script type="text/javascript">
{include file='bricks/factions_table.tpl' data=$factions.data params=$factions.params}
</script>
<div class="clear"></div>
</div>
</div>
{include file='footer.tpl'}

View File

@@ -1,55 +0,0 @@
{include file='header.tpl'}
<div id="main">
<div id="main-precontents"></div>
<div id="main-contents" class="main-contents">
{if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
{if !empty($lvData.map)}
{include file='bricks/mapper.tpl' map=$lvData.map som=$lvData.som}
{/if}
<script type="text/javascript">
g_initPath({$page.path});
</script>
{if !empty($lvData.page.name) || !empty($lvData.page.h1Links)}
<div class="text">
{if !empty($lvData.page.h1Links)}
<div class="h1-links">{$lvData.page.h1Links}</div>
{/if}
{if !empty($lvData.page.name)}
<h1>{$lvData.page.name}</h1>
{/if}
</div>
{/if}
{if !empty($lvData.listviews)}
{if count($lvData.listviews) > 1}
<div id="tabs-generic"></div>
{/if}
<div id="lv-generic" class="listview"></div>
<script type="text/javascript">
{if count($lvData.listviews) > 1}
var myTabs = new Tabs({ldelim}parent: $WH.ge('tabs-generic'){rdelim});
{/if}
{foreach from=$lvData.listviews item=lv}
{if isset($lv.file)}
{include file="bricks/listviews/`$lv.file`.tpl" data=$lv.data params=$lv.params}
{/if}
{/foreach}
{if count($lvData.listviews) > 1}
myTabs.flush();
{/if}
</script>
<div class="clear"></div>
{/if}
</div>
</div>
{include file='footer.tpl'}

View File

@@ -1,4 +1,4 @@
<title>{if $page.title}{$page.title|escape:"html"} - {/if}{$appName}</title> <title>{if $title}{$title|escape:"html"} - {/if}{$appName}</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1"> <meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="SHORTCUT ICON" href="template/images/favicon.ico"> <link rel="SHORTCUT ICON" href="template/images/favicon.ico">
@@ -8,7 +8,7 @@
<!--[if IE]><link rel="stylesheet" type="text/css" href="template/css/global_ie.css?{$AOWOW_REVISION}" /><![endif]--> <!--[if IE]><link rel="stylesheet" type="text/css" href="template/css/global_ie.css?{$AOWOW_REVISION}" /><![endif]-->
<!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="template/css/global_ie6.css?{$AOWOW_REVISION}" /><![endif]--> <!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="template/css/global_ie6.css?{$AOWOW_REVISION}" /><![endif]-->
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="template/css/global_ie67.css?{$AOWOW_REVISION}" /><![endif]--> <!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="template/css/global_ie67.css?{$AOWOW_REVISION}" /><![endif]-->
{foreach from=$page.reqCSS item=css} {foreach from=$reqCSS item=css}
{if isset($css.string)} {if isset($css.string)}
<style type="text/css">{$css.string}</style> <style type="text/css">{$css.string}</style>
{else} {else}
@@ -25,7 +25,7 @@
<script src="template/js/locale_{$user.language}.js?{$AOWOW_REVISION}" type="text/javascript"></script> <script src="template/js/locale_{$user.language}.js?{$AOWOW_REVISION}" type="text/javascript"></script>
<script src="template/js/global.js?{$AOWOW_REVISION}" type="text/javascript"></script> <script src="template/js/global.js?{$AOWOW_REVISION}" type="text/javascript"></script>
<script src="template/js/Markup.js?{$AOWOW_REVISION}" type="text/javascript"></script> <script src="template/js/Markup.js?{$AOWOW_REVISION}" type="text/javascript"></script>
{foreach from=$page.reqJS item=file} {foreach from=$reqJS item=file}
<script src="{$file}{*?$AOWOW_REVISION*}" type="text/javascript"></script> <script src="{$file}{*?$AOWOW_REVISION*}" type="text/javascript"></script>
{/foreach} {/foreach}
<script type="text/javascript"> <script type="text/javascript">

View File

@@ -11,7 +11,7 @@
<div id="header"> <div id="header">
<div id="header-logo"> <div id="header-logo">
<a href="."></a> <a href="."></a>
<h1>{$page.title|escape:"html"}</h1> <h1>{$title|escape:"html"}</h1>
</div> </div>
</div> </div>
<div id="wrapper" class="nosidebar"> <div id="wrapper" class="nosidebar">
@@ -29,7 +29,7 @@
<div id="topbar-right"><div><form action="."><a href="javascript:;"></a><input name="search" size="35" value="" id="livesearch-generic" /></form></div></div> <div id="topbar-right"><div><form action="."><a href="javascript:;"></a><input name="search" size="35" value="" id="livesearch-generic" /></form></div></div>
<div id="topbar"><span id="topbar-generic" class="menu-buttons"></span><div class="clear"></div></div> <div id="topbar"><span id="topbar-generic" class="menu-buttons"></span><div class="clear"></div></div>
{strip}<script type="text/javascript"> {strip}<script type="text/javascript">
g_initHeader({$page.tab}); g_initHeader({$tab});
LiveSearch.attach($WH.ge('livesearch-generic')); LiveSearch.attach($WH.ge('livesearch-generic'));
{foreach from=$jsGlobals item="glob"} {foreach from=$jsGlobals item="glob"}
{include file="bricks/globals/`$glob[0]`.tpl" data=$glob[1] extra=$glob[2]} {include file="bricks/globals/`$glob[0]`.tpl" data=$glob[1] extra=$glob[2]}

View File

@@ -12,37 +12,38 @@
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{include file='bricks/community.tpl'} {include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '$lvData.name|escape:"quotes"}'{rdelim}; var g_pageInfo = {ldelim}type: {$type}, typeId: {$typeId}, name: '{$name|escape:"quotes"}'{rdelim};
g_initPath({$page.path}); g_initPath({$path});
//]]></script> //]]></script>
{include file='bricks/infobox.tpl' info=$lvData.infobox} {include file='bricks/infobox.tpl'}
<div class="text"> <div class="text">
{include file='bricks/redButtons.tpl'} {include file='bricks/redButtons.tpl'}
<h1>{$lvData.page.name}</h1> <h1{if isset($expansion)} class="h1-icon"><span class="{$expansion}-icon-right">{$name}</span>{else}>{$name}{/if}</h1>
{include file='bricks/tooltip.tpl'} {include file='bricks/tooltip.tpl'}
{if !empty($lvData.page.disabled)} {include file='bricks/article.tpl'}
{if !empty($disabled)}
<div class="pad"></div> <div class="pad"></div>
<b style="color: red">{$lang._unavailable}</b> <b style="color: red">{$lang._unavailable}</b>
{/if} {/if}
{if !empty($lvData.page.transfer)} {if !empty($transfer)}
<div class="pad"></div> <div class="pad"></div>
{$lang._transfer|sprintf:$lvData.page.transfer.id:$lvData.page.transfer.quality:$lvData.page.transfer.icon:$lvData.page.transfer.name:$lvData.page.transfer.facInt:$lvData.page.transfer.facName} {$transfer}
{/if} {/if}
{if !empty($lvData.page.subItems)} {if !empty($subItems)}
<div class="clear"></div> <div class="clear"></div>
<h3>{$lang._rndEnchants}</h3> <h3>{$lang._rndEnchants}</h3>
<div class="random-enchantments" style="margin-right: 25px"> <div class="random-enchantments" style="margin-right: 25px">
<ul> <ul>
{foreach from=$lvData.page.subItems item=i key=k}{if $k < (count($lvData.page.subItems) / 2)} {foreach from=$subItems item=i key=k}{if $k < (count($subItems) / 2)}
<li><div> <li><div>
<span class="q{$lvData.page.quality}">...{$i.name}</span> <span class="q{$quality}">...{$i.name}</span>
<small class="q0">{$lang._chance|@sprintf:$i.chance}</small> <small class="q0">{$lang._chance|@sprintf:$i.chance}</small>
<br />{$i.enchantment} <br />{$i.enchantment}
</div></li> </div></li>
@@ -50,12 +51,12 @@
</ul> </ul>
</div> </div>
{if count($lvData.page.subItems) > 1} {if count($subItems) > 1}
<div class="random-enchantments" style="margin-right: 25px"> <div class="random-enchantments" style="margin-right: 25px">
<ul> <ul>
{foreach from=$lvData.page.subItems item=i key=k}{if $k >= (count($lvData.page.subItems) / 2)} {foreach from=$subItems item=i key=k}{if $k >= (count($subItems) / 2)}
<li><div> <li><div>
<span class="q{$lvData.page.quality}">...{$i.name}</span> <span class="q{$quality}">...{$i.name}</span>
<small class="q0">{$lang._chance|@sprintf:$i.chance}</small> <small class="q0">{$lang._chance|@sprintf:$i.chance}</small>
<br />{$i.enchantment} <br />{$i.enchantment}
</div></li> </div></li>
@@ -64,14 +65,14 @@
</div> </div>
{/if} {/if}
{/if} {/if}
{if !empty($lvData.pageText)} {if !empty($pageText)}
<div class="clear"></div> <div class="clear"></div>
<h3>{$lang.content}</h3> <h3>{$lang.content}</h3>
<div id="book-generic"></div> <div id="book-generic"></div>
<script>//<![CDATA[ <script>//<![CDATA[
{strip}new Book({ldelim} parent: 'book-generic', pages: [ {strip}new Book({ldelim} parent: 'book-generic', pages: [
{foreach from=$lvData.pageText item=page name=j} {foreach from=$pageText item=page name=j}
'{$page|escape:"javascript"}' '{$page|escape:"javascript"}'
{if $smarty.foreach.j.last}{else},{/if} {if $smarty.foreach.j.last}{else},{/if}
{/foreach} {/foreach}
@@ -80,11 +81,10 @@
{/if} {/if}
<div style="clear: left"></div> <h2 class="clear">{$lang.related}</h2>
<h2>{$lang.related}</h2>
</div> </div>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs} {include file='bricks/tabsRelated.tpl' tabs=$lvData}
{include file='bricks/contribute.tpl'} {include file='bricks/contribute.tpl'}

View File

@@ -11,14 +11,14 @@
{/if} {/if}
<script type="text/javascript"> <script type="text/javascript">
g_initPath({$page.path}, {if empty($filter.query)}0{else}1{/if}); g_initPath({$path}, {if empty($filter.query)}0{else}1{/if});
{if isset($filter.query)} {if isset($filter.query)}
Menu.modifyUrl(Menu.findItem(mn_database, [0]), {ldelim} filter: '+={$filter.query|escape:'quotes'}' {rdelim}, {ldelim} onAppendCollision: fi_mergeFilterParams, onAppendEmpty: fi_setFilterParams, menuUrl: Menu.getItemUrl(Menu.findItem(mn_database, [0])) {rdelim}); Menu.modifyUrl(Menu.findItem(mn_database, [0]), {ldelim} filter: '+={$filter.query|escape:'quotes'}' {rdelim}, {ldelim} onAppendCollision: fi_mergeFilterParams, onAppendEmpty: fi_setFilterParams, menuUrl: Menu.getItemUrl(Menu.findItem(mn_database, [0])) {rdelim});
{/if} {/if}
</script> </script>
<div id="fi" style="display: {if empty($filter.query)}none{else}block{/if}"> <div id="fi" style="display: {if empty($filter.query)}none{else}block{/if};">
<form action="?items{$page.subCat}&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)"> <form action="?items{$subCat}&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
<div class="rightpanel"> <div class="rightpanel">
<div style="float: left">{$lang._quality}{$lang.colon}</div> <div style="float: left">{$lang._quality}{$lang.colon}</div>
@@ -63,7 +63,7 @@
<td colspan="2">&nbsp;<input type="text" name="na" size="30" {if isset($filter.na)}value="{$filter.na|escape:'html'}" {/if}/></td> <td colspan="2">&nbsp;<input type="text" name="na" size="30" {if isset($filter.na)}value="{$filter.na|escape:'html'}" {/if}/></td>
<td></td> <td></td>
</tr><tr> </tr><tr>
<td class="padded">Level{$lang.colon}</td> <td class="padded">{$lang.level}{$lang.colon}</td>
<td class="padded">&nbsp;<input type="text" name="minle" maxlength="3" class="smalltextbox2" {if isset($filter.minle)}value="{$filter.minle}" {/if}/> - <input type="text" name="maxle" maxlength="3" class="smalltextbox2" {if isset($filter.maxle)}value="{$filter.maxle}" {/if}/></td> <td class="padded">&nbsp;<input type="text" name="minle" maxlength="3" class="smalltextbox2" {if isset($filter.minle)}value="{$filter.minle}" {/if}/> - <input type="text" name="maxle" maxlength="3" class="smalltextbox2" {if isset($filter.maxle)}value="{$filter.maxle}" {/if}/></td>
<td class="padded"> <td class="padded">
<table> <table>
@@ -176,7 +176,7 @@
{/if} {/if}
<div id="lv-generic" class="listview"></div> <div id="lv-generic" class="listview"></div>
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{if !empty($lvData.page.gemScores)}var fi_gemScores = {$lvData.page.gemScores};{/if} {if !empty($gemScores)}var fi_gemScores = {$gemScores};{/if}
{if isset($lvData.data[0].params)} {if isset($lvData.data[0].params)}
var tabsRelated = new Tabs({ldelim}parent: $WH.ge('tabs-generic'){rdelim}); var tabsRelated = new Tabs({ldelim}parent: $WH.ge('tabs-generic'){rdelim});

View File

@@ -12,64 +12,66 @@
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{include file='bricks/community.tpl'} {include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"quotes"}'{rdelim}; var g_pageInfo = {ldelim}type: {$type}, typeId: {$typeId}, name: '{$name|escape:"quotes"}'{rdelim};
g_initPath({$page.path}); g_initPath({$path});
//]]></script> //]]></script>
{include file='bricks/infobox.tpl' info=$lvData.infobox} {include file='bricks/infobox.tpl'}
<div class="text"> <div class="text">
{include file='bricks/headIcons.tpl'}
{include file='bricks/redButtons.tpl'} {include file='bricks/redButtons.tpl'}
<h1>{$lvData.page.name}</h1> <h1{if isset($expansion)} class="h1-icon"><span class="{$expansion}-icon-right">{$name}</span>{else}>{$name}{/if}</h1>
{include file='bricks/article.tpl'} {include file='bricks/article.tpl'}
{$lvData.page.description} {$description}
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{section name=i loop=$lvData.pieces} {section name=i loop=$pieces}
g_items.add({$lvData.pieces[i].id}, {ldelim}name_{$user.language}:'{$lvData.pieces[i].name|escape:'javascript'}', quality:{$lvData.pieces[i].quality}, icon:'{$lvData.pieces[i].icon}', jsonequip:{$lvData.pieces[i].json}{rdelim}); g_items.add({$pieces[i].id}, {ldelim}name_{$user.language}:'{$pieces[i].name|escape:'javascript'}', quality:{$pieces[i].quality}, icon:'{$pieces[i].icon}', jsonequip:{$pieces[i].json}{rdelim});
{/section} {/section}
//]]></script> //]]></script>
<table class="iconlist"> <table class="iconlist">
{section name=i loop=$lvData.pieces} {section name=i loop=$pieces}
<tr><th align="right" id="iconlist-icon{$smarty.section.i.index + 1}"></th><td><span class="q{$lvData.pieces[i].quality}"><a href="?item={$lvData.pieces[i].id}">{$lvData.pieces[i].name}</a></span></td></tr> <tr><th align="right" id="iconlist-icon{$smarty.section.i.index + 1}"></th><td><span class="q{$pieces[i].quality}"><a href="?item={$pieces[i].id}">{$pieces[i].name}</a></span></td></tr>
{/section} {/section}
</table> </table>
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{section name=i loop=$lvData.pieces} {section name=i loop=$pieces}
$WH.ge('iconlist-icon{$smarty.section.i.index + 1}').appendChild(g_items.createIcon({$lvData.pieces[i].id}, 0, 0)); $WH.ge('iconlist-icon{$smarty.section.i.index + 1}').appendChild(g_items.createIcon({$pieces[i].id}, 0, 0));
{/section} {/section}
//]]></script> //]]></script>
{if $lvData.page.unavailable} {if $unavailable}
<div class="pad"></div><b style="color: red">{$lang._unavailable}</b> <div class="pad"></div>
<b style="color: red">{$lang._unavailable}</b>
{/if} {/if}
<h3>{$lang._setBonuses}{$lvData.page.bonusExt}</h3> <h3>{$lang._setBonuses}{$bonusExt}</h3>
{$lang._conveyBonus} {$lang._conveyBonus}
<ul> <ul>
{section name=i loop=$lvData.spells} {section name=i loop=$spells}
<li><div>{$lvData.spells[i].bonus} {$lang._pieces}{$lang.colon}<a href="?spell={$lvData.spells[i].id}">{$lvData.spells[i].desc}</a></div></li> <li><div>{$spells[i].bonus} {$lang._pieces}{$lang.colon}<a href="?spell={$spells[i].id}">{$spells[i].desc}</a></div></li>
{/section} {/section}
</ul> </ul>
<h2 class="clear">Summary</h2> <h2 class="clear">{$lang.summary}</h2>
<div id="summary-generic"></div> <div id="summary-generic"></div>
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
new Summary({ldelim} id: 'itemset', template: 'itemset', parent: 'summary-generic', groups: [[[{']],[['|implode:$lvData.compare.items}]]], level: {$lvData.compare.level}{rdelim}); new Summary({ldelim} id: 'itemset', template: 'itemset', parent: 'summary-generic', groups: [[[{']],[['|implode:$compare.items}]]], level: {$compare.level}{rdelim});
//]]></script> //]]></script>
<h2 class="clear">{$lang.related}</h2> <h2 class="clear">{$lang.related}</h2>
</div> </div>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs} {include file='bricks/tabsRelated.tpl' tabs=$lvData}
{include file='bricks/contribute.tpl'} {include file='bricks/contribute.tpl'}

View File

@@ -11,7 +11,7 @@
{/if} {/if}
<script type="text/javascript"> <script type="text/javascript">
g_initPath({$page.path}, {if empty($filter.query)} 0 {else} 1 {/if}); g_initPath({$path}, {if empty($filter.query)} 0 {else} 1 {/if});
{if !empty($filter.query)} {if !empty($filter.query)}
Menu.modifyUrl(Menu.findItem(mn_database, [2]), {ldelim} filter: '+={$filter.query|escape:'quotes'}' {rdelim}, {ldelim} onAppendCollision: fi_mergeFilterParams, onAppendEmpty: fi_setFilterParams, menuUrl: Menu.getItemUrl(Menu.findItem(mn_database, [2])) {rdelim}); Menu.modifyUrl(Menu.findItem(mn_database, [2]), {ldelim} filter: '+={$filter.query|escape:'quotes'}' {rdelim}, {ldelim} onAppendCollision: fi_mergeFilterParams, onAppendEmpty: fi_setFilterParams, menuUrl: Menu.getItemUrl(Menu.findItem(mn_database, [2])) {rdelim});
{/if} {/if}
@@ -108,7 +108,7 @@
//]]></script> //]]></script>
<div class="clear"></div> <div class="clear"></div>
</div> </div><!-- main-contents -->
</div> </div><!-- main -->
{include file='footer.tpl'} {include file='footer.tpl'}

View File

@@ -246,7 +246,7 @@ var fi_filters = {
{ id: 31, name: 'hasscreenshots', type: 'yn' }, { id: 31, name: 'hasscreenshots', type: 'yn' },
{ id: 40, name: 'hasvideos', type: 'yn' }, { id: 40, name: 'hasvideos', type: 'yn' },
{ id: 1, name: 'sepstaffonly', staffonly: true }, { id: 999, name: 'sepstaffonly', staffonly: true },
{ id: 41, name: 'haslocation', type: 'yn', staffonly: true } { id: 41, name: 'haslocation', type: 'yn', staffonly: true }
], ],
@@ -833,9 +833,9 @@ function fi_criterionChange(_this, crs, crv) {
} }
if (n) { if (n) {
_.maxLength = 7; _.maxLength = 8;
_.style.textAlign = 'center'; _.style.textAlign = 'center';
_.style.width = '4.5em'; _.style.width = '5.0em';
} }
else { else {
_.type = 'hidden'; _.type = 'hidden';
@@ -858,9 +858,9 @@ function fi_criterionChange(_this, crs, crv) {
_ = $WH.ce('input'); _ = $WH.ce('input');
_.type = 'text'; _.type = 'text';
if (criteriaParams.indexOf('small') != -1) { if (criteriaParams.indexOf('small') != -1) {
_.maxLength = 7; _.maxLength = 8;
_.style.textAlign = 'center'; _.style.textAlign = 'center';
_.style.width = '4.5em'; _.style.width = '5.0em';
} }
else { else {
_.maxLength = 50; _.maxLength = 50;
@@ -1659,9 +1659,15 @@ function fi_getExtraCols(wt, gm, pu) {
}; };
// Fix display of decimal columns // Fix display of decimal columns
if (/dps|speed/i.test(a.name)) { if (a.name == 'speed') {
b.compute = function (item, td) { b.compute = function (item, td) {
return (item[a.name] || 0).toFixed(2); return (item.speed || 0).toFixed(2);
}
}
if (/dps/i.test(a.name)) { // mledps|rngdps|dps
b.compute = function (item, td) {
return (item.dps || 0).toFixed(1);
} }
} }

View File

@@ -5621,15 +5621,25 @@ Listview.extraCols = {
var a = $WH.ce('a'); var a = $WH.ce('a');
a.href = cnd.url; a.href = cnd.url;
if (cnd.icon) {
a.className = 'icontiny tinyspecial';
a.style.backgroundImage = 'url(' + g_staticUrl + '/images/icons/tiny/' + cnd.icon + '.gif)';
}
if (cnd.quality) {
a.className += ' q' + cnd.quality;
}
a.style.whiteSpace = 'nowrap'; a.style.whiteSpace = 'nowrap';
$WH.st(a, cnd.name);
if (g_pageInfo.typeId == row.condition.typeId) { // ponts to self
a.className = 'q1';
$WH.st(a, 'This');
}
else {
$WH.st(a, cnd.name);
if (cnd.icon) {
a.className = 'icontiny tinyspecial';
a.style.backgroundImage = 'url(' + g_staticUrl + '/images/icons/tiny/' + cnd.icon + '.gif)';
}
if (cnd.quality) {
a.className += ' q' + cnd.quality;
}
}
$WH.ae(td, a); $WH.ae(td, a);
}, },
getVisibleText: function(row) { getVisibleText: function(row) {
@@ -5743,17 +5753,23 @@ Listview.extraCols = {
item = g_holidays[cond.typeId]; item = g_holidays[cond.typeId];
cnd.icon = item.icon.toLowerCase(); cnd.icon = item.icon.toLowerCase();
cnd.state = cond.status ? $WH.ct('active') : $WH.ct('inactive'); cnd.state = cond.status == 1 ? $WH.ct('active') : cond.status == 2 ? $WH.ct(LANG.pr_note_complete) : $WH.ct('inactive');
cnd.color = cond.status ? 'q2' : 'q10'; cnd.color = cond.status == 1 ? 'q1' : cond.status == 2 ? 'q2' : 'q10';
cnd.name = item['name_' + g_locale.name]; cnd.name = item['name_' + g_locale.name];
cnd.url = '?event=' + cond.typeId; cnd.url = '?event=' + cond.typeId;
return cnd; return cnd;
}, },
sortFunc: function(a, b, col) { sortFunc: function(a, b, col) {
if (a.condition.status && b.condition.status) { if (a.condition && b.condition) {
return $WH.strcmp(a.condition.status, b.condition.status); return $WH.strcmp(a.condition.status, b.condition.status);
} }
else if (a.condition)
return -1;
else if (b.condition)
return 1;
else
return 0;
} }
}, },
}; };
@@ -9000,6 +9016,12 @@ Listview.templates = {
a.style.fontFamily = 'Verdana, sans-serif'; a.style.fontFamily = 'Verdana, sans-serif';
a.href = this.getItemLink(npc); a.href = this.getItemLink(npc);
$WH.ae(a, $WH.ct(npc.name)); $WH.ae(a, $WH.ct(npc.name));
if (npc.hasQuests != null) {
a.className += " icontiny tinyspecial";
a.style.backgroundImage = "url(" + g_staticUrl + "/images/icons/quest_start.gif)";
}
$WH.ae(td, a); $WH.ae(td, a);
if (npc.tag != null) { if (npc.tag != null) {
@@ -9020,7 +9042,7 @@ Listview.templates = {
return buff; return buff;
}, },
sortFunc: function(a, b, col) { sortFunc: function(a, b, col) {
return $WH.strcmp(b.boss, a.boss) || $WH.strcmp(a.name, b.name); return $WH.strcmp(b.boss, a.boss) || $WH.strcmp(a.name, b.name) || $WH.strcmp(a.hasQuests, b.hasQuests);
} }
}, },
{ {

View File

@@ -259,7 +259,10 @@ var mn_npcs = [
[7,"Humanoide"], [7,"Humanoide"],
[9,"Mechanisch"], [9,"Mechanisch"],
[6,"Untot"], [6,"Untot"],
[10,"Nicht kategorisiert"] [10,"Nicht kategorisiert"],
[11,"Totem"],
[12,"Haustier"],
[13,"Gaswolke"]
]; ];
var mn_objects = [ var mn_objects = [
[9,"Bücher"], [9,"Bücher"],

View File

@@ -259,7 +259,10 @@ var mn_npcs = [
[7,"Humanoids"], [7,"Humanoids"],
[9,"Mechanicals"], [9,"Mechanicals"],
[6,"Undead"], [6,"Undead"],
[10,"Uncategorized"] [10,"Uncategorized"],
[11,"Totem"],
[12,"Non-combat Pet"],
[13,"Gas Cloud"]
]; ];
var mn_objects = [ var mn_objects = [
[9,"Books"], [9,"Books"],

View File

@@ -259,7 +259,10 @@ var mn_npcs = [
[7,"Humanoide"], [7,"Humanoide"],
[9,"Mecánico"], [9,"Mecánico"],
[6,"No-muerto"], [6,"No-muerto"],
[10,"Sin categoría"] [10,"Sin categoría"],
[11,"Tótem"],
[12,"Mascota mansa"],
[13,"Nube de gas"]
]; ];
var mn_objects = [ var mn_objects = [
[9,"Libros"], [9,"Libros"],

View File

@@ -259,7 +259,10 @@ var mn_npcs = [
[7,"Humanoïdes"], [7,"Humanoïdes"],
[9,"Mécaniques"], [9,"Mécaniques"],
[6,"Mort-vivant"], [6,"Mort-vivant"],
[10,"Non classés"] [10,"Non classés"],
[11,"Totem"],
[12,"Familier pacifique"],
[13,"Nuage de gaz"]
]; ];
var mn_objects = [ var mn_objects = [
[9,"Livres"], [9,"Livres"],

View File

@@ -259,7 +259,10 @@ var mn_npcs = [
[7,"Гуманоиды"], [7,"Гуманоиды"],
[9,"Механизмы"], [9,"Механизмы"],
[6,"Нежить"], [6,"Нежить"],
[10,"Разное"] [10,"Разное"],
[11,"Тотем"],
[12,"Спутник"],
[13,"Облако газа"]
]; ];
var mn_objects = [ var mn_objects = [
[9,"Книги"], [9,"Книги"],

View File

@@ -0,0 +1,55 @@
{include file='header.tpl'}
<div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents">
{if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
{if !empty($map)}
{include file='bricks/mapper.tpl' map=$map.data som=$map.som}
{/if}
<script type="text/javascript">//<![CDATA[
g_initPath({$path});
//]]></script>
{if !empty($name) || !empty($h1Links)}
<div class="text">
{if !empty($h1Links)}
<div class="h1-links">{$h1Links}</div>
{/if}
{if !empty($name)}
<h1>{$name}</h1>
{/if}
</div>
{/if}
{if !empty($lvData)}
{if count($lvData) > 1}
<div id="tabs-generic"></div>
{/if}
<div id="lv-generic" class="listview"></div>
<script type="text/javascript">//<![CDATA[
{if count($lvData) > 1}
var myTabs = new Tabs({ldelim}parent: $WH.ge('tabs-generic'){rdelim});
{/if}
{foreach from=$lvData item=lv}
{if isset($lv.file)}
{include file="bricks/listviews/`$lv.file`.tpl" data=$lv.data params=$lv.params}
{/if}
{/foreach}
{if count($lvData) > 1}
myTabs.flush();
{/if}
//]]></script>
<div class="clear"></div>
{/if}
</div><!-- main-contents -->
</div><!-- main -->
{include file='footer.tpl'}

128
template/npc.tpl Normal file
View File

@@ -0,0 +1,128 @@
{include file='header.tpl'}
<div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents">
{if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
<script type="text/javascript">//<![CDATA[
{include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$type}, typeId: {$typeId}, name: '{$name|escape:"quotes"}'{rdelim};
g_initPath({$path});
//]]></script>
{include file='bricks/infobox.tpl'}
<div class="text">
{include file='bricks/redButtons.tpl'}
<h1>{$name}{if $subname} &lt;{$subname}&gt;{/if}</h1>
{include file='bricks/article.tpl'}
{if is_array($position)}
<div>{$lang.difficultyPH} <a href="?npc={$position[0]}">{$position[1]}</a>.</div>
<div class="pad"></div>
{elseif $position}
<div>{#This_NPC_can_be_found_in#} {strip}<span id="locations">
{foreach from=$position item=zone name=zone}
<a href="javascript:;" onclick="
{if $zone.atid}
myMapper.update(
{ldelim}
zone:{$zone.atid}
{if $zone.points}
,
{/if}
{if $zone.points}
coords:[
{foreach from=$zone.points item=point name=point}
[{$point.x},{$point.y},
{ldelim}
label:'$<br>
<div class=q0>
<small>
{if isset($point.r)}
{#Respawn#}:
{if isset($point.r.h)} {$point.r.h}{#hr#}{/if}
{if isset($point.r.m)} {$point.r.m}{#min#}{/if}
{if isset($point.r.s)} {$point.r.s}{#sec#}{/if}
{else}
{#Waypoint#}
{/if}
{if isset($point.events)}<br>{$point.events|escape:"quotes"}{/if}
</small>
</div>',type:'{$point.type}'
{rdelim}]
{if !$smarty.foreach.point.last},{/if}
{/foreach}
]
{/if}
{rdelim});
$WH.ge('mapper-generic').style.display='block';
{else}
$WH.ge('mapper-generic').style.display='none';
{/if}
g_setSelectedLink(this, 'mapper'); return false" onmousedown="return false">
{$zone.name}</a>{if $zone.population > 1}&nbsp;({$zone.population}){/if}{if $smarty.foreach.zone.last}.{else}, {/if}
{/foreach}
</span></div>
{/strip}
<div id="mapper-generic"></div>
<div class="clear"></div>
<script type="text/javascript">
var myMapper = new Mapper({ldelim}parent: 'mapper-generic', zone: '{$position[0].atid}'{rdelim});
$WH.gE($WH.ge('locations'), 'a')[0].onclick();
</script>
{else}
{$lang.unkPosition}
{/if}
{if $quotes}
<h3><a class="disclosure-off" onclick="return g_disclose($WH.ge('quotes-generic'), this)">{$lang.quotes} ({$quotes[1]})</a></h3>
<div id="quotes-generic" style="display: none"><ul>{strip}
{foreach from=$quotes[0] item=group}
{if $group|@count > 1}<ul>{/if}
<li>
{foreach from=$group name=quote item=itr}
<div><span class="s{$itr.type}">{if $itr.type != 4}{$name} {$lang.textTypes[$itr.type]}{$lang.colon}{if $itr.lang}[{$itr.lang}] {/if}{/if}{$itr.text}</span></div>
{if $smarty.foreach.quote.last}{else}</li><li>{/if}
{/foreach}
</li>
{if $group|@count > 1}</li></ul>{/if}
{/foreach}
{/strip}</ul></div>
{/if}
{if $reputation}
<h3>{$lang.gains}</h3>
{$lang.gainsDesc}{$lang.colon}
{foreach from=$reputation item=set}
{if $reputation|@count > 1}<ul><li><span class="rep-difficulty">{$set[0]}</span></li>{/if}
<ul>
{foreach from=$set[1] item=itr}
<li><div{if $itr.qty < 0} class="reputation-negative-amount"{/if}><span>{$itr.qty}</span> {$lang.repWith} <a href="?faction={$itr.id}">{$itr.name}</a>{if $itr.cap && $itr.qty > 0} ({$lang.stopsAt|@sprintf:$itr.cap}){/if}</div></li>
{/foreach}
</ul>
{if $reputation|@count > 1}</ul>{/if}
{/foreach}
{/if}
<h2 class="clear">{$lang.related}</h2>
</div>
{include file='bricks/tabsRelated.tpl' tabs=$lvData}
{include file='bricks/contribute.tpl'}
</div><!-- main-contents -->
</div><!-- main -->
{include file='footer.tpl'}

112
template/npcs.tpl Normal file
View File

@@ -0,0 +1,112 @@
{include file='header.tpl'}
<div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents">
{if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
<script type="text/javascript">
g_initPath({$path}, {if empty($filter.query)} 0 {else} 1 {/if});
{if !empty($filter.query)}
Menu.modifyUrl(Menu.findItem(mn_database, [4]), {ldelim} filter: '+={$filter.query|escape:'quotes'}' {rdelim}, {ldelim} onAppendCollision: fi_mergeFilterParams, onAppendEmpty: fi_setFilterParams, menuUrl: Menu.getItemUrl(Menu.findItem(mn_database, [4])) {rdelim});
{/if}
</script>
<div id="fi" style="display: {if empty($filter.query)}none{else}block{/if};">
<form action="?npcs{$subCat}&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
<div class="rightpanel">
<div style="float: left">{$lang.classification}{$lang.colon}</div>
<small><a href="javascript:;" onclick="document.forms['fi'].elements['cl[]'].selectedIndex = -1; return false" onmousedown="return false">{$lang.clear}</a></small>
<div class="clear"></div>
<select name="cl[]" size="5" multiple="multiple" class="rightselect" style="width: 9.5em">
{foreach from=$lang.rank key=i item=str}{if $str}
<option value="{$i}" {if isset($filter.cl) && in_array($i, (array)$filter.cl)}selected{/if}>{$str}</option>
{/if}{/foreach}
</select>
</div>
{if $petFamPanel}
<div class="rightpanel2">
<div style="float: left">{$lang.petFamily}{$lang.colon}</div><small><a href="javascript:;" onclick="document.forms['fi'].elements['fa[]'].selectedIndex = -1; return false" onmousedown="return false">{$lang.clear}</a></small>
<div class="clear"></div>
<select name="fa[]" size="7" multiple="multiple" class="rightselect">
{foreach from=$lang.fa key=i item=str}{if $str}
<option value="{$i}" {if isset($filter.fa) && in_array($i, (array)$filter.fa)}selected{/if}>{$str}</option>
{/if}{/foreach}
</select>
</div>
{/if}
<table>
<tr>
<td>{$lang.name|ucFirst}{$lang.colon}</td>
<td colspan="2">
<table><tr>
<td>&nbsp;<input type="text" name="na" size="30" {if isset($filter.na)}value="{$filter.na|escape:'html'}" {/if}/></td>
<td>&nbsp; <input type="checkbox" name="ex" value="on" id="npc-ex" {if isset($filter.ex)}checked="checked" {/if}/></td>
<td><label for="npc-ex"><span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_extendednpcsearch, 0, 0, 'q')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">{$lang.extSearch}</span></label></td>
</tr></table>
</td>
</tr><tr>
<td class="padded">{$lang.level}{$lang.colon}</td>
<td class="padded">&nbsp;<input type="text" name="minle" maxlength="2" class="smalltextbox" {if isset($filter.minle)}value="{$filter.minle}" {/if}/> - <input type="text" name="maxle" maxlength="2" class="smalltextbox" {if isset($filter.maxle)}value="{$filter.maxle}" {/if}/></td>
<td class="padded" width="100%">
<table><tr>
<td>&nbsp;&nbsp;&nbsp;{$lang.react}{$lang.colon}</td>
<td>&nbsp;<select name="ra" onchange="fi_dropdownSync(this)" onkeyup="fi_dropdownSync(this)" style="background-color: #181818" {if isset($filter.ra)}class="q{if $filter.ra == 1}2{elseif $filter.ra == -1}10{/if}"{/if}>
<option></option>
<option value="1" class="q2"{if isset($filter.ra) && $filter.ra == 1} selected{/if}>A</option>
<option value="0" class="q"{if isset($filter.ra) && $filter.ra == 0} selected{/if}>A</option>
<option value="-1" class="q10"{if isset($filter.ra) && $filter.ra == -1} selected{/if}>A</option>
</select>
<select name="rh" onchange="fi_dropdownSync(this)" onkeyup="fi_dropdownSync(this)" style="background-color: #181818" {if isset($filter.rh)}class="q{if $filter.rh == 1}2{elseif $filter.rh == -1}10{/if}"{/if}>
<option></option>
<option value="1" class="q2"{if isset($filter.rh) && $filter.rh == 1} selected{/if}>H</option>
<option value="0" class="q"{if isset($filter.rh) && $filter.rh == 0} selected{/if}>H</option>
<option value="-1" class="q10"{if isset($filter.rh) && $filter.rh == -1} selected{/if}>H</option>
</select>
</td>
</tr></table>
</td>
</tr>
</table>
<div id="fi_criteria" class="padded criteria"><div></div></div>
<div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false">{$lang.addFilter}</a></div>
<div class="padded2 clear">
<div style="float: right">{$lang.refineSearch}</div>
{$lang.match}{$lang.colon}<input type="radio" name="ma" value="" id="ma-0" {if !isset($filter.ma)}checked="checked"{/if} /><label for="ma-0">{$lang.allFilter}</label><input type="radio" name="ma" value="1" id="ma-1" {if isset($filter.ma)}checked="checked"{/if} /><label for="ma-1">{$lang.oneFilter}</label>
</div>
<div class="clear"></div>
<div class="padded">
<input type="submit" value="{$lang.applyFilter}" />
<input type="reset" value="{$lang.resetForm}" />
</div>
</form>
<div class="pad"></div>
</div>
<script type="text/javascript">//<![CDATA[
fi_init('npcs');
{foreach from=$filter.fi item=str}
{$str}
{/foreach}
//]]></script>
<div id="lv-generic" class="listview"></div>
<script type="text/javascript">//<![CDATA[
{include file='bricks/listviews/creature.tpl' data=$lvData.data params=$lvData.params}
//]]></script>
<div class="clear"></div>
</div><!-- main-contents -->
</div><!-- main -->
{include file='footer.tpl'}

View File

@@ -1,45 +0,0 @@
{include file='header.tpl'}
<div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents">
{if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
<script type="text/javascript">//<![CDATA[
{include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"quotes"}'{rdelim};
g_initPath({$page.path});
//]]></script>
{include file='bricks/infobox.tpl' info=$lvData.infobox}
<div class="text">
{include file='bricks/redButtons.tpl'}
<div id="h1-icon-generic" class="h1-icon"></div>
<script type="text/javascript">//<![CDATA[
$WH.ge('h1-icon-generic').appendChild(Icon.create('{$lvData.page.icon}', 1));
//]]></script>
<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'}
<h2 class="clear">{$lang.related}</h2>
</div>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}
{include file='bricks/contribute.tpl'}
</div><!-- main-contents -->
</div><!-- main -->
{include file='footer.tpl'}

View File

@@ -1,45 +0,0 @@
{include file='header.tpl'}
<div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents">
{if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
<script type="text/javascript">//<![CDATA[
{include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"quotes"}'{rdelim};
g_initPath({$page.path});
//]]></script>
{include file='bricks/infobox.tpl' info=$lvData.infobox}
<div class="text">
<div id="race-icon-male" class="h1-icon"></div>
<div id="race-icon-female" class="h1-icon"></div>
<script type="text/javascript">
$WH.ge('race-icon-male').appendChild(Icon.create('race_{$lvData.page.icon}_male', 1));
$WH.ge('race-icon-female').appendChild(Icon.create('race_{$lvData.page.icon}_female', 1));
</script>
{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'}
<h2 class="clear">{$lang.related}</h2>
</div>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}
{include file='bricks/contribute.tpl'}
</div><!-- main-contents -->
</div><!-- main -->
{include file='footer.tpl'}

View File

@@ -9,7 +9,7 @@
{/foreach} {/foreach}
{/if} {/if}
<div class="text"> <div class="text">
<a href="http://www.wowhead.com/?{$query[0]}={$query[1]}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a> <a href="{$wowhead}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
{if !empty($found)} {if !empty($found)}
<h1>{$lang.foundResult} <i>{$search|escape:"html"}</i></h1> <h1>{$lang.foundResult} <i>{$search|escape:"html"}</i></h1>
</div> </div>

View File

@@ -1,44 +0,0 @@
{include file='header.tpl'}
<div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents">
{if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
<script type="text/javascript">//<![CDATA[
{include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"quotes"}'{rdelim};
g_initPath({$page.path});
//]]></script>
{include file='bricks/infobox.tpl'}
<div class="text">
<div id="h1-icon-generic" class="h1-icon"></div>
<script type="text/javascript">//<![CDATA[
$WH.ge('h1-icon-generic').appendChild(Icon.create('{$lvData.page.icon|escape:"javascript"}', 1));
//]]></script>
{include file='bricks/redButtons.tpl'}
<h1>{$lvData.page.name}</h1>
{include file='bricks/article.tpl'}
<h2 class="clear">{$lang.related}</h2>
</div>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}
{include file='bricks/contribute.tpl'}
</div><!-- main-contents -->
</div><!-- main -->
{include file='footer.tpl'}

View File

@@ -1,8 +1,8 @@
{include file='header.tpl'} {include file='header.tpl'}
<div class="main" id="main"> <div class="main" id="main">
<div id="main-precontents" class="main-precontents"></div> <div class="main-precontents" id="main-precontents"></div>
<div id="main-contents" class="main-contents"> <div class="main-contents" id="main-contents">
{if !empty($announcements)} {if !empty($announcements)}
{foreach from=$announcements item=item} {foreach from=$announcements item=item}
@@ -12,15 +12,18 @@
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
{include file='bricks/community.tpl'} {include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"javascript"}'{rdelim}; var g_pageInfo = {ldelim}type: {$type}, typeId: {$typeId}, name: '{$lvData.name|escape:"quotes"}'{rdelim};
g_initPath({$page.path}); g_initPath({$path});
//]]></script> //]]></script>
{include file='bricks/infobox.tpl' info=$lvData.infobox} {include file='bricks/infobox.tpl'}
<div class="text"> <div class="text">
{include file='bricks/headIcons.tpl' icons=$lvData.icons}
{include file='bricks/redButtons.tpl'} {include file='bricks/redButtons.tpl'}
<h1>{$lvData.page.name}</h1>
<h1{if isset($lvData.page.expansion)} class="h1-icon"><span class="{$lvData.page.expansion}-icon-right">{$lvData.page.name}</span>{else}>{$lvData.page.name}{/if}</h1>
{include file='bricks/tooltip.tpl'} {include file='bricks/tooltip.tpl'}
@@ -50,6 +53,18 @@
{include file='bricks/article.tpl'} {include file='bricks/article.tpl'}
{*
if !empty($lvData.page.transfer)}
<div class="pad"></div>
{$lang._transfer|sprintf:$lvData.page.transfer.id:´´:$lvData.page.transfer.icon:$lvData.page.transfer.name:$lvData.page.transfer.facInt:$lvData.page.transfer.facName}
{/if}
*}
{if isset($lvData.page.unavailable)}
<div class="pad"></div>
<b style="color: red">{$lang._unavailable}</b>
{/if}
<h3>{$lang._spellDetails}</h3> <h3>{$lang._spellDetails}</h3>
<table class="grid" id="spelldetails"> <table class="grid" id="spelldetails">
@@ -160,7 +175,7 @@
{/section} {/section}
</table> </table>
<h2>{$lang.related}</h2> <h2 class="clear">{$lang.related}</h2>
</div> </div>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs} {include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}

View File

@@ -1,39 +0,0 @@
{include file='header.tpl'}
<div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents">
{if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
<script type="text/javascript">//<![CDATA[
{include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"quotes"}'{rdelim};
g_initPath({$page.path});
//]]></script>
{include file='bricks/infobox.tpl' info=$lvData.infobox}
<div class="text">
{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'}
<h2 class="clear">{$lang.related}</h2>
</div>
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}
{include file='bricks/contribute.tpl'}
</div><!-- main-contents -->
</div><!-- main -->
{include file='footer.tpl'}