* Factions: set titles for ListPage

* GameObjects: initial implementation (some filter missing; positions not
yet availabe; some custom data to be set; required table will be added
later)
* MiscTools: fixed random page; 'implemented' missing Screenshots; fixed
access to template file
* Search: implemented check for CUSTOM_EXCLUDE_FOR_LISTVIEW if user is not
 in U_GROUP_STAFF; searches should now be cachable
* NPCs: three more tabs on detailPage

* some work against Quests
* fighting the template-system :<
This commit is contained in:
Sarjuuk
2014-02-19 00:22:08 +01:00
parent 92170d7793
commit 0c4c7ea9ae
62 changed files with 2752 additions and 1819 deletions

View File

@@ -47,7 +47,7 @@ foreach ($datasets as $data)
else if (file_exists('datasets/'.$data.$params)) else if (file_exists('datasets/'.$data.$params))
echo file_get_contents('datasets/'.$data.$params); echo file_get_contents('datasets/'.$data.$params);
else if ($AoWoWconf['debug']) else if ($AoWoWconf['debug'])
echo "/* could not fetch static data: ".$data.$params." for locale: ".User::$localeString." */"; echo "alert('could not fetch static data: ".$data.$params." for locale: ".User::$localeString."');";
echo "\n\n"; echo "\n\n";
break; break;
default: default:

View File

@@ -176,7 +176,7 @@ define('LOOT_PROSPECTING', 'prospecting_loot_template');
define('LOOT_MILLING', 'milling_loot_template'); define('LOOT_MILLING', 'milling_loot_template');
define('LOOT_PICKPOCKET', 'pickpocketing_loot_template'); define('LOOT_PICKPOCKET', 'pickpocketing_loot_template');
define('LOOT_SKINNING', 'skinning_loot_template'); define('LOOT_SKINNING', 'skinning_loot_template');
define('LOOT_QUEST', 'mail_loot_template'); // changed to quest_mail_loot_template..? define('LOOT_MAIL', 'mail_loot_template'); // used by achievements and quests
define('LOOT_SPELL', 'spell_loot_template'); define('LOOT_SPELL', 'spell_loot_template');
define('LOOT_REFERENCE', 'reference_loot_template'); define('LOOT_REFERENCE', 'reference_loot_template');

View File

@@ -16,6 +16,7 @@ define('STATIC_URL', substr('http://'.$_SERVER['SERVER_NAME'].strtr($_SER
define('SQL_LIMIT_NONE', 0); define('SQL_LIMIT_NONE', 0);
define('SQL_LIMIT_SEARCH', $AoWoWconf['searchLimit']); define('SQL_LIMIT_SEARCH', $AoWoWconf['searchLimit']);
define('SQL_LIMIT_QUCKSEARCH', $AoWoWconf['quickSearchLimit']);
define('SQL_LIMIT_DEFAULT', $AoWoWconf['defaultLimit']); define('SQL_LIMIT_DEFAULT', $AoWoWconf['defaultLimit']);
require 'includes/libs/Smarty-2.6.26/libs/Smarty.class.php';// Libraray: http://www.smarty.net/ require 'includes/libs/Smarty-2.6.26/libs/Smarty.class.php';// Libraray: http://www.smarty.net/

View File

@@ -9,6 +9,7 @@ class AchievementList extends BaseType
use listviewHelper; use listviewHelper;
public static $type = TYPE_ACHIEVEMENT; public static $type = TYPE_ACHIEVEMENT;
public static $brickFile = 'achievement';
public $criteria = []; public $criteria = [];
public $tooltip = []; public $tooltip = [];
@@ -19,6 +20,10 @@ class AchievementList extends BaseType
'ac' => ['j' => ['?_achievementcriteria AS `ac` ON `ac`.`refAchievementId` = `a`.`id`', true], 'g' => '`a`.`id`'] 'ac' => ['j' => ['?_achievementcriteria AS `ac` ON `ac`.`refAchievementId` = `a`.`id`', true], 'g' => '`a`.`id`']
); );
/*
todo: evaluate TC custom-data-tables: a*_criteria_data should be merged on installation, a*_reward linked with mail_loot_template and achievement
*/
public function __construct($conditions = [], $applyFilter = false) public function __construct($conditions = [], $applyFilter = false)
{ {
parent::__construct($conditions, $applyFilter); parent::__construct($conditions, $applyFilter);

View File

@@ -311,8 +311,9 @@ abstract class BaseType
public function getRandomId() public function getRandomId()
{ {
$pattern = '/SELECT .* (-?[\w_]*\.?(id|entry)) AS ARRAY_KEY,?.* FROM (.*) WHERE .*/i'; // its not optimal, so if anyone has an alternative idea..
$replace = 'SELECT $1 FROM $3 ORDER BY RAND() ASC LIMIT 1'; $pattern = '/SELECT .* (-?`?[\w_]*\`?.?`?(id|entry)`?) AS ARRAY_KEY,?.* FROM (\?[\w_-]+) (`?\w*`?)/i';
$replace = 'SELECT $1 FROM $3 $4 WHERE (cuFlags & '.CUSTOM_EXCLUDE_FOR_LISTVIEW.') = 0 ORDER BY RAND() ASC LIMIT 1';
$query = preg_replace($pattern, $replace, $this->queryBase); $query = preg_replace($pattern, $replace, $this->queryBase);
return DB::Aowow()->selectCell($query); return DB::Aowow()->selectCell($query);

View File

@@ -7,6 +7,7 @@ if (!defined('AOWOW_REVISION'))
class CharClassList extends BaseType class CharClassList extends BaseType
{ {
public static $type = TYPE_CLASS; public static $type = TYPE_CLASS;
public static $brickFile = 'class';
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_classes c'; protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_classes c';

View File

@@ -7,6 +7,7 @@ if (!defined('AOWOW_REVISION'))
class CharRaceList extends BaseType class CharRaceList extends BaseType
{ {
public static $type = TYPE_RACE; public static $type = TYPE_RACE;
public static $brickFile = 'race';
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_races r'; protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_races r';

View File

@@ -9,6 +9,7 @@ class CreatureList extends BaseType
use spawnHelper; use spawnHelper;
public static $type = TYPE_NPC; public static $type = TYPE_NPC;
public static $brickFile = 'creature';
public $tooltips = []; public $tooltips = [];

View File

@@ -7,6 +7,7 @@ if (!defined('AOWOW_REVISION'))
class CurrencyList extends BaseType class CurrencyList extends BaseType
{ {
public static $type = TYPE_CURRENCY; public static $type = TYPE_CURRENCY;
public static $brickFile = 'currency';
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_currencies c'; protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_currencies c';

View File

@@ -7,11 +7,12 @@ if (!defined('AOWOW_REVISION'))
class FactionList extends BaseType class FactionList extends BaseType
{ {
public static $type = TYPE_FACTION; public static $type = TYPE_FACTION;
public static $brickFile = 'faction';
protected $queryBase = 'SELECT f1.*, f1.id AS ARRAY_KEY, f1.parentFactionId AS cat FROM ?_factions f1'; protected $queryBase = 'SELECT f.*, f.parentFactionId AS cat, f.id AS ARRAY_KEY FROM ?_factions f';
protected $queryOpts = array( protected $queryOpts = array(
'f1' => [['f2']], 'f' => [['f2']],
'f2' => ['j' => ['?_factions f2 ON f1.parentFactionId = f2.id', true], 's' => ', IFNULL(f2.parentFactionId, 0) AS cat2'] 'f2' => ['j' => ['?_factions f2 ON f.parentFactionId = f2.id', true], 's' => ', IFNULL(f2.parentFactionId, 0) AS cat2']
); );
public function __construct($conditions = []) public function __construct($conditions = [])

View File

@@ -9,12 +9,14 @@ class GameObjectList extends BaseType
use listviewHelper, spawnHelper; use listviewHelper, spawnHelper;
public static $type = TYPE_OBJECT; public static $type = TYPE_OBJECT;
public static $brickFile = 'object';
protected $queryBase = 'SELECT *, go.entry AS ARRAY_KEY FROM gameobject_template go'; protected $queryBase = 'SELECT *, o.id AS ARRAY_KEY FROM ?_objects o';
protected $queryOpts = array( protected $queryOpts = array(
'go' => [['lg', 'l']], 'o' => [['ft']],
'lg' => ['j' => ['locales_gameobject lg ON go.entry = lg.entry', true]], 'ft' => ['j' => ['?_factiontemplate ft ON ft.id = o.faction', true], 's' => ', ft.*'],
'l' => ['j' => ['?_lock l ON l.id = IF(go.type = 3, data0, null)', true], 's' => ', l.type1, l.properties1, l.reqSkill1, l.type2, l.properties2, l.reqSkill2'] 'qr' => ['j' => ['gameobject_questrelation qr ON qr.id = o.id', true]], // started by GO
'ir' => ['j' => ['gameobject_involvedrelation ir ON ir.id = o.id', true]], // ends at GO
); );
public function __construct($conditions = [], $applyFilter = false) public function __construct($conditions = [], $applyFilter = false)
@@ -25,52 +27,32 @@ class GameObjectList extends BaseType
return; return;
// post processing // post processing
// most of this will be obsolete, when gameobjects get their own table
foreach ($this->iterate() as $_id => &$curTpl) foreach ($this->iterate() as $_id => &$curTpl)
{ {
// unpack miscInfo:
$curTpl['lootStack'] = [];
$curTpl['spells'] = [];
$curTpl['spellFocusId'] = 0;
if (in_array($curTpl['type'], [OBJECT_GOOBER, OBJECT_RITUAL, OBJECT_SPELLCASTER, OBJECT_FLAGSTAND, OBJECT_FLAGDROP, OBJECT_AURA_GENERATOR, OBJECT_TRAP]))
$curTpl['spells'] = array_combine(['onUse', 'onSuccess', 'aura', 'triggered'], [$curTpl['onUseSpell'], $curTpl['onSuccessSpell'], $curTpl['auraSpell'], $curTpl['triggeredSpell']]);
if (!$curTpl['miscInfo'])
continue;
switch ($curTpl['type']) switch ($curTpl['type'])
{ {
case OBJECT_CHEST: case OBJECT_CHEST:
$curTpl['lootId'] = $curTpl['data1'];
$curTpl['lootStack'] = [$curTpl['data4'], $curTpl['data5']];
$curTpl['lockId'] = $curTpl['data0'];
if (!isset($curTpl['properties1']))
break;
if ($curTpl['properties1'] == LOCK_PROPERTY_HERBALISM)
{
$curTpl['reqSkill'] = $curTpl['reqSkill1'];
$curTpl['type'] = -3;
}
else if ($curTpl['properties1'] == LOCK_PROPERTY_MINING)
{
$curTpl['reqSkill'] = $curTpl['reqSkill1'];
$curTpl['type'] = -4;
}
else if ($curTpl['properties1'] == LOCK_PROPERTY_FOOTLOCKER)
{
$curTpl['reqSkill'] = $curTpl['reqSkill1'];
$curTpl['type'] = -5;
}
else if( $curTpl['properties2'] == LOCK_PROPERTY_FOOTLOCKER)
{
$curTpl['reqSkill'] = $curTpl['reqSkill2'];
$curTpl['type'] = -5;
}
break;
case OBJECT_FISHINGHOLE: case OBJECT_FISHINGHOLE:
$curTpl['lootId'] = $curTpl['data1']; $curTpl['lootStack'] = explode(' ', $curTpl['miscInfo']);
$curTpl['lootStack'] = [$curTpl['data2'], $curTpl['data3']];
break; break;
default: // adding more, when i need them case OBJECT_CAPTURE_POINT:
$curTpl['lockId'] = 0; $curTpl['capture'] = explode(' ', $curTpl['miscInfo']);
break;
case OBJECT_MEETINGSTONE:
$curTpl['mStone'] = explode(' ', $curTpl['miscInfo']);
break; break;
} }
for ($i = 0; $i < 24; $i++) // kill indescriptive/unused fields
unset($curTpl['data'.$i]);
} }
} }
@@ -84,13 +66,9 @@ class GameObjectList extends BaseType
name_loc6, name_loc6,
name_loc8 name_loc8
FROM FROM
gameobject_template gt ?_objects
LEFT JOIN
locales_gameobject lg
ON
lg.entry = gt.entry
WHERE WHERE
gt.entry = ?d', id = ?d',
$id $id
); );
return Util::localizedString($n, 'name'); return Util::localizedString($n, 'name');
@@ -104,7 +82,7 @@ class GameObjectList extends BaseType
$data[$this->id] = array( $data[$this->id] = array(
'id' => $this->id, 'id' => $this->id,
'name' => $this->getField('name', true), 'name' => $this->getField('name', true),
'type' => $this->curTpl['type'] 'type' => $this->curTpl['typeCat']
); );
if (!empty($this->curTpl['reqSkill'])) if (!empty($this->curTpl['reqSkill']))
@@ -124,7 +102,10 @@ class GameObjectList extends BaseType
$x = '<table>'; $x = '<table>';
$x .= '<tr><td><b class="q">'.$this->getField('name', true).'</b></td></tr>'; $x .= '<tr><td><b class="q">'.$this->getField('name', true).'</b></td></tr>';
$x .= '<tr><td>[TYPE '.$this->curTpl['type'].']</td></tr>'; if ($_ = @Lang::$gameObject['type'][$this->curTpl['typeCat']])
$x .= '<tr><td>'.$_.'</td></tr>';
if (isset($this->curTpl['lockId']))
if ($locks = Lang::getLocks($this->curTpl['lockId'])) if ($locks = Lang::getLocks($this->curTpl['lockId']))
foreach ($locks as $l) foreach ($locks as $l)
$x .= '<tr><td>'.$l.'</td></tr>'; $x .= '<tr><td>'.$l.'</td></tr>';
@@ -136,7 +117,104 @@ class GameObjectList extends BaseType
return $this->tooltips[$this->id]; return $this->tooltips[$this->id];
} }
public function addGlobalsToJScript(&$template, $addMask = 0) { } public function addGlobalsToJScript(&$template, $addMask = 0)
{
foreach ($this->iterate() as $id => $__)
$template->extendGlobalData(self::$type, [$id => ['name' => $this->getField('name', true)]]);
}
}
class GameObjectListFilter extends Filter
{
protected $genericFilter = array(
15 => [FILTER_CR_NUMERIC, 'entry', null], // id
7 => [FILTER_CR_NUMERIC, 'reqSkill', null], // requiredskilllevel
);
/*
{ id: 1, name: 'foundin', type: 'zone' },
{ id: 16, name: 'relatedevent', type: 'event-any+none' },
*/
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 4:
if (!$this->int2Bool($cr[1]))
break;
return $cr[1] ? ['OR', ['flags', 0x2, '&'], ['type', 3]] : ['AND', [['flags', 0x2, '&'], 0], ['type', 3, '!']];
case 5: // averagemoneycontained [op] [int] GOs don't contain money .. eval to 0 == true
if (!$this->isSaneNumeric($cr[2], false) || !$this->int2Op($cr[1]))
break;
return eval('return ('.$cr[2].' '.$cr[1].' 0)') ? [1] : [0];
case 2: // startsquest [side]
switch ($cr[1])
{
case 1: // any
return ['qr.id', null, '!'];
case 2: // alliance only
return ['AND', ['qr.id', null, '!'], ['ft.A', -1, '!'], ['ft.H', -1]];
case 3: // horde only
return ['AND', ['qr.id', null, '!'], ['ft.A', -1], ['ft.H', -1, '!']];
case 4: // both
return ['AND', ['qr.id', null, '!'], ['OR', ['faction', 0], ['AND', ['ft.A', -1, '!'], ['ft.H', -1, '!']]]];
case 5: // none
return ['qr.id', null];
}
break;
case 3: // endsquest [side]
switch ($cr[1])
{
case 1: // any
return ['qi.id', null, '!'];
case 2: // alliance only
return ['AND', ['qi.id', null, '!'], ['ft.A', -1, '!'], ['ft.H', -1]];
case 3: // horde only
return ['AND', ['qi.id', null, '!'], ['ft.A', -1], ['ft.H', -1, '!']];
case 4: // both
return ['AND', ['qi.id', null, '!'], ['OR', ['faction', 0], ['AND', ['ft.A', -1, '!'], ['ft.H', -1, '!']]]];
case 5: // none
return ['qi.id', null];
}
break;
case 13: // hascomments [yn]
break;
case 11: // hasscreenshots [yn]
break;
case 18: // hasvideos [yn]
break;
}
unset($cr);
$this->error = 1;
return [1];
}
protected function createSQLForValues()
{
$parts = [];
$_v = $this->fiData['v'];
// name
if (isset($_v['na']))
$parts[] = ['name_loc'.User::$localeId, $_v['na']];
return $parts;
}
} }
?> ?>

View File

@@ -9,6 +9,7 @@ class ItemList extends BaseType
use ListviewHelper; use ListviewHelper;
public static $type = TYPE_ITEM; public static $type = TYPE_ITEM;
public static $brickFile = 'item';
public $tooltip = []; public $tooltip = [];
public $json = []; public $json = [];
@@ -1435,7 +1436,6 @@ class ItemList extends BaseType
} }
// missing each and everything
class ItemListFilter extends Filter class ItemListFilter extends Filter
{ {
// usable-by - limit weapon/armor selection per CharClass - itemClass => available itemsubclasses // usable-by - limit weapon/armor selection per CharClass - itemClass => available itemsubclasses

View File

@@ -9,6 +9,7 @@ class ItemsetList extends BaseType
use ListviewHelper; use ListviewHelper;
public static $type = TYPE_ITEMSET; public static $type = TYPE_ITEMSET;
public static $brickFile = 'itemset';
public $pieceToSet = []; // used to build g_items and search public $pieceToSet = []; // used to build g_items and search
private $classes = []; // used to build g_classes private $classes = []; // used to build g_classes

View File

@@ -9,6 +9,7 @@ class PetList extends BaseType
use ListviewHelper; use ListviewHelper;
public static $type = TYPE_PET; public static $type = TYPE_PET;
public static $brickFile = 'pet';
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_pet p'; protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_pet p';

View File

@@ -7,24 +7,30 @@ if (!defined('AOWOW_REVISION'))
class QuestList extends BaseType class QuestList extends BaseType
{ {
public static $type = TYPE_QUEST; public static $type = TYPE_QUEST;
public static $brickFile = 'quest';
public $requires = []; public $requires = [];
public $rewards = []; public $rewards = [];
protected $queryBase = 'SELECT *, qt.id AS ARRAY_KEY FROM quest_template qt'; protected $queryBase = 'SELECT *, qt.id AS ARRAY_KEY FROM quest_template qt';
protected $queryOpts = array( protected $queryOpts = array(
'qt' => [['lq']], 'qt' => [['lq', 'xp']],
'lq' => ['j' => ['locales_quest lq ON qt.id = lq.id', true]] 'lq' => ['j' => ['locales_quest lq ON qt.id = lq.id', true]],
'xp' => ['j' => ['?_questxp xp ON qt.level = xp.id', true], 's' => ', xp.*'],
'goStart' => ['j' => 'gameobject_questrelation goStart ON goStart.quest = qt.id'], // started by GO
'goEnd' => ['j' => 'gameobject_involvedrelation goEnd ON goEnd.quest = qt.id'], // ends at GO
'npcStart' => ['j' => 'creature_questrelation npcStart ON npcStart.quest = qt.id'], // started by NPC
'npcEnd' => ['j' => 'creature_involvedrelation npcEnd ON npcEnd.quest = qt.id'], // ends at NPC
'itemStart' => ['j' => ['?_items itemStart ON itemStart.startQuest = qt.id', true], 'g' => 'qt.id'] // started by item .. grouping required, as the same quest may have multiple starter
); );
public function __construct($conditions = []) public function __construct($conditions = [], $applyFilter = false)
{ {
parent::__construct($conditions); parent::__construct($conditions, $applyFilter);
// post processing // post processing
foreach ($this->iterate() as $id => &$_curTpl) foreach ($this->iterate() as $id => &$_curTpl)
{ {
$_curTpl['cat1'] = $_curTpl['ZoneOrSort']; // should probably be in a method... $_curTpl['cat1'] = $_curTpl['ZoneOrSort']; // should probably be in a method...
$_curTpl['cat2'] = 0; $_curTpl['cat2'] = 0;
@@ -37,6 +43,11 @@ class QuestList extends BaseType
} }
} }
// set xp
$_curTpl['xp'] = $_curTpl['Field'.$_curTpl['RewardXPId']];
for ($i = 0; $i < 9; $i++)
unset($_curTpl['Field'.$i]);
// todo (med): extend for reward case // todo (med): extend for reward case
$data = []; $data = [];
for ($i = 1; $i < 7; $i++) for ($i = 1; $i < 7; $i++)
@@ -81,17 +92,6 @@ class QuestList extends BaseType
); );
return Util::localizedString($n, 'title'); return Util::localizedString($n, 'title');
} }
public static function getXPReward($questLevel, $xpId)
{
if (!is_numeric($xpId) || $xpId < 0 || $xpId > 8)
return 0;
if ($xp = DB::Aowow()->selectCell('SELECT Field?d FROM ?_questxp WHERE Id = ?d', $xpId, $questLevel))
return $xp;
else
return 0;
}
// static use END // static use END
public function getSourceData() public function getSourceData()
@@ -127,7 +127,7 @@ class QuestList extends BaseType
'name' => $this->getField('Title', true), 'name' => $this->getField('Title', true),
'side' => Util::sideByRaceMask($this->curTpl['RequiredRaces']), 'side' => Util::sideByRaceMask($this->curTpl['RequiredRaces']),
'wflags' => 0x0, 'wflags' => 0x0,
'xp' => self::getXPReward($this->curTpl['Level'], $this->curTpl['RewardXPId']) 'xp' => $this->curTpl['xp']
); );
$rewards = []; $rewards = [];
@@ -229,7 +229,7 @@ class QuestList extends BaseType
$x = ''; $x = '';
if ($level) if ($level)
{ {
$level = sprintf(Lang::$quest['level'], $level); $level = sprintf(Lang::$quest['questLevel'], $level);
if ($this->curTpl['Flags'] & 0x1000) // daily if ($this->curTpl['Flags'] & 0x1000) // daily
$level .= ' '.Lang::$quest['daily']; $level .= ' '.Lang::$quest['daily'];
@@ -314,4 +314,186 @@ class QuestList extends BaseType
} }
} }
class QuestListFilter extends Filter
{
protected $enums = array();
protected $genericFilter = array();
/*
{ id: 34, name: 'availabletoplayers', type: 'yn' },
{ id: 37, name: 'classspecific', type: 'classs' },
{ id: 38, name: 'racespecific', type: 'race' },
{ id: 27, name: 'daily', type: 'yn' },
{ id: 28, name: 'weekly', type: 'yn' },
{ id: 29, name: 'repeatable', type: 'yn' },
{ id: 30, name: 'id', type: 'num', before: 'name' },
{ id: 44, name: 'countsforloremaster_stc', type: 'yn' },
{ id: 9, name: 'objectiveearnrepwith', type: 'faction-any+none' },
{ id: 33, name: 'relatedevent', type: 'event-any+none' },
{ id: 5, name: 'sharable', type: 'yn' },
{ id: 11, name: 'suggestedplayers', type: 'num' },
{ id: 6, name: 'timer', type: 'num' },
{ id: 42, name: 'flags', type: 'flags', staffonly: true },
{ id: 2, name: 'experiencegained', type: 'num' },
{ id: 43, name: 'currencyrewarded', type: 'currency' },
{ id: 45, name: 'titlerewarded', type: 'yn' },
{ id: 23, name: 'itemchoices', type: 'num' },
{ id: 22, name: 'itemrewards', type: 'num' },
{ id: 3, name: 'moneyrewarded', type: 'num' },
{ id: 4, name: 'spellrewarded', type: 'yn' },
{ id: 1, name: 'increasesrepwith', type: 'faction' },
{ id: 10, name: 'decreasesrepwith', type: 'faction' },
{ id: 7, name: 'firstquestseries', type: 'yn' },
{ id: 15, name: 'lastquestseries', type: 'yn' },
{ id: 16, name: 'partseries', type: 'yn' },
{ id: 25, name: 'hascomments', type: 'yn' },
{ id: 18, name: 'hasscreenshots', type: 'yn' },
{ id: 36, name: 'hasvideos', type: 'yn' },
*/
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 19: // startsfrom [enum]
switch ($cr[1])
{
case 1: // npc
return ['npcStart.id', null, '!'];
break;
case 2: // object
return ['goStart.id', null, '!'];
break;
case 3: // item
return ['itemStart.id', null, '!'];
}
break;
case 21: // endsat [enum]
switch ($cr[1])
{
case 1: // npc
return ['npcEnd.id', null, '!'];
break;
case 2: // object
return ['goEnd.id', null, '!'];
break;
}
break;
// case 24: // lacksstartend [bool] cost an impossible amount of resources
// if ($this->int2Bool($cr[1]))
// {
// if ($cr[1])
// return ['OR', ['AND', ['npcStart.id', null], ['goStart.id', null], ['itemStart.id', null]], ['AND', ['npcEnd.id', null], ['goEnd.id', null]]];
// else
// return ['AND', ['OR', ['npcStart.id', null, '!'], ['goStart.id', null, '!'], ['itemStart.id', null, '!']], ['OR', ['npcEnd.id', null, '!'], ['goEnd.id', null, '!']]];
// }
// break;
default:
break;
}
unset($cr);
$this->error = 1;
return [1];
}
protected function createSQLForValues()
{
$parts = [];
$_v = $this->fiData['v'];
// name
if (isset($_v['na']))
{
$name = User::$localeId ? 'title_loc'.User::$localeId : 'title';
$objectives = User::$localeId ? 'objectives_loc'.User::$localeId : 'objectives';
$description = User::$localeId ? 'details_loc'.User::$localeId : 'details';
if (isset($_v['ex']) && $_v['ex'] == 'on')
$parts[] = ['OR', [$name, $_v['na']], [$objectives, $_v['na']], [$description, $_v['na']]];
else
$parts[] = [$name, $_v['na']];
}
// level min
if (isset($_v['minle']))
{
if (is_int($_v['minle']) && $_v['minle'] > 0)
$parts[] = ['level', $_v['minle'], '>=']; // not considering quests that are always at player level (-1)
else
unset($_v['minle']);
}
// level max
if (isset($_v['maxle']))
{
if (is_int($_v['maxle']) && $_v['maxle'] > 0)
$parts[] = ['level', $_v['maxle'], '<='];
else
unset($_v['maxle']);
}
// reqLevel min
if (isset($_v['minrl']))
{
if (is_int($_v['minrl']) && $_v['minrl'] > 0)
$parts[] = ['minLevel', $_v['minrl'], '>='];// ignoring maxLevel
else
unset($_v['minrl']);
}
// reqLevel max
if (isset($_v['maxrl']))
{
if (is_int($_v['maxrl']) && $_v['maxrl'] > 0)
$parts[] = ['minLevel', $_v['maxrl'], '<='];// ignoring maxLevel
else
unset($_v['maxrl']);
}
// side
if (isset($_v['si']))
{
$ex = [['requiredRaces', RACE_MASK_ALL, '&'], RACE_MASK_ALL, '!'];
$notEx = ['OR', ['requiredRaces', 0], [['requiredRaces', RACE_MASK_ALL, '&'], RACE_MASK_ALL]];
switch ($_v['si'])
{
case 3:
$parts[] = $notEx;
break;
case 2:
$parts[] = ['OR', $notEx, ['requiredRaces', RACE_MASK_HORDE, '&']];
break;
case -2:
$parts[] = ['AND', $ex, ['requiredRaces', RACE_MASK_HORDE, '&']];
break;
case 1:
$parts[] = ['OR', $notEx, ['requiredRaces', RACE_MASK_ALLIANCE, '&']];
break;
case -1:
$parts[] = ['AND', $ex, ['requiredRaces', RACE_MASK_ALLIANCE, '&']];
break;
default:
unset($_v['si']);
}
}
return $parts;
}
}
?> ?>

View File

@@ -7,6 +7,7 @@ if (!defined('AOWOW_REVISION'))
class SkillList extends BaseType class SkillList extends BaseType
{ {
public static $type = TYPE_SKILL; public static $type = TYPE_SKILL;
public static $brickFile = 'skill';
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_skillLine sl'; protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_skillLine sl';

View File

@@ -15,6 +15,8 @@ class SpellList extends BaseType
public $sources = []; public $sources = [];
public static $type = TYPE_SPELL; public static $type = TYPE_SPELL;
public static $brickFile = 'spell';
public static $skillLines = array( public static $skillLines = array(
6 => [ 43, 44, 45, 46, 54, 55, 95, 118, 136, 160, 162, 172, 173, 176, 226, 228, 229, 473], // Weapons 6 => [ 43, 44, 45, 46, 54, 55, 95, 118, 136, 160, 162, 172, 173, 176, 226, 228, 229, 473], // Weapons
8 => [293, 413, 414, 415, 433], // Armor 8 => [293, 413, 414, 415, 433], // Armor
@@ -1552,14 +1554,7 @@ Lasts 5 min. $?$gte($pl,68)[][Cannot be used on items level 138 and higher.]
$org = $this->curTpl['learnedAt']; $org = $this->curTpl['learnedAt'];
if ($ylw > 1) if ($ylw > 1)
{ return [$org, $ylw, $grn, $gry];
return [
$org < $ylw ? $org : 0,
$org < $grn ? $ylw : 0,
$org < $gry ? $grn : 0,
$gry
];
}
} }
public function getListviewData() public function getListviewData()

View File

@@ -9,6 +9,7 @@ class TitleList extends BaseType
use listviewHelper; use listviewHelper;
public static $type = TYPE_TITLE; public static $type = TYPE_TITLE;
public static $brickFile = 'title';
public $sources = []; public $sources = [];

View File

@@ -7,8 +7,9 @@ if (!defined('AOWOW_REVISION'))
class WorldEventList extends BaseType class WorldEventList extends BaseType
{ {
public static $type = TYPE_WORLDEVENT; public static $type = TYPE_WORLDEVENT;
public static $brickFile = 'event';
protected $queryBase = 'SELECT *, -e.id AS ARRAY_KEY, -e.id as id FROM ?_events e'; protected $queryBase = 'SELECT *, -e.id as id, -e.id AS ARRAY_KEY FROM ?_events e';
protected $queryOpts = array( protected $queryOpts = array(
'e' => ['j' => ['?_holidays h2 ON e.holidayId = h2.id', true], 'o' => '-e.id ASC'], 'e' => ['j' => ['?_holidays h2 ON e.holidayId = h2.id', true], 'o' => '-e.id ASC'],
'h' => ['j' => ['?_holidays h ON e.holidayId = h.id']] 'h' => ['j' => ['?_holidays h ON e.holidayId = h.id']]

View File

@@ -12,6 +12,7 @@ if (!defined('AOWOW_REVISION'))
class ZoneList extends BaseType class ZoneList extends BaseType
{ {
public static $type = TYPE_ZONE; public static $type = TYPE_ZONE;
public static $brickFile = 'zone';
protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_zones z'; protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_zones z';

View File

@@ -98,7 +98,7 @@ class SmartyAoWoW extends Smarty
$buff = []; $buff = [];
foreach ($this->notices as $data) foreach ($this->notices as $data)
if (User::isInGroup($data[0])) if (User::isInGroup($data[0]))
$buff[] = $data[1]; $buff[] = Util::jsEscape($data[1]);
if ($buff) if ($buff)
{ {
@@ -182,24 +182,11 @@ class SmartyAoWoW extends Smarty
if (isset($jsg[$type])) if (isset($jsg[$type]))
return; return;
switch ($type) $jsg[$type] = array(
{ // [brickFile, [data], [extra]] (new ReflectionProperty(Util::$typeClasses[$type], 'brickFile'))->getValue(), // brickfile
case TYPE_NPC: $jsg[TYPE_NPC] = ['creatures', [], []]; break; [], // data
case TYPE_OBJECT: $jsg[TYPE_OBJECT] = ['objects', [], []]; break; [] // extra
case TYPE_ITEM: $jsg[TYPE_ITEM] = ['items', [], []]; break; );
case TYPE_QUEST: $jsg[TYPE_QUEST] = ['quests', [], []]; break;
case TYPE_SPELL: $jsg[TYPE_SPELL] = ['spells', [], []]; break;
case TYPE_ZONE: $jsg[TYPE_ZONE] = ['zones', [], []]; break;
case TYPE_FACTION: $jsg[TYPE_FACTION] = ['factions', [], []]; break;
case TYPE_PET: $jsg[TYPE_PET] = ['pets', [], []]; break;
case TYPE_ACHIEVEMENT: $jsg[TYPE_ACHIEVEMENT] = ['achievements', [], []]; break;
case TYPE_TITLE: $jsg[TYPE_TITLE] = ['titles', [], []]; break;
case TYPE_WORLDEVENT: $jsg[TYPE_WORLDEVENT] = ['holidays', [], []]; break;
case TYPE_CLASS: $jsg[TYPE_CLASS] = ['classes', [], []]; break;
case TYPE_RACE: $jsg[TYPE_RACE] = ['races', [], []]; break;
case TYPE_SKILL: $jsg[TYPE_SKILL] = ['skills', [], []]; break;
case TYPE_CURRENCY: $jsg[TYPE_CURRENCY] = ['currencies', [], []]; break;
}
} }
private function applyGlobals() private function applyGlobals()
@@ -215,25 +202,9 @@ class SmartyAoWoW extends Smarty
$this->initJSGlobal($type); $this->initJSGlobal($type);
$ids = array_unique($ids, SORT_NUMERIC); $ids = array_unique($ids, SORT_NUMERIC);
$cnd = [['id', $ids], 0];
switch ($type) (new Util::$typeClasses[$type]($cnd))->addGlobalsToJscript($this, GLOBALINFO_SELF);
{
case TYPE_NPC: (new CreatureList(array(['ct.id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_OBJECT: (new GameobjectList(array(['gt.entry', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_ITEM: (new ItemList(array(['i.id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_QUEST: (new QuestList(array(['qt.id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_SPELL: (new SpellList(array(['s.id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_ZONE: (new ZoneList(array(['z.id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_FACTION: (new FactionList(array(['id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_PET: (new PetList(array(['id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_ACHIEVEMENT: (new AchievementList(array(['id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_TITLE: (new TitleList(array(['id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_WORLDEVENT: (new WorldEventList(array(['id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_CLASS: (new CharClassList(array(['id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_RACE: (new CharRaceList(array(['id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_SKILL: (new SkillList(array(['id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
case TYPE_CURRENCY: (new CurrencyList(array(['id', $ids], 0)))->addGlobalsToJscript($this, GLOBALINFO_SELF); break;
}
} }
} }
@@ -299,7 +270,7 @@ class SmartyAoWoW extends Smarty
$cache = explode("\n", $cache); $cache = explode("\n", $cache);
@list($time, $rev) = explode(' ', $cache[0]); @list($time, $rev) = explode(' ', $cache[0]);
$expireTime = $time + $this->config['page']['cacheTimer']; $expireTime = $time + $this->config['cacheTimer'];
if ($expireTime <= time() || $rev < AOWOW_REVISION) if ($expireTime <= time() || $rev < AOWOW_REVISION)
return false; return false;
@@ -329,6 +300,12 @@ class Util
'www', null, 'fr', 'de', null, null, 'es', null, 'ru' 'www', null, 'fr', 'de', null, null, 'es', null, 'ru'
); );
public static $typeClasses = array(
null, 'CreatureList', 'GameObjectList', 'ItemList', 'ItemsetList', 'QuestList', 'SpellList',
'ZoneList', 'FactionList', 'PetList', 'AchievementList', 'TitleList', 'WorldEventList', 'CharClassList',
'CharRaceList', 'SkillList', null, 'CurrencyList'
);
public static $typeStrings = array( // zero-indexed public static $typeStrings = array( // zero-indexed
null, 'npc', 'object', 'item', 'itemset', 'quest', 'spell', 'zone', 'faction', null, 'npc', 'object', 'item', 'itemset', 'quest', 'spell', 'zone', 'faction',
'pet', 'achievement', 'title', 'event', 'class', 'race', 'skill', null, 'currency' 'pet', 'achievement', 'title', 'event', 'class', 'race', 'skill', null, 'currency'
@@ -497,7 +474,7 @@ class Util
LOOT_SKINNING, // npc (see its flags for mining, herbing or actual skinning) LOOT_SKINNING, // npc (see its flags for mining, herbing or actual skinning)
LOOT_FISHING, // zone LOOT_FISHING, // zone
LOOT_GAMEOBJECT, // object LOOT_GAMEOBJECT, // object
LOOT_QUEST, // quest (mail rewards) LOOT_MAIL, // quest || achievement
LOOT_SPELL // spell LOOT_SPELL // spell
); );
@@ -1117,11 +1094,13 @@ class Util
} }
else else
{ {
if (!(($s['d'] + $s['h']) % 365)) // whole years $_ = $s['d'] + $s['h'];
if ($_ && !($_ % 365)) // whole years
return round(($s['d'] + $s['h'] *24) / 365, 2)." ".Lang::$timeUnits[$s['d'] / 365 == 1 && !$s['h'] ? 'sg' : 'pl'][0]; 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 if ($_ && !($_ % 30)) // whole month
return round(($s['d'] + $s['h'] * 24) / 30, 2)." ".Lang::$timeUnits[$s['d'] / 30 == 1 && !$s['h'] ? 'sg' : 'pl'][1]; 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 if ($_ && !($_ % 7)) // whole weeks
return round(($s['d'] + $s['h'] * 24) / 7, 2)." ".Lang::$timeUnits[$s['d'] / 7 == 1 && !$s['h'] ? 'sg' : 'pl'][2]; 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];
@@ -1193,6 +1172,8 @@ class Util
// html may contain 'Pictures' // 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" => '']);
$from = array( $from = array(
'/\|T([\w]+\\\)*([^\.]+)\.blp:\d+\|t/ui', // images (force size to tiny) |T<fullPath>:<size>|t '/\|T([\w]+\\\)*([^\.]+)\.blp:\d+\|t/ui', // images (force size to tiny) |T<fullPath>:<size>|t
@@ -1221,8 +1202,6 @@ 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)
); );
@@ -1479,8 +1458,8 @@ class Util
{ {
case 0: // no params works always case 0: // no params works always
return true; return true;
case 1: // null is avalid || key in a n-dim-array || value in a 1-dim-array case 1: // null is avalid || value in a 1-dim-array || key in a n-dim-array
return $keys[0] === null || isset($struct[$keys[0]]) || in_array($keys[0], $struct); return $keys[0] === null || in_array($keys[0], $struct) || (isset($struct[$keys[0]]));
case 2: // first param has to be a key. otherwise invalid 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;
@@ -1884,7 +1863,8 @@ class Util
['object', [], '$LANG.tab_minedfrom', 'mined-from-object', [], [], []], ['object', [], '$LANG.tab_minedfrom', 'mined-from-object', [], [], []],
['object', [], '$LANG.tab_gatheredfrom', 'gathered-from-object', [], [], []], ['object', [], '$LANG.tab_gatheredfrom', 'gathered-from-object', [], [], []],
['object', [], '$LANG.tab_fishedin', 'fished-in-object', [], [], []], ['object', [], '$LANG.tab_fishedin', 'fished-in-object', [], [], []],
['spell', [], '$LANG.tab_createdby', 'created-by', [], [], []] ['spell', [], '$LANG.tab_createdby', 'created-by', [], [], []],
['achievement', [], '$LANG.tab_rewardfrom', 'reward-from-achievemnt', [], [], []]
); );
$refResults = []; $refResults = [];
$chanceMods = []; $chanceMods = [];
@@ -2027,7 +2007,7 @@ class Util
if (!$ids) if (!$ids)
break; break;
$srcObj = new GameObjectList(array(['type', [OBJECT_CHEST, OBJECT_FISHINGHOLE]], ['data1', $ids])); $srcObj = new GameObjectList(array(['lootId', $ids]));
if ($srcObj->error) if ($srcObj->error)
break; break;
@@ -2049,7 +2029,7 @@ class Util
$tabsFinal[$tabId][6][] = 'skill'; $tabsFinal[$tabId][6][] = 'skill';
} }
break; break;
case LOOT_QUEST: case LOOT_MAIL:
$conditions = array(['RewardChoiceItemId1', $itemId], ['RewardChoiceItemId2', $itemId], ['RewardChoiceItemId3', $itemId], ['RewardChoiceItemId4', $itemId], ['RewardChoiceItemId5', $itemId], $conditions = array(['RewardChoiceItemId1', $itemId], ['RewardChoiceItemId2', $itemId], ['RewardChoiceItemId3', $itemId], ['RewardChoiceItemId4', $itemId], ['RewardChoiceItemId5', $itemId],
['RewardChoiceItemId6', $itemId], ['RewardItemId1', $itemId], ['RewardItemId2', $itemId], ['RewardItemId3', $itemId], ['RewardItemId4', $itemId], ['RewardChoiceItemId6', $itemId], ['RewardItemId1', $itemId], ['RewardItemId2', $itemId], ['RewardItemId3', $itemId], ['RewardItemId4', $itemId],
'OR'); 'OR');
@@ -2065,6 +2045,13 @@ class Util
foreach ($srcObj->iterate() as $_) foreach ($srcObj->iterate() as $_)
$tabsFinal[10][1][] = array_merge($srcData[$srcObj->id], empty($result[$srcObj->id]) ? ['percent' => -1] : $result[$srcObj->id]); $tabsFinal[10][1][] = array_merge($srcData[$srcObj->id], empty($result[$srcObj->id]) ? ['percent' => -1] : $result[$srcObj->id]);
} }
/*
todo: search for achievements here
$tabsFinal[17]
*/
break; break;
case LOOT_SPELL: case LOOT_SPELL:
$conditions = ['OR', ['effect1CreateItemId', $itemId], ['effect2CreateItemId', $itemId], ['effect3CreateItemId', $itemId]]; $conditions = ['OR', ['effect1CreateItemId', $itemId], ['effect2CreateItemId', $itemId], ['effect3CreateItemId', $itemId]];

View File

@@ -16,6 +16,7 @@ class Lang
public static $currency; public static $currency;
public static $event; public static $event;
public static $faction; public static $faction;
public static $gameObject;
public static $item; public static $item;
public static $itemset; public static $itemset;
public static $maps; public static $maps;
@@ -68,7 +69,7 @@ class Lang
$locks = []; $locks = [];
$lock = DB::Aowow()->selectRow('SELECT * FROM ?_lock WHERE id = ?d', $lockId); $lock = DB::Aowow()->selectRow('SELECT * FROM ?_lock WHERE id = ?d', $lockId);
if (!$lock) if (!$lock)
return ''; return $locks;
for ($i = 1; $i <= 5; $i++) for ($i = 1; $i <= 5; $i++)
{ {
@@ -91,8 +92,7 @@ class Lang
if (!in_array($prop, [1, 2, 3, 4, 9, 16, 20])) if (!in_array($prop, [1, 2, 3, 4, 9, 16, 20]))
continue; continue;
$txt = DB::Aowow()->selectRow('SELECT * FROM ?_locktype WHERE id = ?d', $prop); // todo (low): convert to static text $name = Lang::$spell['lockType'][$prop];
$name = Util::localizedString($txt, 'name');
if (!$name) if (!$name)
continue; continue;
@@ -117,7 +117,7 @@ class Lang
else else
continue; continue;
$locks[$lock['type'.$i] == 1 ? $i : -$i] = sprintf(Lang::$game['requires'], $name); $locks[$lock['type'.$i] == 1 ? $prop : -$prop] = sprintf(Lang::$game['requires'], $name);
} }
return $locks; return $locks;

View File

@@ -31,6 +31,7 @@ $lang = array(
'pageNotFound' => "Diese|Dieser|Dieses %s existiert nicht.", // todo: dämliche Fälle... 'pageNotFound' => "Diese|Dieser|Dieses %s existiert nicht.", // todo: dämliche Fälle...
'gender' => "Geschlecht", 'gender' => "Geschlecht",
'sex' => [null, 'Mann', 'Frau'], 'sex' => [null, 'Mann', 'Frau'],
'players' => "Spieler",
'quickFacts' => "Kurzübersicht", 'quickFacts' => "Kurzübersicht",
'screenshots' => "Screenshots", 'screenshots' => "Screenshots",
'videos' => "Videos", 'videos' => "Videos",
@@ -65,6 +66,7 @@ $lang = array(
'refineSearch' => "Tipp: Präzisiere deine Suche mit Durchsuchen einer <a href=\"javascript:;\" id=\"fi_subcat\">Unterkategorie</a>.", 'refineSearch' => "Tipp: Präzisiere deine Suche mit Durchsuchen einer <a href=\"javascript:;\" id=\"fi_subcat\">Unterkategorie</a>.",
'clear' => "leeren", 'clear' => "leeren",
'exactMatch' => "Exakt passend", 'exactMatch' => "Exakt passend",
'_reqLevel' => "Mindeststufe",
// infobox // infobox
'unavailable' => "Nicht für Spieler verfügbar", 'unavailable' => "Nicht für Spieler verfügbar",
@@ -141,12 +143,15 @@ $lang = array(
'itemsets' => "Ausrüstungssets", 'itemsets' => "Ausrüstungssets",
'mechanic' => "Auswirkung", 'mechanic' => "Auswirkung",
'mechAbbr' => "Ausw.", 'mechAbbr' => "Ausw.",
'meetingStone' => "Versammlungsstein",
'npc' => "NPC", 'npc' => "NPC",
'npcs' => "NPCs", 'npcs' => "NPCs",
'pet' => "Begleiter", 'pet' => "Begleiter",
'pets' => "Begleiter", 'pets' => "Begleiter",
'profile' => "", 'profile' => "",
'profiles' => "Profile", 'profiles' => "Profile",
'quest' => "Quest",
'quests' => "Quests",
'requires' => "Benötigt %s", 'requires' => "Benötigt %s",
'requires2' => "Benötigt", 'requires2' => "Benötigt",
'reqLevel' => "Benötigt Stufe %s", 'reqLevel' => "Benötigt Stufe %s",
@@ -260,6 +265,17 @@ $lang = array(
'publicDesc' => "Öffentliche Beschreibung", 'publicDesc' => "Öffentliche Beschreibung",
'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",
), ),
'gameObject' => array(
'cat' => [0 => "Anderes", 9 => "Bücher", 3 => "Behälter", -5 => "Truhen", 25 => "Fischschwärme", -3 => "Kräuter", -4 => "Erzadern", -2 => "Quest", -6 => "Werkzeuge"],
'type' => [ 9 => "Buch", 3 => "Behälter", -5 => "Truhe", 25 => "", -3 => "Kraut", -4 => "Erzvorkommen", -2 => "Quest", -6 => ""],
'unkPosition' => "Der Standort dieses Objekts ist nicht bekannt.",
'key' => "Schlüssel",
'focus' => "Zauberfokus",
'focusDesc' => "Zauber, die diesen Fokus benötigen, können an diesem Objekt gewirkt werden.",
'trap' => "Falle",
'triggeredBy' => "Ausgelöst durch",
'capturePoint' => "Eroberungspunkt"
),
'npc' => array( 'npc' => array(
'rank' => [0 => "Normal", 1 => "Elite", 4 => "Rar", 2 => "Rar Elite", 3 => "Boss"], 'rank' => [0 => "Normal", 1 => "Elite", 4 => "Rar", 2 => "Rar Elite", 3 => "Boss"],
'classification'=> "Einstufung", 'classification'=> "Einstufung",
@@ -272,6 +288,7 @@ $lang = array(
'gainsDesc' => "Nach dem Töten dieses NPCs erhaltet Ihr", 'gainsDesc' => "Nach dem Töten dieses NPCs erhaltet Ihr",
'repWith' => "Ruf mit der Fraktion", 'repWith' => "Ruf mit der Fraktion",
'stopsAt' => "Stoppt bei %s", 'stopsAt' => "Stoppt bei %s",
'vehicle' => "Fahrzeug",
'textTypes' => [null, "schreit", "sagt", "flüstert"], 'textTypes' => [null, "schreit", "sagt", "flüstert"],
'modes' => array( 'modes' => array(
1 => ["Normal", "Heroisch"], 1 => ["Normal", "Heroisch"],
@@ -330,9 +347,13 @@ $lang = array(
) )
), ),
'quest' => array( 'quest' => array(
'level' => 'Stufe %s', 'questLevel' => 'Stufe %s',
'daily' => 'Täglich', 'daily' => 'Täglich',
'requirements' => 'Anforderungen' 'requirements' => 'Anforderungen',
'questInfo' => array(
0 => 'Normal', 1 => 'Gruppe', 21 => 'Leben', 41 => 'PvP', 62 => 'Schlachtzug', 81 => 'Dungeon', 82 => 'Weltereignis',
83 => 'Legendär', 84 => 'Eskorte', 85 => 'Heroisch', 88 => 'Schlachtzug (10)', 89 => 'Schlachtzug (25)'
)
), ),
'title' => array( 'title' => array(
'cat' => array( 'cat' => array(
@@ -359,7 +380,13 @@ $lang = array(
'spillover' => "Reputationsüberlauf", 'spillover' => "Reputationsüberlauf",
'spilloverDesc' => "Für diese Fraktion erhaltener Ruf wird zusätzlich mit den unten aufgeführten Fraktionen anteilig verrechnet.", 'spilloverDesc' => "Für diese Fraktion erhaltener Ruf wird zusätzlich mit den unten aufgeführten Fraktionen anteilig verrechnet.",
'maxStanding' => "Max. Ruf", 'maxStanding' => "Max. Ruf",
'quartermaster' => "Rüstmeister" 'quartermaster' => "Rüstmeister",
'cat' => array(
1118 => ["Classic", 469 => "Allianz", 169 => "Dampfdruckkartell", 67 => "Horde", 891 => "Streitkräfte der Allianz", 892 => "Streitkräfte der Horde"],
980 => ["The Burning Crusade", 936 => "Shattrath"],
1097 => ["Wrath of the Lich King", 1052 => "Expedition der Horde", 1117 => "Sholazarbecken", 1037 => "Vorposten der Allianz"],
0 => "Sonstige"
)
), ),
'itemset' => array( 'itemset' => array(
'_desc' => "<b>%s</b> ist das <b>%s</b>. Es enthält %s Teile.", '_desc' => "<b>%s</b> ist das <b>%s</b>. Es enthält %s Teile.",
@@ -576,7 +603,6 @@ $lang = array(
'_unavailable' => "Dieser Gegenstand ist nicht für Spieler verfügbar.", '_unavailable' => "Dieser Gegenstand ist nicht für Spieler verfügbar.",
'_rndEnchants' => "Zufällige Verzauberungen", '_rndEnchants' => "Zufällige Verzauberungen",
'_chance' => "(Chance von %s%%)", '_chance' => "(Chance von %s%%)",
'_reqLevel' => "Mindeststufe",
'reqRating' => "Benötigt eine persönliche Arenawertung und Teamwertung von %d.", 'reqRating' => "Benötigt eine persönliche Arenawertung und Teamwertung von %d.",
'slot' => "Platz", 'slot' => "Platz",
'_quality' => "Qualität", '_quality' => "Qualität",

View File

@@ -26,6 +26,7 @@ $lang = array(
'pageNotFound' => "This %s doesn't exist.", 'pageNotFound' => "This %s doesn't exist.",
'gender' => "Gender", 'gender' => "Gender",
'sex' => [null, 'Male', 'Female'], 'sex' => [null, 'Male', 'Female'],
'players' => "Players",
'quickFacts' => "Quick Facts", 'quickFacts' => "Quick Facts",
'screenshots' => "Screenshots", 'screenshots' => "Screenshots",
'videos' => "Videos", 'videos' => "Videos",
@@ -52,6 +53,7 @@ $lang = array(
'refineSearch' => "Tip: Refine your search by browsing a <a href=\"javascript:;\" id=\"fi_subcat\">subcategory</a>.", 'refineSearch' => "Tip: Refine your search by browsing a <a href=\"javascript:;\" id=\"fi_subcat\">subcategory</a>.",
'clear' => "clear", 'clear' => "clear",
'exactMatch' => "Exact match", 'exactMatch' => "Exact match",
'_reqLevel' => "Required level",
// infobox // infobox
'unavailable' => "Not available to players", // alternative wording found: "No longer available to players" ... aw screw it <_< 'unavailable' => "Not available to players", // alternative wording found: "No longer available to players" ... aw screw it <_<
@@ -128,12 +130,15 @@ $lang = array(
'itemsets' => "Item Sets", 'itemsets' => "Item Sets",
'mechanic' => "Mechanic", 'mechanic' => "Mechanic",
'mechAbbr' => "Mech.", 'mechAbbr' => "Mech.",
'meetingStone' => "Meeting Stone",
'npc' => "NPC", 'npc' => "NPC",
'npcs' => "NPCs", 'npcs' => "NPCs",
'pet' => "Pet", 'pet' => "Pet",
'pets' => "Hunter Pets", 'pets' => "Hunter Pets",
'profile' => "profile", 'profile' => "profile",
'profiles' => "Profiles", 'profiles' => "Profiles",
'quest' => "quest",
'quests' => "Quests",
'requires' => "Requires %s", 'requires' => "Requires %s",
'requires2' => "Requires", 'requires2' => "Requires",
'reqLevel' => "Requires Level %s", 'reqLevel' => "Requires Level %s",
@@ -247,6 +252,17 @@ $lang = array(
'publicDesc' => "Public Description", 'publicDesc' => "Public Description",
'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>",
), ),
'gameObject' => array(
'cat' => [0 => "Other", 9 => "Books", 3 => "Containers", -5 => "Chests", 25 => "Fishing Pools", -3 => "Herbs", -4 => "Mineral Veins", -2 => "Quest", -6 => "Tools"],
'type' => [ 9 => "Book", 3 => "Container", -5 => "Chest", 25 => "", -3 => "Herb", -4 => "Mineral Vein", -2 => "Quest", -6 => ""],
'unkPosition' => "The location of this object is unknown.",
'key' => "Key",
'focus' => "Spell Focus",
'focusDesc' => "Spells requiring this Focus can be cast near this Object",
'trap' => "Trap",
'triggeredBy' => "Triggered by",
'capturePoint' => "Capture Point"
),
'npc' => array( 'npc' => array(
'rank' => [0 => "Normal", 1 => "Elite", 4 => "Rare", 2 => "Rare Elite", 3 => "Boss"], 'rank' => [0 => "Normal", 1 => "Elite", 4 => "Rare", 2 => "Rare Elite", 3 => "Boss"],
'classification'=> "Classification", 'classification'=> "Classification",
@@ -259,6 +275,7 @@ $lang = array(
'gainsDesc' => "After killing this NPC you will gain", 'gainsDesc' => "After killing this NPC you will gain",
'repWith' => "reputation with", 'repWith' => "reputation with",
'stopsAt' => "stops at %s", 'stopsAt' => "stops at %s",
'vehicle' => "Vehicle",
'textTypes' => [null, "yells", "says", "whispers"], 'textTypes' => [null, "yells", "says", "whispers"],
'modes' => array( 'modes' => array(
1 => ["Normal", "Heroic"], 1 => ["Normal", "Heroic"],
@@ -317,9 +334,13 @@ $lang = array(
) )
), ),
'quest' => array( 'quest' => array(
'level' => 'Level %s', 'questLevel' => 'Level %s',
'daily' => 'Daily', 'daily' => 'Daily',
'requirements' => 'Requirements' 'requirements' => 'Requirements',
'questInfo' => array(
0 => 'Normal', 1 => 'Group', 21 => 'Life', 41 => 'PvP', 62 => 'Raid', 81 => 'Dungeon', 82 => 'World Event',
83 => 'Legendary', 84 => 'Escort', 85 => 'Heroic', 88 => 'Raid (10)', 89 => 'Raid (25)'
)
), ),
'title' => array( 'title' => array(
'cat' => array( 'cat' => array(
@@ -346,7 +367,13 @@ $lang = array(
'spillover' => "Reputation Spillover", 'spillover' => "Reputation Spillover",
'spilloverDesc' => "Gaining Reputation with this faction also yields a proportional gain with the factions listed below.", 'spilloverDesc' => "Gaining Reputation with this faction also yields a proportional gain with the factions listed below.",
'maxStanding' => "Max. Standing", 'maxStanding' => "Max. Standing",
'quartermaster' => "Quartermaster" 'quartermaster' => "Quartermaster",
'cat' => array(
1118 => ["Classic", 469 => "Alliance", 169 => "Steamwheedle Cartel", 67 => "Horde", 891 => "Alliance Forces", 892 => "Horde Forces"],
980 => ["The Burning Crusade", 936 => "Shattrath City"],
1097 => ["Wrath of the Lich King", 1052 => "Horde Expedition", 1117 => "Sholazar Basin", 1037 => "Alliance Vanguard"],
0 => "Other"
)
), ),
'itemset' => array( 'itemset' => array(
'_desc' => "<b>%s</b> is the <b>%s</b>. It contains %s pieces.", '_desc' => "<b>%s</b> is the <b>%s</b>. It contains %s pieces.",
@@ -563,7 +590,6 @@ $lang = array(
'_unavailable' => "This item is not available to players.", '_unavailable' => "This item is not available to players.",
'_rndEnchants' => "Random Enchantments", '_rndEnchants' => "Random Enchantments",
'_chance' => "(%s%% chance)", '_chance' => "(%s%% chance)",
'_reqLevel' => "Required level",
'reqRating' => "Requires personal and team arena rating of %d<br />in 3v3 or 5v5 brackets", 'reqRating' => "Requires personal and team arena rating of %d<br />in 3v3 or 5v5 brackets",
'slot' => "Slot", 'slot' => "Slot",
'_quality' => "Quality", '_quality' => "Quality",

View File

@@ -31,6 +31,7 @@ $lang = array(
'pageNotFound' => "Este %s no existe.", 'pageNotFound' => "Este %s no existe.",
'gender' => "Género", 'gender' => "Género",
'sex' => [null, 'Hombre', 'Mujer'], 'sex' => [null, 'Hombre', 'Mujer'],
'players' => "Jugadores",
'quickFacts' => "Notas rápidas", 'quickFacts' => "Notas rápidas",
'screenshots' => "Capturas de pantalla", 'screenshots' => "Capturas de pantalla",
'videos' => "Videos", 'videos' => "Videos",
@@ -57,6 +58,7 @@ $lang = array(
'refineSearch' => "Sugerencia: Refina tu búsqueda llendo a una <a href=\"javascript:;\" id=\"fi_subcat\">subcategoría</a>.", 'refineSearch' => "Sugerencia: Refina tu búsqueda llendo a una <a href=\"javascript:;\" id=\"fi_subcat\">subcategoría</a>.",
'clear' => "borrar", 'clear' => "borrar",
'exactMatch' => "Coincidencia exacta", 'exactMatch' => "Coincidencia exacta",
'_reqLevel' => "Nivel requerido",
// infobox // infobox
'unavailable' => "No está disponible a los jugadores", 'unavailable' => "No está disponible a los jugadores",
@@ -133,12 +135,15 @@ $lang = array(
'itemsets' => "Conjuntos de objetos", 'itemsets' => "Conjuntos de objetos",
'mechanic' => "Mecanica", 'mechanic' => "Mecanica",
'mechAbbr' => "Mec.", 'mechAbbr' => "Mec.",
'meetingStone' => "Roca de encuentro",
'npc' => "PNJ", 'npc' => "PNJ",
'npcs' => "PNJs", 'npcs' => "PNJs",
'pet' => "Mascota", 'pet' => "Mascota",
'pets' => "Mascotas de cazador", 'pets' => "Mascotas de cazador",
'profile' => "", 'profile' => "",
'profiles' => "Perfiles", 'profiles' => "Perfiles",
'quest' => "misión",
'quests' => "Misiones",
'requires' => "Requiere %s", 'requires' => "Requiere %s",
'requires2' => "Requiere", 'requires2' => "Requiere",
'reqLevel' => "Necesitas ser de nivel %s", 'reqLevel' => "Necesitas ser de nivel %s",
@@ -218,6 +223,17 @@ $lang = array(
'goForum' => "Feedback <a href=\"?forums&board=1\">forum</a>", 'goForum' => "Feedback <a href=\"?forums&board=1\">forum</a>",
), ),
'account' => [], 'account' => [],
'gameObject' => array(
'cat' => [0 => "Otros", 9 => "Libros", 3 => "Contenedores", -5 => "Cofres", 25 => "[Fishing Pools]", -3 => "Hierbas", -4 => "Venas de minerales", -2 => "Misiones", -6 => "Herramientas"],
'type' => [ 9 => "Libro", 3 => "Contenedore", -5 => "Cofre", 25 => "", -3 => "Hierba", -4 => "Filóne de mineral", -2 => "Misión", -6 => ""],
'unkPosition' => "No se conoce la ubicación de esta entidad.",
'key' => "Llave",
'focus' => "[Spell Focus]",
'focusDesc' => "[Spells requiring this Focus can be cast near this Object]",
'trap' => "Trampa",
'triggeredBy' => "Accionado por",
'capturePoint' => "Punto de captura"
),
'npc' => array( 'npc' => array(
'rank' => [0 => "Normal", 1 => "Élite", 4 => "Raro", 2 => "Élite raro", 3 => "Jefe"], 'rank' => [0 => "Normal", 1 => "Élite", 4 => "Raro", 2 => "Élite raro", 3 => "Jefe"],
'classification'=> "Clasificación", 'classification'=> "Clasificación",
@@ -230,6 +246,7 @@ $lang = array(
'gainsDesc' => "Tras acabar con este PNJ ganarás", 'gainsDesc' => "Tras acabar con este PNJ ganarás",
'repWith' => "reputación con", 'repWith' => "reputación con",
'stopsAt' => "se detiene en %s", 'stopsAt' => "se detiene en %s",
'vehicle' => "Vehículo",
'textTypes' => [null, "grita", "dice", "susurra"], 'textTypes' => [null, "grita", "dice", "susurra"],
'modes' => array( 'modes' => array(
1 => ["Normal", "Heroico"], 1 => ["Normal", "Heroico"],
@@ -288,9 +305,13 @@ $lang = array(
) )
), ),
'quest' => array( 'quest' => array(
'level' => 'Nivel %s', 'questLevel' => 'Nivel %s',
'daily' => 'Diaria', 'daily' => 'Diaria',
'requirements' => 'Requisitos' 'requirements' => 'Requisitos',
'questInfo' => array(
0 => 'Normal', 1 => 'Élite', 21 => 'Vida', 41 => 'JcJ', 62 => 'Banda', 81 => 'Mazmorra', 82 => 'Evento del mundo',
83 => 'Legendaria', 84 => 'Escolta', 85 => 'Heroica', 88 => 'Banda (10)', 89 => 'Banda (25)'
)
), ),
'title' => array( 'title' => array(
'cat' => array( 'cat' => array(
@@ -317,7 +338,13 @@ $lang = array(
'spillover' => "[Reputation Spillover]", 'spillover' => "[Reputation Spillover]",
'spilloverDesc' => "[Gaining Reputation with this faction also yields a proportional gain with the factions listed below.]", 'spilloverDesc' => "[Gaining Reputation with this faction also yields a proportional gain with the factions listed below.]",
'maxStanding' => "Posición máxima", 'maxStanding' => "Posición máxima",
'quartermaster' => "Intendente" 'quartermaster' => "Intendente",
'cat' => array(
1118 => ["Clásicas", 469 => "Alianza", 169 => "Cártel Bonvapor", 67 => "Horda", 891 => "Fuerzas de la Alianza", 892 => "Fuerzas de la Horda"],
980 => ["The Burning Crusade", 936 => "Ciudad de Shattrath"],
1097 => ["Wrath of the Lich King", 1052 => "Expedición de la Horda", 1117 => "Cuenca de Sholazar", 1037 => "Vanguardia de la Alianza"],
0 => "Otros"
)
), ),
'itemset' => array( 'itemset' => array(
'_desc' => "<b>%s</b> es el <b>%s</b>. Contiene %s piezas.", '_desc' => "<b>%s</b> es el <b>%s</b>. Contiene %s piezas.",
@@ -534,7 +561,6 @@ $lang = array(
'_unavailable' => "Este objeto no está disponible para los jugadores.", '_unavailable' => "Este objeto no está disponible para los jugadores.",
'_rndEnchants' => "Encantamientos aleatorios", '_rndEnchants' => "Encantamientos aleatorios",
'_chance' => "(probabilidad %s%%)", '_chance' => "(probabilidad %s%%)",
'_reqLevel' => "Nivel requerido",
'reqRating' => "Requiere un índice de arena personal y de equipo de %d", 'reqRating' => "Requiere un índice de arena personal y de equipo de %d",
'slot' => "Casilla", 'slot' => "Casilla",
'_quality' => "Calidad", '_quality' => "Calidad",

View File

@@ -31,6 +31,7 @@ $lang = array(
'pageNotFound' => "Ce %s n'existe pas.", 'pageNotFound' => "Ce %s n'existe pas.",
'gender' => "Genre", 'gender' => "Genre",
'sex' => [null, 'Homme', 'Femme'], 'sex' => [null, 'Homme', 'Femme'],
'players' => "Joueurs",
'quickFacts' => "En bref", 'quickFacts' => "En bref",
'screenshots' => "Captures d'écran", 'screenshots' => "Captures d'écran",
'videos' => "Vidéos", 'videos' => "Vidéos",
@@ -57,6 +58,7 @@ $lang = array(
'refineSearch' => "Astuce : Affinez votre recherche en utilisant une <a href=\"javascript:;\" id=\"fi_subcat\">sous-catégorie</a>.", 'refineSearch' => "Astuce : Affinez votre recherche en utilisant une <a href=\"javascript:;\" id=\"fi_subcat\">sous-catégorie</a>.",
'clear' => "effacer", 'clear' => "effacer",
'exactMatch' => "Concordance exacte", 'exactMatch' => "Concordance exacte",
'_reqLevel' => "Niveau requis",
// infobox // infobox
'unavailable' => "Non disponible aux joueurs", 'unavailable' => "Non disponible aux joueurs",
@@ -133,12 +135,15 @@ $lang = array(
'itemsets' => "Ensembles d'objets", 'itemsets' => "Ensembles d'objets",
'mechanic' => "Mécanique", 'mechanic' => "Mécanique",
'mechAbbr' => "Mécan.", 'mechAbbr' => "Mécan.",
'meetingStone' => "Pierre de rencontre",
'npc' => "PNJ", 'npc' => "PNJ",
'npcs' => "PNJs", 'npcs' => "PNJs",
'pet' => "Familier", 'pet' => "Familier",
'pets' => "Familiers de chasseur", 'pets' => "Familiers de chasseur",
'profile' => "", 'profile' => "",
'profiles' => "Profils", 'profiles' => "Profils",
'quest' => "quête",
'quests' => "Quêtes",
'requires' => "%s requis", 'requires' => "%s requis",
'requires2' => "Requiert", 'requires2' => "Requiert",
'reqLevel' => "Niveau %s requis", 'reqLevel' => "Niveau %s requis",
@@ -218,6 +223,17 @@ $lang = array(
'goForum' => "Feedback <a href=\"?forums&board=1\">forum</a>", 'goForum' => "Feedback <a href=\"?forums&board=1\">forum</a>",
), ),
'account' => [], 'account' => [],
'gameObject' => array(
'cat' => [0 => "Autre", 9 => "Livres", 3 => "Conteneurs", -5 => "Coffres", 25 => "Bancs de poissons", -3 => "Herbes", -4 => "Filons de minerai", -2 => "Quêtes", -6 => "Outils"],
'type' => [ 9 => "Livre", 3 => "Conteneur", -5 => "Coffre", 25 => "", -3 => "Herbe", -4 => "Filon de minerai", -2 => "Quête", -6 => ""],
'unkPosition' => "L'emplacement de cette entité est inconnu.",
'key' => "Clé",
'focus' => "[Spell Focus]",
'focusDesc' => "[Spells requiring this Focus can be cast near this Object]",
'trap' => "Piège",
'triggeredBy' => "Déclenché par",
'capturePoint' => "Point de capture"
),
'npc' => array( 'npc' => array(
'rank' => [0 => "Standard", 1 => "Élite", 4 => "Rare", 2 => "Élite rare", 3 =>"Boss"], 'rank' => [0 => "Standard", 1 => "Élite", 4 => "Rare", 2 => "Élite rare", 3 =>"Boss"],
'classification'=> "Classification", 'classification'=> "Classification",
@@ -230,6 +246,7 @@ $lang = array(
'gainsDesc' => "Après avoir tué ce PNJ vous allez obtenir", 'gainsDesc' => "Après avoir tué ce PNJ vous allez obtenir",
'repWith' => "points de réputation avec", 'repWith' => "points de réputation avec",
'stopsAt' => "arrête à %s", 'stopsAt' => "arrête à %s",
'vehicle' => "Véhicule",
'textTypes' => [null, "crie", "dit", "chuchote"], 'textTypes' => [null, "crie", "dit", "chuchote"],
'modes' => array( 'modes' => array(
1 => ["Normal", "Héroïque"], 1 => ["Normal", "Héroïque"],
@@ -288,9 +305,13 @@ $lang = array(
) )
), ),
'quest' => array( 'quest' => array(
'level' => 'Niveau %s', 'questLevel' => 'Niveau %s',
'daily' => 'Journalière', 'daily' => 'Journalière',
'requirements' => 'Conditions' 'requirements' => 'Conditions',
'questInfo' => array(
0 => 'Standard', 1 => 'Groupe', 21 => 'Vie', 41 => 'JcJ', 62 => 'Raid', 81 => 'Donjon', 82 => 'Évènement mondial',
83 => 'Légendaire', 84 => 'Escorte', 85 => 'Héroïque', 88 => 'Raid (10)', 89 => 'Raid (25)'
)
), ),
'title' => array( 'title' => array(
'cat' => array( 'cat' => array(
@@ -317,7 +338,13 @@ $lang = array(
'spillover' => "[Reputation Spillover]", 'spillover' => "[Reputation Spillover]",
'spilloverDesc' => "[Gaining Reputation with this faction also yields a proportional gain with the factions listed below.]", 'spilloverDesc' => "[Gaining Reputation with this faction also yields a proportional gain with the factions listed below.]",
'maxStanding' => "Niveau maximum", 'maxStanding' => "Niveau maximum",
'quartermaster' => "Intendant" 'quartermaster' => "Intendant",
'cat' => array(
1118 => ["Classique", 469 => "Alliance", 169 => "Cartel Gentepression", 67 => "Horde", 891 => "Forces de l'Alliance", 892 => "Forces de la Horde"],
980 => ["The Burning Crusade", 936 => "Shattrath"],
1097 => ["Wrath of the Lich King", 1052 => "Expédition de la Horde", 1117 => "Bassin de Sholazar", 1037 => "Avant-garde de l'Alliance"],
0 => "Autre"
)
), ),
'itemset' => array( 'itemset' => array(
'_desc' => "<b>%s</b> est le <b>%s</b>. Il contient %s pièces.", '_desc' => "<b>%s</b> est le <b>%s</b>. Il contient %s pièces.",
@@ -534,7 +561,6 @@ $lang = array(
'_unavailable' => "Este objeto no está disponible para los jugadores.", '_unavailable' => "Este objeto no está disponible para los jugadores.",
'_rndEnchants' => "Enchantements aléatoires", '_rndEnchants' => "Enchantements aléatoires",
'_chance' => "(%s%% de chance)", '_chance' => "(%s%% de chance)",
'_reqLevel' => "Niveau requis",
'reqRating' => "Nécessite une cote d'arène personnelle et en équipe de %d<br />en arène de 3c3 ou 5c5.", 'reqRating' => "Nécessite une cote d'arène personnelle et en équipe de %d<br />en arène de 3c3 ou 5c5.",
'slot' => "Emplacement", 'slot' => "Emplacement",
'_quality' => "Qualité", '_quality' => "Qualité",

View File

@@ -31,6 +31,7 @@ $lang = array(
'pageNotFound' => "Такое %s не существует.", 'pageNotFound' => "Такое %s не существует.",
'gender' => "Пол", 'gender' => "Пол",
'sex' => [null, 'Мужчина', 'Женщина'], 'sex' => [null, 'Мужчина', 'Женщина'],
'players' => "Игрокам",
'quickFacts' => "Краткая информация", 'quickFacts' => "Краткая информация",
'screenshots' => "Изображения", 'screenshots' => "Изображения",
'videos' => "Видео", 'videos' => "Видео",
@@ -57,6 +58,7 @@ $lang = array(
'refineSearch' => "Совет: Уточните поиск, добавив <a href=\"javascript:;\" id=\"fi_subcat\">подкатегорию</a>.", 'refineSearch' => "Совет: Уточните поиск, добавив <a href=\"javascript:;\" id=\"fi_subcat\">подкатегорию</a>.",
'clear' => "Очистить", 'clear' => "Очистить",
'exactMatch' => "Полное совпадение", 'exactMatch' => "Полное совпадение",
'_reqLevel' => "Требуется уровень",
// infobox // infobox
'unavailable' => "Недоступно игрокам", 'unavailable' => "Недоступно игрокам",
@@ -133,12 +135,15 @@ $lang = array(
'itemsets' => "Комплекты", 'itemsets' => "Комплекты",
'mechanic' => "Механика", 'mechanic' => "Механика",
'mechAbbr' => "Механика", 'mechAbbr' => "Механика",
'meetingStone' => "Камень встреч",
'npc' => "НИП", 'npc' => "НИП",
'npcs' => "НИП", 'npcs' => "НИП",
'pet' => "Питомец", 'pet' => "Питомец",
'pets' => "Питомцы охотников", 'pets' => "Питомцы охотников",
'profile' => "", 'profile' => "",
'profiles' => "Профили", 'profiles' => "Профили",
'quest' => "задание",
'quests' => "Задания",
'requires' => "Требует %s", 'requires' => "Требует %s",
'requires2' => "Требуется:", 'requires2' => "Требуется:",
'reqLevel' => "Требуется уровень: %s", 'reqLevel' => "Требуется уровень: %s",
@@ -171,7 +176,7 @@ $lang = array(
11 => "драконий", 12 => "калимаг", 13 => "гномский", 14 => "язык троллей", 33 => "наречие нежити", 35 => "дренейский", 36 => "наречие зомби", 37 => "машинный гномский", 38 => "машинный гоблинский" 11 => "драконий", 12 => "калимаг", 13 => "гномский", 14 => "язык троллей", 33 => "наречие нежити", 35 => "дренейский", 36 => "наречие зомби", 37 => "машинный гномский", 38 => "машинный гоблинский"
), ),
'gl' => array(null, "Большой", "Малый"), 'gl' => array(null, "Большой", "Малый"),
'si' => array(-2 => "Орда только", -1 => "Альянс только", null, "Альянс", "Орда", "Обе"), 'si' => array(1 => "Альянс", -1 => "Альянс только", 2 => "Орда", -2 => "Орда только", null, 3 => "Обе"),
'resistances' => array(null, 'Сопротивление светлой магии', 'Сопротивление огню', 'Сопротивление силам природы', 'Сопротивление магии льда', 'Сопротивление темной магии', 'Сопротивление тайной магии'), 'resistances' => array(null, 'Сопротивление светлой магии', 'Сопротивление огню', 'Сопротивление силам природы', 'Сопротивление магии льда', 'Сопротивление темной магии', 'Сопротивление тайной магии'),
'dt' => array(null, 'Магия', 'Проклятие', 'Болезнь', 'Яд', 'Незаметность', 'Невидимость', null, null, 'Исступление'), 'dt' => array(null, 'Магия', 'Проклятие', 'Болезнь', 'Яд', 'Незаметность', 'Невидимость', null, null, 'Исступление'),
'sc' => array("Физический урон", "Свет", "Огонь", "природа", "Лед", "Тьма", "Тайная магия"), 'sc' => array("Физический урон", "Свет", "Огонь", "природа", "Лед", "Тьма", "Тайная магия"),
@@ -218,6 +223,17 @@ $lang = array(
'goForum' => "Feedback <a href=\"?forums&board=1\">forum</a>", 'goForum' => "Feedback <a href=\"?forums&board=1\">forum</a>",
), ),
'account' => [], 'account' => [],
'gameObject' => array(
'cat' => [0 => "Другое", 9 => "Книги", 3 => "Контейнеры", -5 => "Сундуки", 25 => "[Fishing Pools]", -3 => "Травы", -4 => "Полезные ископаемые", -2 => "Задания", -6 => "Инструменты"],
'type' => [ 9 => "Книга", 3 => "Контейнер", -5 => "Сундук", 25 => "", -3 => "Растение", -4 => "Полезное ископаемое", -2 => "Задание", -6 => ""],
'unkPosition' => "Местонахождение этого объекта неизвестно.",
'key' => "Ключ",
'focus' => "[Spell Focus]",
'focusDesc' => "[Spells requiring this Focus can be cast near this Object]",
'trap' => "Ловушки",
'triggeredBy' => "Срабатывает от",
'capturePoint' => "Точка захвата"
),
'npc' => array( 'npc' => array(
'rank' => [0 => "Обычный", 1 => "Элитный", 4 => "Редкий", 2 => "Редкий элитный", 3 =>"Босс"], 'rank' => [0 => "Обычный", 1 => "Элитный", 4 => "Редкий", 2 => "Редкий элитный", 3 =>"Босс"],
'classification'=> "Классификация", 'classification'=> "Классификация",
@@ -230,6 +246,7 @@ $lang = array(
'gainsDesc' => "В награду за убийство этого НИПа вы получите", 'gainsDesc' => "В награду за убийство этого НИПа вы получите",
'repWith' => "репутации с", 'repWith' => "репутации с",
'stopsAt' => 'останавливается на уровне "%s"', 'stopsAt' => 'останавливается на уровне "%s"',
'vehicle' => "Автомобиль",
'textTypes' => [null, "кричит", "говорит", "шепчет"], 'textTypes' => [null, "кричит", "говорит", "шепчет"],
'modes' => array( 'modes' => array(
1 => ["Обычный", "Героический"], 1 => ["Обычный", "Героический"],
@@ -288,9 +305,13 @@ $lang = array(
) )
), ),
'quest' => array( 'quest' => array(
'level' => '%s-го уровня', 'questLevel' => '%s-го уровня',
'daily' => 'Ежедневно', 'daily' => 'Ежедневно',
'requirements' => 'Требования' 'requirements' => 'Требования',
'questInfo' => array(
0 => 'Обычный', 1 => 'Группа', 21 => 'Жизнь', 41 => 'PvP', 62 => 'Рейд', 81 => 'Подземелье', 82 => 'Игровое событие',
83 => 'Легенда', 84 => 'Сопровождение', 85 => 'Героическое', 88 => 'Рейд (10)', 89 => 'Рейд (25)'
)
), ),
'title' => array( 'title' => array(
'cat' => array( 'cat' => array(
@@ -317,7 +338,13 @@ $lang = array(
'spillover' => "[Reputation Spillover]", 'spillover' => "[Reputation Spillover]",
'spilloverDesc' => "[Gaining Reputation with this faction also yields a proportional gain with the factions listed below.]", 'spilloverDesc' => "[Gaining Reputation with this faction also yields a proportional gain with the factions listed below.]",
'maxStanding' => "Макс Уровень", 'maxStanding' => "Макс Уровень",
'quartermaster' => "Интендант" 'quartermaster' => "Интендант",
'cat' => array(
1118 => ["World of Warcraft", 469 => "Альянс", 169 => "Картель Хитрая Шестеренка", 67 => "Орда", 891 => "Силы Альянса", 892 => "Силы Орды"],
980 => ["The Burning Crusade", 936 => "Город Шаттрат"],
1097 => ["Wrath of the Lich King", 1052 => "Экспедиция Орды", 1117 => "Низина Шолазар", 1037 => "Авангард Альянса"],
0 => "Другое"
)
), ),
'itemset' => array( 'itemset' => array(
'_desc' => "<b>%s</b> — <b>%s</b>. Он состоит из %s предметов.", '_desc' => "<b>%s</b> — <b>%s</b>. Он состоит из %s предметов.",
@@ -534,7 +561,6 @@ $lang = array(
'_unavailable' => "Этот предмет не доступен игрокам.", '_unavailable' => "Этот предмет не доступен игрокам.",
'_rndEnchants' => "Случайные улучшения", '_rndEnchants' => "Случайные улучшения",
'_chance' => "(шанс %s%%)", '_chance' => "(шанс %s%%)",
'_reqLevel' => "Требуется уровень",
'reqRating' => "Требуется личный и командный рейтинг на арене не ниже %d", 'reqRating' => "Требуется личный и командный рейтинг на арене не ниже %d",
'slot' => "Слот", 'slot' => "Слот",
'_quality' => "Качество", '_quality' => "Качество",

View File

@@ -394,7 +394,6 @@ 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

View File

@@ -28,22 +28,24 @@ if (!$smarty->loadCache($cacheKey, $pageData))
if (isset($cats[0]) && empty($cats[1])) if (isset($cats[0]) && empty($cats[1]))
{ {
if (!$cats[0]) if (!$cats[0])
$conditions[] = ['f1.parentFactionId', [1118, 980, 1097, 469, 891, 67, 892, 169, 1037, 1052, 1117, 936], '!']; $conditions[] = ['parentFactionId', [1118, 980, 1097, 469, 891, 67, 892, 169, 1037, 1052, 1117, 936], '!'];
else else
{ {
$subs = DB::Aowow()->selectCol('SELECT id FROM ?_factions WHERE parentFactionId = ?d', $cats[0]); $subs = DB::Aowow()->selectCol('SELECT id FROM ?_factions WHERE parentFactionId = ?d', $cats[0]);
$conditions[] = ['OR', ['f1.parentFactionId', $subs], ['f1.id', $subs]]; $conditions[] = ['OR', ['parentFactionId', $subs], ['id', $subs]];
} }
$path[] = $cats[0]; $path[] = $cats[0];
// array_unshift($title, Lang::$factions['cat'][$cats[0]]);
$t = Lang::$faction['cat'][$cats[0]];
array_unshift($title, is_array($t) ? $t[0] : $t);
} }
else if (!empty($cats[1])) else if (!empty($cats[1]))
{ {
$conditions[] = ['f1.parentFactionId', $cats[1]]; $conditions[] = ['parentFactionId', $cats[1]];
$path[] = $cats[0]; $path[] = $cats[0];
$path[] = $cats[1]; $path[] = $cats[1];
// array_unshift($title, Lang::$factions['cat'][$cats[1]]); array_unshift($title, Lang::$faction['cat'][$cats[0]][$cats[1]]);
} }
$factions = new FactionList($conditions); $factions = new FactionList($conditions);

View File

@@ -11,6 +11,7 @@ require 'includes/community.class.php';
$_id = intVal($pageParam); $_id = intVal($pageParam);
$_path = [0, 0]; $_path = [0, 0];
$_visSlots = [SLOT_HEAD, SLOT_SHOULDERS, SLOT_SHIRT, SLOT_CHEST, SLOT_WAIST, SLOT_LEGS, SLOT_FEET, SLOT_WRISTS, SLOT_HANDS, SLOT_BACK, SLOT_MAIN_HAND, SLOT_OFF_HAND, SLOT_RANGED, SLOT_TABARD];
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ITEM, $_id, -1, User::$localeId]); $cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ITEM, $_id, -1, User::$localeId]);
@@ -246,7 +247,7 @@ 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($_slot, $_visSlots) && $item->getField('displayId');
// path // path
if (in_array($_class, [5, 8, 14])) if (in_array($_class, [5, 8, 14]))
@@ -562,13 +563,7 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
if ($lockIds) if ($lockIds)
{ {
// objects // objects
$conditions = array( $lockedObj = new GameObjectList(array(['lockId', $lockIds]));
'OR',
['AND', ['data0', $lockIds], ['type', [OBJECT_QUESTGIVER, OBJECT_CHEST, OBJECT_TRAP, OBJECT_GOOBER, OBJECT_CAMERA, OBJECT_FLAGSTAND, OBJECT_FLAGDROP]]],
['AND', ['data1', $lockIds], ['type', [OBJECT_DOOR, OBJECT_BUTTON]]]
);
$lockedObj = new GameObjectList($conditions);
if (!$lockedObj->error) if (!$lockedObj->error)
{ {
$pageData['relTabs'][] = array( $pageData['relTabs'][] = array(
@@ -700,6 +695,7 @@ if (!$smarty->loadCache($cacheKeyPage, $item))
} }
// tab: same model as // tab: same model as
// todo (low): should also work for creatures summoned by item
if (($model = $item->getField('model')) && $_slot) if (($model = $item->getField('model')) && $_slot)
{ {
$sameModel = new ItemList(array(['model', $model], ['id', $_id, '!'], ['slot', $_slot])); $sameModel = new ItemList(array(['model', $model], ['id', $_id, '!'], ['slot', $_slot]));

View File

@@ -10,35 +10,18 @@ $_path = [1, 8];
$subMenu = $h1Links = null; $subMenu = $h1Links = null;
$_title = ''; $_title = '';
$_rss = isset($_GET['rss']); $_rss = isset($_GET['rss']);
$lv = [];
switch ($pageCall) switch ($pageCall)
{ {
case 'random': case 'random':
$type = array_rand(array_filter(Util::$typeStrings)); $type = array_rand(array_filter(Util::$typeStrings));
$page = Util::$typeStrings[$type]; $typeId = 0;
$id = 0;
switch ($type) if ($type != TYPE_QUEST)
{ $typeId = (new Util::$typeClasses[$type](null))->getRandomId();
case TYPE_NPC: $id = (new CreatureList(null))->getRandomId(); break;
case TYPE_OBJECT: $id = (new GameobjectList(null))->getRandomId(); break;
case TYPE_ITEM: $id = (new ItemList(null))->getRandomId(); break;
case TYPE_ITEMSET: $id = (new ItemsetList(null))->getRandomId(); break;
case TYPE_QUEST: $id = (new QuestList(null))->getRandomId(); break;
case TYPE_SPELL: $id = (new SpellList(null))->getRandomId(); break;
case TYPE_ZONE: $id = (new ZoneList(null))->getRandomId(); break;
case TYPE_FACTION: $id = (new FactionList(null))->getRandomId(); break;
case TYPE_PET: $id = (new PetList(null))->getRandomId(); break;
case TYPE_ACHIEVEMENT: $id = (new AchievementList(null))->getRandomId(); break;
case TYPE_TITLE: $id = (new TitleList(null))->getRandomId(); break;
case TYPE_WORLDEVENT: $id = (new WorldEventList(null))->getRandomId(); break;
case TYPE_CLASS: $id = (new CharClassList(null))->getRandomId(); break;
case TYPE_RACE: $id = (new CharRaceList(null))->getRandomId(); break;
case TYPE_SKILL: $id = (new SkillList(null))->getRandomId(); break;
case TYPE_CURRENCY: $id = (new CurrencyList(null))->getRandomId(); break;
}
header('Location: ?'.$page.'='.$id); header('Location: ?'.Util::$typeStrings[$type].'='.$typeId);
die(); die();
case 'latest-comments': case 'latest-comments':
$menu = 2; $menu = 2;
@@ -52,22 +35,18 @@ switch ($pageCall)
break; break;
case 'latest-screenshots': case 'latest-screenshots':
$menu = 3; $menu = 3;
$lv = array( $lv[] = array(
array(
'file' => 'screenshot', 'file' => 'screenshot',
'data' => [], 'data' => [],
'params' => [] 'params' => []
)
); );
break; break;
case 'latest-videos': case 'latest-videos':
$menu = 11; $menu = 11;
$lv = array( $lv[] = array(
array(
'file' => 'video', 'file' => 'video',
'data' => [], 'data' => [],
'params' => [] 'params' => []
)
); );
break; break;
case 'latest-articles': case 'latest-articles':
@@ -76,15 +55,42 @@ switch ($pageCall)
break; break;
case 'latest-additions': case 'latest-additions':
$menu = 0; $menu = 0;
$lv = []; $extraText = '';
break; break;
case 'unrated-comments': case 'unrated-comments':
$menu = 5; $menu = 5;
$lv = []; $lv[] = array(
'file' => 'commentpreview',
'data' => [],
'params' => []
);
break; break;
case 'missing-screenshots': case 'missing-screenshots':
$menu = 13; $menu = 13;
$lv = []; $cnd = [[['cuFlags', CUSTOM_HAS_SCREENSHOT, '&'], 0]];
if (!User::isInGroup(U_GROUP_STAFF))
$cnd[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
foreach (Util::$typeClasses as $classStr)
{
// temp: as long as we use world.quest_template
if ($classStr == 'QuestList')
continue;
$typeObj = new $classStr($cnd);
if (!$typeObj->error)
{
$typeObj->addGlobalsToJscript(Util::$pageTemplate, GLOBALINFO_SELF | GLOBALINFO_RELATED);
$lv[] = array(
'file' => (new ReflectionProperty($typeObj, 'brickFile'))->getValue(),
'data' => $typeObj->getListviewData(),
'params' => ['tabs' => '$myTabs']
);
}
}
break; break;
case 'most-comments': case 'most-comments':
if ($pageParam && !in_array($pageParam, [1, 7, 30])) if ($pageParam && !in_array($pageParam, [1, 7, 30]))
@@ -102,7 +108,11 @@ switch ($pageCall)
} }
$menu = 12; $menu = 12;
$lv = []; $lv[] = array(
'file' => 'commentpreview',
'data' => [],
'params' => []
);
break; break;
default: default:
$smarty->error(); $smarty->error();
@@ -136,14 +146,6 @@ if (strstr($pageCall, 'latest') || $pageCall == 'most-comments')
$h1Links = '<small><a href="?'.$pageCall.($pageParam ? '='.$pageParam : null).'&rss" class="rss-icon">'.Lang::$main['subscribe'].'</a></small>'; $h1Links = '<small><a href="?'.$pageCall.($pageParam ? '='.$pageParam : null).'&rss" class="rss-icon">'.Lang::$main['subscribe'].'</a></small>';
} }
$pageData = array(
'listviews' => $lv,
'page' => array(
'name' => Lang::$main['utilities'][$menu] . ($_title ? Lang::$colon . $_title : null),
'h1Links' => $h1Links,
)
);
array_push($_path, $menu); array_push($_path, $menu);
if ($subMenu) if ($subMenu)
array_push($_path, $subMenu); array_push($_path, $subMenu);
@@ -152,14 +154,16 @@ if ($subMenu)
// menuId 8: Utilities g_initPath() // menuId 8: Utilities g_initPath()
// tabId 1: Tools g_initHeader() // tabId 1: Tools g_initHeader()
$smarty->updatePageVars(array( $smarty->updatePageVars(array(
'name' => Lang::$main['utilities'][$menu] . ($_title ? Lang::$colon . $_title : null),
'h1Links' => $h1Links,
'title' => Lang::$main['utilities'][$menu] . ($_title ? ' - ' . $_title : null), 'title' => Lang::$main['utilities'][$menu] . ($_title ? ' - ' . $_title : null),
'path' => json_encode($_path, JSON_NUMERIC_CHECK), 'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'tab' => 1 'tab' => 1
)); ));
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $lv);
// load the page // load the page
$smarty->display('generic-no-filter.tpl'); $smarty->display('list-page-generic.tpl');
?> ?>

View File

@@ -82,7 +82,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if (count($maps) == 1) // should only exist in one instance if (count($maps) == 1) // should only exist in one instance
{ {
$map = new ZoneList(array(1, ['mapId', $maps[0]])); $map = new ZoneList(array(1, ['mapId', $maps[0]]));
// $mapType = $map->getField('areaType'); // $mapType = $map->getField('areaType'); //NYI
} }
/***********/ /***********/
@@ -128,13 +128,17 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($_ = intVal(($npc->getField('minGold') + $npc->getField('maxGold')) / 2)) if ($_ = intVal(($npc->getField('minGold') + $npc->getField('maxGold')) / 2))
$infobox[] = Lang::$npc['worth'].Lang::$colon.'[tooltip=tooltip_avgmoneydropped][money='.$_.'][/tooltip]'; $infobox[] = Lang::$npc['worth'].Lang::$colon.'[tooltip=tooltip_avgmoneydropped][money='.$_.'][/tooltip]';
// is Vehicle
if ($npc->getField('vehicleId'))
$infobox[] = Lang::$npc['vehicle'];
// AI // AI
if (User::isInGroup(U_GROUP_STAFF)) if (User::isInGroup(U_GROUP_STAFF))
{ {
if ($_ = $npc->getField('aiName')) if ($_ = $npc->getField('scriptName'))
$infobox[] = 'AI'.Lang::$colon.$_;
else if ($_ = $npc->getField('scriptName'))
$infobox[] = 'Script'.Lang::$colon.$_; $infobox[] = 'Script'.Lang::$colon.$_;
else if ($_ = $npc->getField('aiName'))
$infobox[] = 'AI'.Lang::$colon.$_;
} }
$_nf = function ($num) { return number_format($num, 0, '', '.'); }; $_nf = function ($num) { return number_format($num, 0, '', '.'); };
@@ -298,7 +302,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
// fixup .. either set %s for emotes or dont >.< // fixup .. either set %s for emotes or dont >.<
$text = Util::localizedString($t, 'text'); $text = Util::localizedString($t, 'text');
if (in_array($t['type'], [2, 3, 16, 41]) && strpos($text, '%s') === false) if (in_array($t['type'], [2, 16]) && strpos($text, '%s') === false)
$text = '%s '.$text; $text = '%s '.$text;
$line = array( $line = array(
@@ -367,11 +371,150 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// tab: SAI // tab: SAI
// hmm, how should this loot like // hmm, how should this loot like
// tab: abilities // tab: abilities / tab_controlledabilities (dep: VehicleId)
// for spell in template and smartScripts if set // SMART_SCRIPT_TYPE_CREATURE = 0; SMART_ACTION_CAST = 11; SMART_ACTION_ADD_AURA = 75; SMART_ACTION_INVOKER_CAST = 85; SMART_ACTION_CROSS_CAST = 86
$smartSpells = DB::Aowow()->selectCol('SELECT action_param1 FROM smart_scripts WHERE source_type = 0 AND action_type IN (11, 75, 85, 86) AND entryOrGUID = ?d', $_id);
$tplSpells = [];
$conditions = [['id', $smartSpells]];
for ($i = 1; $i < 9; $i++)
if ($_ = $npc->getField('spell'.$i))
$tplSpells[] = $_;
if ($tplSpells)
{
$conditions[] = ['id', $tplSpells];
$conditions[] = 'OR';
}
if ($tplSpells || $smartSpells)
{
$abilities = new SpellList($conditions);
if (!$abilities->error)
{
$abilities->addGlobalsToJScript(Util::$pageTemplate, GLOBALINFO_SELF | GLOBALINFO_RELATED);
$normal = $abilities->getListviewData();
$controled = [];
if ($npc->getField('vehicleId')) // not quite right. All seats should be checked for allowed-to-cast-flag-something
{
foreach ($normal as $id => $values)
{
if (in_array($id, $smartSpells))
continue;
$controled[$id] = $values;
unset($normal[$id]);
}
}
if ($normal)
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $normal,
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_abilities',
'id' => 'abilities'
]
);
if ($controled)
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $controled,
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_controlledabilities',
'id' => 'controlled-abilities'
]
);
}
}
// tab: summoned by
$conditions = array(
'OR',
['AND', ['effect1Id', 28], ['effect1MiscValue', $_id]],
['AND', ['effect2Id', 28], ['effect2MiscValue', $_id]],
['AND', ['effect3Id', 28], ['effect3MiscValue', $_id]]
);
$summoned = new SpellList($conditions);
if (!$summoned->error)
{
$summoned->addGlobalsToJscript(Util::$pageTemplate);
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $summoned->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_summonedby',
'id' => 'summoned-by'
]
);
}
// tab: teaches // tab: teaches
// pet spells, class spells, trade spells if ($npc->getField('npcflag') & NPC_FLAG_TRAINER)
{
$teachQuery = 'SELECT IFNULL(t2.spell, t1.spell) AS ARRAY_KEY, IFNULL(t2.spellcost, t1.spellcost) AS cost, IFNULL(t2.reqskill, t1.reqskill) AS reqSkillId,
IFNULL(t2.reqskillvalue, t1.reqskillvalue) AS reqSkillValue, IFNULL(t2.reqlevel, t1.reqlevel) AS reqLevel
FROM npc_trainer t1 LEFT JOIN npc_trainer t2 ON t2.entry = IF(t1.spell < 0, -t1.spell, null) WHERE t1.entry = ?d';
if ($tSpells = DB::Aowow()->select($teachQuery, $_id))
{
$teaches = new SpellList(array(['id', array_keys($tSpells)]));
if (!$teaches->error)
{
$teaches->addGlobalsToJscript(Util::$pageTemplate, GLOBALINFO_SELF | GLOBALINFO_RELATED);
$data = $teaches->getListviewData();
$extra = [];
foreach ($tSpells as $sId => $train)
{
if (empty($data[$sId]))
continue;
if ($_ = $train['reqSkillId'])
{
Util::$pageTemplate->extendGlobalIds(TYPE_SKILL, $_);
if (!isset($extra[0]))
$extra[0] = 'Listview.extraCols.condition';
$data[$sId]['condition'] = ['type' => TYPE_SKILL, 'typeId' => $_, 'status' => 1, 'reqSkillLvl' => $train['reqSkillValue']];
}
if ($_ = $train['reqLevel'])
{
if (!isset($extra[1]))
$extra[1] = "Listview.funcBox.createSimpleCol('reqLevel', LANG.tooltip_reqlevel, '7%', 'reqLevel')";
$data[$sId]['reqLevel'] = $_;
}
if ($_ = $train['cost'])
$data[$sId]['trainingcost'] = $_;
}
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $data,
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_teaches',
'id' => 'teaches',
'visibleCols' => "$['trainingcost']",
'extraCols' => $extra ? '$['.implode(', ', $extra).']' : null
]
);
}
}
else
Util::$pageTemplate->internalNotice(U_GROUP_EMPLOYEE, 'NPC '.$_id.' is flagged as trainer, but doesn\'t have any spells set');
}
// tab: sells // 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)) 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))
@@ -495,17 +638,15 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
} }
// tab: starts quest (questrelation) // tab: starts quest
if ($starts = DB::Aowow()->selectCol('SELECT quest FROM creature_questrelation WHERE id = ?d', $_id)) $starts = new QuestList(array(['npcStart.id', $_id]));
if (!$starts->error)
{ {
$started = new QuestList(array(['id', $starts])); $starts->addGlobalsToJScript(Util::$pageTemplate);
if (!$started->error)
{
$started->addGlobalsToJScript(Util::$pageTemplate);
$pageData['relTabs'][] = array( $pageData['relTabs'][] = array(
'file' => 'quest', 'file' => 'quest',
'data' => $started->getListviewData(), 'data' => $starts->getListviewData(),
'params' => [ 'params' => [
'tabs' => '$tabsRelated', 'tabs' => '$tabsRelated',
'name' => '$LANG.tab_starts', 'name' => '$LANG.tab_starts',
@@ -513,19 +654,16 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
] ]
); );
} }
}
// tab: ends quest (involvedrelation) // tab: ends quest
if ($ends = DB::Aowow()->selectCol('SELECT quest FROM creature_involvedrelation WHERE id = ?d', $_id)) $ends = new QuestList(array(['npcEnd.id', $_id]));
if (!$ends->error)
{ {
$ended = new QuestList(array(['id', $ends])); $ends->addGlobalsToJScript(Util::$pageTemplate);
if (!$ended->error)
{
$ended->addGlobalsToJScript(Util::$pageTemplate);
$pageData['relTabs'][] = array( $pageData['relTabs'][] = array(
'file' => 'quest', 'file' => 'quest',
'data' => $ended->getListviewData(), 'data' => $ends->getListviewData(),
'params' => [ 'params' => [
'tabs' => '$tabsRelated', 'tabs' => '$tabsRelated',
'name' => '$LANG.tab_ends', 'name' => '$LANG.tab_ends',
@@ -533,7 +671,6 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
] ]
); );
} }
}
// tab: objective of quest // tab: objective of quest
$conditions = array( $conditions = array(

View File

@@ -7,6 +7,7 @@ if (!defined('AOWOW_REVISION'))
require 'includes/community.class.php'; require 'includes/community.class.php';
$_id = intVal($pageParam); $_id = intVal($pageParam);
$_path = [0, 5];
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_OBJECT, $_id, -1, User::$localeId]); $cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_OBJECT, $_id, -1, User::$localeId]);
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_OBJECT, $_id, -1, User::$localeId]); $cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_OBJECT, $_id, -1, User::$localeId]);
@@ -20,7 +21,7 @@ if (isset($_GET['power']))
if (!$smarty->loadCache($cacheKeyTooltip, $x)) if (!$smarty->loadCache($cacheKeyTooltip, $x))
{ {
$object = new GameObjectList(array(['entry', $_id])); $object = new GameObjectList(array(['id', $_id]));
if ($object->error) if ($object->error)
die('$WowheadPower.registerObject('.$_id.', '.User::$localeId.', {});'); die('$WowheadPower.registerObject('.$_id.', '.User::$localeId.', {});');
@@ -41,34 +42,169 @@ if (isset($_GET['power']))
// regular page // regular page
if (!$smarty->loadCache($cacheKeyPage, $pageData)) if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$object = new GameObjectList(array(['entry', $_id])); $object = new GameObjectList(array(['id', $_id]));
if ($object->error) if ($object->error)
$smarty->notFound(Lang::$game['gameObject'], $_id); $smarty->notFound(Lang::$game['gameObject'], $_id);
/* $_path[] = $object->getField('typeCat');
ListView for fishing holes
id:'fished-in',
hiddenCols:['instancetype', 'level', 'territory', 'category'],
extraCols:[{if $percent}Listview.extraCols.percent{/if}],
sort:['-percent', 'name'],
/* NOTE
much like items GOs should have difficulty versions of itself, that are spawned for bosses, but this data is mostly contained in scripts
also certain chests/caches/ect should be linked to their boss mob
all of this has to be done manually
*/ */
// NYI -> die() /***********/
$smarty->error(); /* Infobox */
/***********/
$infobox = [];
// Reaction
$_ = function ($r)
{
if ($r == 1) return 2;
if ($r == -1) return 10;
return;
};
$infobox[] = Lang::$npc['react'].Lang::$colon.'[color=q'.$_($object->getField('A')).']A[/color] [color=q'.$_($object->getField('H')).']H[/color]';
// reqSkill
switch ($object->getField('typeCat'))
{
case -3: // Herbalism
$infobox[] = sprintf(Lang::$game['requires'], Lang::$spell['lockType'][2].' ('.$object->getField('reqSkill').')');
break;
case -4: // Mining
$infobox[] = sprintf(Lang::$game['requires'], Lang::$spell['lockType'][3].' ('.$object->getField('reqSkill').')');
break;
case -5: // Lockpicking
$infobox[] = sprintf(Lang::$game['requires'], Lang::$spell['lockType'][1].' ('.$object->getField('reqSkill').')');
break;
default: // requires key .. maybe
{
$locks = Lang::getLocks($object->getField('lockId'));
$l = '';
foreach ($locks as $idx => $_)
{
if ($idx < 0)
continue;
Util::$pageTemplate->extendGlobalIds(TYPE_ITEM, $idx);
$l = Lang::$gameObject['key'].Lang::$colon.'[item='.$idx.']';
}
// if no propper item is found use a skill
if ($locks)
$infobox[] = $l ? $l : array_pop($locks);
}
}
// linked trap
if ($_ = $object->getField('linkedTrap'))
{
Util::$pageTemplate->extendGlobalIds(TYPE_OBJECT, $_);
$infobox[] = Lang::$gameObject['trap'].Lang::$colon.'[object='.$_.']';
}
// trap for
$trigger = new GameObjectList(array(['linkedTrap', $_id]));
if (!$trigger->error)
{
$trigger->addGlobalsToJScript(Util::$pageTemplate);
$infobox[] = Lang::$gameObject['triggeredBy'].Lang::$colon.'[object='.$trigger->id.']';
}
// SpellFocus
if ($_ = $object->getField('spellFocusId'))
$infobox[] = '[tooltip name=focus]'.Lang::$gameObject['focusDesc'].'[/tooltip][span class=tip tooltip=focus]'.Lang::$gameObject['focus'].Lang::$colon.Util::localizedString(DB::Aowow()->selectRow('SELECT * FROM ?_spellFocusObject WHERE id = ?d', $_), 'name').'[/span]';
// lootinfo: [min, max, restock]
if (($_ = $object->getField('lootStack')) && $_[0])
{
$buff = Lang::$item['charges'].Lang::$colon.$_[0];
if ($_[0] < $_[1])
$buff .= Lang::$game['valueDelim'].$_[1];
// since Veins don't have charges anymore, the timer is questionable
$infobox[] = $_[2] > 1 ? '[tooltip name=restock][Recharges every '.Util::formatTime($_[2] * 1000).'][/tooltip][span class=tip tooltip=restock]'.$buff.'[/span]' : $buff;
}
// meeting stone [minLevel, maxLevel, zone]
if ($object->getField('type') == OBJECT_MEETINGSTONE)
{
if ($_ = $object->getField('mStone'))
{
Util::$pageTemplate->extendGlobalIds(TYPE_ZONE, $_[2]);
$m = Lang::$game['meetingStone'].Lang::$colon.'[zone='.$_[2].']';
$l = $_[0];
if ($_[0] > 1 && $_[1] > $_[0])
$l .= Lang::$game['valueDelim'].min($_[1], MAX_LEVEL);
$infobox[] = $l ? '[tooltip name=meetingstone]'.sprintf(Lang::$game['reqLevel'], $l).'[/tooltip][span class=tip tooltip=meetingstone]'.$m.'[/span]' : $m;
}
}
// capture area [minPlayer, maxPlayer, minTime, maxTime, radius]
if ($object->getField('type') == OBJECT_CAPTURE_POINT)
{
if ($_ = $object->getField('capture'))
{
$buff = Lang::$gameObject['capturePoint'];
if ($_[2] > 1 || $_[0])
$buff .= Lang::$colon.'[ul]';
if ($_[2] > 1)
$buff .= '[li]'.Lang::$game['duration'].Lang::$colon.($_[3] > $_[2] ? Util::FormatTime($_[3] * 1000, true).' - ' : null).Util::FormatTime($_[2] * 1000, true).'[/li]';
if ($_[1])
$buff .= '[li]'.Lang::$main['players'].Lang::$colon.$_[0].($_[1] > $_[0] ? ' - '.$_[1] : null).'[/li]';
if ($_[4])
$buff .= '[li]'.sprintf(Lang::$spell['range'], $_[4]).'[/li]';
if ($_[2] > 1 || $_[0])
$buff .= '[/ul]';
}
$infobox[] = $buff;
}
// AI
if (User::isInGroup(U_GROUP_STAFF))
{
if ($_ = $object->getField('ScriptName'))
$infobox[] = 'Script'.Lang::$colon.$_;
else if ($_ = $object->getField('AIName'))
$infobox[] = 'AI'.Lang::$colon.$_;
}
/****************/
/* Main Content */
/****************/
// path(0, 5, $object['type']), // pageText
$pageText = [];
if ($next = $object->getField('pageTextId'))
{
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);
$next = $row['next_page'];
$pageText[] = Util::parseHtmlText(Util::localizedString($row, 'Text'));
}
}
// $object['starts'] = array(); // positions
// $object['ends'] = array(); $positions = [];
// array(ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT, ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT), /*
// $object['criteria_of'] = array(); $positions = position($object['entry'], 'gameobject');
// object contains [..]
$object['position'] = position($object['entry'], 'gameobject');
// Исправить type, чтобы подсвечивались event-овые объекты // Исправить type, чтобы подсвечивались event-овые объекты
if ($object['position']) if ($object['position'])
foreach ($object['position'] as $z => $zone) foreach ($object['position'] as $z => $zone)
@@ -79,33 +215,255 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$object['position'][$z]['points'][$p]['type'] = 4; $object['position'][$z]['points'][$p]['type'] = 4;
$object['position'][$z]['points'][$p]['events'] = implode(", ", $names); $object['position'][$z]['points'][$p]['events'] = implode(", ", $names);
} }
*/
// menuId 5: Object g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array(
'page' => array(
'title' => $object->getField('name', true).' - '.Util::ucFirst(Lang::$game['gameObject']),
'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'name' => $object->getField('name', true),
'tab' => 0,
'type' => TYPE_OBJECT,
'typeId' => $_id,
'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null,
'pageText' => $pageText,
'positions' => $positions,
'redButtons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => true,
BUTTON_VIEW3D => ['displayId' => $object->getField('displayId'), 'type' => TYPE_OBJECT, 'typeId' => $_id]
),
'reqCSS' => array(
$pageText ? ['path' => 'template/css/Book.css'] : null,
// ['path' => 'template/css/Mapper.css'],
// ['path' => 'template/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6']
),
'reqJS' => array(
$pageText ? 'template/js/Book.js' : null,
// 'template/js/Mapper.js',
'template/js/swfobject.js'
)
),
'relTabs' => []
);
/**************/
/* Extra Tabs */
/**************/
// tab: summoned by
$conditions = array(
'OR',
['AND', ['effect1Id', [50, 76, 104, 105, 106, 107]], ['effect1MiscValue', $_id]],
['AND', ['effect2Id', [50, 76, 104, 105, 106, 107]], ['effect2MiscValue', $_id]],
['AND', ['effect3Id', [50, 76, 104, 105, 106, 107]], ['effect3MiscValue', $_id]]
);
$summons = new SpellList($conditions);
if (!$summons->error)
{
$summons->addGlobalsToJScript($smarty, GLOBALINFO_SELF | GLOBALINFO_RELATED);
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $summons->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'id' => 'summoned-by',
'name' => '$LANG.tab_summonedby'
]
);
}
// tab: related spells
if ($_ = $object->getField('spells'))
{
$relSpells = new SpellList(array(['id', $_]));
if (!$relSpells->error)
{
$relSpells->addGlobalsToJScript($smarty, GLOBALINFO_SELF | GLOBALINFO_RELATED);
$data = $relSpells->getListviewData();
foreach ($data as $relId => $d)
$data[$relId]['trigger'] = array_search($relId, $_);
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $data,
'params' => [
'tabs' => '$tabsRelated',
'id' => 'spells',
'name' => '$LANG.tab_spells',
'hiddenCols' => "$['skill']",
'extraCols' => "$[Listview.funcBox.createSimpleCol('trigger', 'Condition', '10%', 'trigger')]"
]
);
}
}
// tab: criteria of
$acvs = new AchievementList(array(['ac.type', [ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT, ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT]], ['ac.value1', $_id]));
if (!$acvs->error)
{
$acvs->addGlobalsToJScript($smarty, GLOBALINFO_SELF | GLOBALINFO_RELATED);
$pageData['relTabs'][] = array(
'file' => 'achievement',
'data' => $acvs->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'id' => 'criteria-of',
'name' => '$LANG.tab_criteriaof'
]
);
}
// tab: starts
$started = new QuestList(array(['goStart.id', $_id]));
if (!$started->error)
{
$started->addGlobalsToJScript(Util::$pageTemplate);
$pageData['relTabs'][] = array(
'file' => 'quest',
'data' => $started->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_starts',
'id' => 'starts'
]
);
}
// tab: ends
$ends = new QuestList(array(['goEnd.id', $_id]));
if (!$ends->error)
{
$ends->addGlobalsToJScript(Util::$pageTemplate);
$pageData['relTabs'][] = array(
'file' => 'quest',
'data' => $ends->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_ends',
'id' => 'ends'
]
);
}
// tab: related quests
if ($_ = $object->getField('reqQuest'))
{
$relQuest = new QuestList(array(['id', $_]));
if (!$relQuest->error)
{
$relQuest->addGlobalsToJScript(Util::$pageTemplate);
$pageData['relTabs'][] = array(
'file' => 'quest',
'data' => $relQuest->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_quests',
'id' => 'quests'
]
);
}
}
// tab: contains
$reqQuest = [];
if ($_ = $object->getField('lootId'))
{
if ($itemLoot = Util::handleLoot(LOOT_GAMEOBJECT, $_, User::isInGroup(U_GROUP_STAFF), $extraCols))
{
$hiddenCols = ['source', 'side', 'slot', 'reqlevel'];
foreach ($itemLoot as $l => $lv)
{
if (!empty($hiddenCols))
foreach ($hiddenCols as $k => $str)
if (!empty($lv[$str]))
unset($hiddenCols[$k]);
if (!$lv['quest'])
continue;
$extraCols[] = 'Listview.extraCols.condition';
$reqQuest[$lv['id']] = 0;
$itemLoot[$l]['condition'] = ['type' => TYPE_QUEST, 'typeId' => &$reqQuest[$lv['id']], 'status' => 1];
}
$extraCols[] = 'Listview.extraCols.percent';
$pageData['relTabs'][] = array(
'file' => 'item',
'data' => $itemLoot,
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_contains',
'id' => 'contains',
'extraCols' => "$[".implode(', ', array_unique($extraCols))."]",
'hiddenCols' => $hiddenCols ? '$'.json_encode(array_values($hiddenCols)) : null
]
);
}
}
if ($reqIds = array_keys($reqQuest)) // apply quest-conditions as back-reference
{
$conditions = array(
'OR',
['requiredSourceItemId1', $reqIds], ['requiredSourceItemId2', $reqIds],
['requiredSourceItemId3', $reqIds], ['requiredSourceItemId4', $reqIds],
['requiredItemId1', $reqIds], ['requiredItemId2', $reqIds], ['requiredItemId3', $reqIds],
['requiredItemId4', $reqIds], ['requiredItemId5', $reqIds], ['requiredItemId6', $reqIds]
);
$reqQuests = new QuestList($conditions);
$reqQuests->addGlobalsToJscript($smarty);
foreach ($reqQuests->iterate() as $qId => $__)
{
if (empty($reqQuests->requires[$qId][TYPE_ITEM]))
continue;
foreach ($reqIds as $rId)
if (in_array($rId, $reqQuests->requires[$qId][TYPE_ITEM]))
$reqQuest[$rId] = $reqQuests->id;
}
}
// tab: Same model as .. whats the fucking point..?
$sameModel = new GameObjectList(array(['displayId', $object->getField('displayId')], ['id', $_id, '!']));
if (!$sameModel->error)
{
$sameModel->addGlobalsToJScript(Util::$pageTemplate);
$pageData['relTabs'][] = array(
'file' => 'object',
'data' => $sameModel->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'name' => '$LANG.tab_samemodelas',
'id' => 'same-model-as'
]
);
}
$smarty->saveCache($cacheKeyPage, $pageData); $smarty->saveCache($cacheKeyPage, $pageData);
} }
// menuId 5: Object g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => $pageData['title'].' - '.Util::ucFirst(Lang::$game['gameObject']),
'path' => $pageData['path'],
'tab' => 0,
'type' => TYPE_OBJECT,
'typeId' => $_id,
'reqCSS' => array(
$object['pageText'] ? ['path' => 'template/css/Book.css'] : null,
['path' => 'template/css/Mapper.css'],
['path' => 'template/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6']
),
'reqJS' => array(
$object['pageText'] ? 'template/js/Book.js' : null,
'template/js/Mapper.js'
)
));
$smarty->assign('community', CommunityContent::getAll(TYPE_OBJECT, $_id)); // comments, screenshots, videos $smarty->assign('community', CommunityContent::getAll(TYPE_OBJECT, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$object, ['colon' => Lang::$colon])); $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$item, Lang::$gameObject, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['relTabs']);
// load the page // load the page
$smarty->display('object.tpl'); $smarty->display('object.tpl');

View File

@@ -4,78 +4,77 @@ if (!defined('AOWOW_REVISION'))
die('illegal access'); die('illegal access');
$cat = Util::extractURLParams($pageParam)[0]; $filter = [];
$conditions = [];
$cat = Util::extractURLParams($pageParam);
$path = [0, 5]; $path = [0, 5];
$validCats = [-2, -3, -4, -5, 3, 9]; $validCats = [-2, -3, -4, -5, -6, 0, 3, 9, 25];
$title = [Util::ucFirst(Lang::$game['gameObjects'])]; $title = [Util::ucFirst(Lang::$game['gameObjects'])];
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_OBJECT, -1, isset($cat) ? $cat : -1, User::$localeId]); $cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_OBJECT, -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];
// array_unshift($title, Lang::$object['cat'][$cat]); array_unshift($title, Lang::$gameObject['cat'][$cat[0]]);
$conditions[] = ['typeCat', (int)$cat[0]];
} }
if (!$smarty->loadCache($cacheKey, $pageData)) if (!$smarty->loadCache($cacheKey, $pageData, $filter))
{ {
$objects = new GameObjectList($conditions, true);
// menuId 5: Object g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'listviews' => [] 'page' => array(
'tab' => 0,
'title' => implode(" - ", $title),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'subCat' => $pageParam ? '='.$pageParam : '',
'reqJS' => ['template/js/filters.js']
),
'lv' => []
); );
$conditions = []; // recreate form selection
$filter = array_merge($objects->filterGetForm('form'), $filter);
if ($cat == -3) $filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
{ $filter['fi'] = $objects->filterGetForm();
$conditions[] = ['type', 3];
$conditions[] = ['l.properties1', LOCK_PROPERTY_HERBALISM];
}
else if ($cat == -4)
{
$conditions[] = ['type', 3];
$conditions[] = ['l.properties1', LOCK_PROPERTY_MINING];
}
else if ($cat == -5)
{
$conditions[] = ['type', 3];
$conditions[] = ['l.properties2', LOCK_PROPERTY_FOOTLOCKER];
}
else
$conditions[] = ['type', (int)$cat]; // quest not supported
$objects = new GameObjectList($conditions);
$params = []; $params = [];
if ($objects->hasSetFields(['reqSkill'])) if ($objects->hasSetFields(['reqSkill']))
$params['visibleCols'] = "$['skill']"; $params['visibleCols'] = "$['skill']";
$pageData['listviews'][] = array( $lv = array(
'file' => 'object', 'file' => 'object',
'data' => $objects->getListviewData(), 'data' => $objects->getListviewData(),
'params' => $params 'params' => $params
); );
// create note if search limit was exceeded
if ($objects->getMatches() > SQL_LIMIT_DEFAULT)
$objects->addGlobalsToJscript($smarty); {
$lv['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_objectsfound', $objects->getMatches(), SQL_LIMIT_DEFAULT);
$smarty->saveCache($cacheKey, $pageData); $lv['params']['_truncated'] = 1;
} }
// menuId 5: Object g_initPath() if ($objects->filterGetError())
// tabId 0: Database g_initHeader() $lv['params']['_errors'] = '$1';
$smarty->updatePageVars(array(
'tab' => 0, $pageData['lv'] = $lv;
'title' => implode(" - ", $title),
'path' => "[".implode(", ", $path)."]" $smarty->saveCache($cacheKey, $pageData, $filter);
)); }
$smarty->assign('lang', Lang::$main);
$smarty->assign('lvData', $pageData); $smarty->updatePageVars($pageData['page']);
$smarty->assign('filter', $filter);
$smarty->assign('lang', array_merge(Lang::$main, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData['lv']);
// load the page // load the page
// $smarty->display('objects.tpl'); $smarty->display('objects.tpl');
$smarty->display('generic-no-filter.tpl');
?> ?>

View File

@@ -198,7 +198,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$smarty->updatePageVars($pageData['page']); $smarty->updatePageVars($pageData['page']);
$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['relTabs']);
// load the page // load the page
$smarty->display('detail-page-generic.tpl'); $smarty->display('detail-page-generic.tpl');

View File

@@ -7,6 +7,7 @@ if (!defined('AOWOW_REVISION'))
require 'includes/community.class.php'; require 'includes/community.class.php';
$_id = intVal($pageParam); $_id = intVal($pageParam);
$_path = [0, 14];
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_SKILL, $_id, -1, User::$localeId]); $cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_SKILL, $_id, -1, User::$localeId]);
@@ -18,33 +19,38 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$_cat = $skill->getField('typeCat'); $_cat = $skill->getField('typeCat');
$_path[] = (in_array($_cat, [9, 11]) || $_id == 762) ? $_id : $_cat;
/****************/ /****************/
/* Main Content */ /* Main Content */
/****************/ /****************/
// menuId 14: Skill g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'title' => $skill->getField('name', true), 'page' => array(
'path' => [0, 14], 'title' => $skill->getField('name', true)." - ".Util::ucfirst(Lang::$game['skill']),
'relTabs' => [], 'name' => $skill->getField('name', true),
'icons' => [$skill->getField('iconString')], 'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'buttons' => array( 'tab' => 0,
'type' => TYPE_SKILL,
'typeId' => $_id,
'headIcons' => [$skill->getField('iconString')],
'redButtons' => array(
BUTTON_WOWHEAD => true, BUTTON_WOWHEAD => true,
BUTTON_LINKS => true BUTTON_LINKS => true
)
), ),
'page' => array( 'relTabs' => []
'name' => $skill->getField('name', true),
'id' => $_id
),
); );
$pageData['path'][] = (in_array($_cat, [9, 11]) || $_id == 762) ? $_id : $_cat;
/**************/ /**************/
/* Extra Tabs */ /* Extra Tabs */
/**************/ /**************/
if (in_array($_cat, [-5, 9, 11])) if (in_array($_cat, [-5, 9, 11]))
{ {
// tab: recipes [spells] (crafted)
$condition = array( $condition = array(
['OR', ['s.reagent1', 0, '>'], ['s.reagent2', 0, '>'], ['s.reagent3', 0, '>'], ['s.reagent4', 0, '>'], ['s.reagent5', 0, '>'], ['s.reagent6', 0, '>'], ['s.reagent7', 0, '>'], ['s.reagent8', 0, '>']], ['OR', ['s.reagent1', 0, '>'], ['s.reagent2', 0, '>'], ['s.reagent3', 0, '>'], ['s.reagent4', 0, '>'], ['s.reagent5', 0, '>'], ['s.reagent6', 0, '>'], ['s.reagent7', 0, '>'], ['s.reagent8', 0, '>']],
['OR', ['s.skillLine1', $_id], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $_id]]], ['OR', ['s.skillLine1', $_id], ['AND', ['s.skillLine1', 0, '>'], ['s.skillLine2OrMask', $_id]]],
@@ -54,7 +60,6 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$recipes = new SpellList($condition); // also relevant for 3 $recipes = new SpellList($condition); // also relevant for 3
if (!$recipes->error) if (!$recipes->error)
{ {
// 1 recipes [spells] (crafted)
$recipes->addGlobalsToJscript($smarty, GLOBALINFO_SELF | GLOBALINFO_RELATED); $recipes->addGlobalsToJscript($smarty, GLOBALINFO_SELF | GLOBALINFO_RELATED);
$pageData['relTabs'][] = array( $pageData['relTabs'][] = array(
@@ -70,8 +75,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
); );
} }
// 2 recipe Items [items] (Books) // tab: recipe Items [items] (Books)
$skill2Filter = [null, 171, 164, 185, 333, 202, 129, 755, 165, 186, 197, null, null, 356, 182, 773]; $filterRecipe = [null, 165, 197, 202, 164, 185, 171, 129, 333, 356, 755, 773, 186, 182];
$conditions = array( $conditions = array(
['requiredSkill', $_id], ['requiredSkill', $_id],
['class', ITEM_CLASS_RECIPE], ['class', ITEM_CLASS_RECIPE],
@@ -83,6 +88,9 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$recipeItems->addGlobalsToJscript($smarty, GLOBALINFO_SELF); $recipeItems->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
if ($_ = array_search($_id, $filterRecipe))
$_ = sprintf(Util::$filterResultString, "?items=9.".$_);
$pageData['relTabs'][] = array( $pageData['relTabs'][] = array(
'file' => 'item', 'file' => 'item',
'data' => $recipeItems->getListviewData(), 'data' => $recipeItems->getListviewData(),
@@ -90,12 +98,13 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'id' => 'recipe-items', 'id' => 'recipe-items',
'name' => '$LANG.tab_recipeitems', 'name' => '$LANG.tab_recipeitems',
'tabs' => '$tabsRelated', 'tabs' => '$tabsRelated',
'note' => !empty(array_flip($skill2Filter)[$_id]) ? sprintf(Util::$filterResultString, "?items=9.".array_flip($skill2Filter)[$_id]) : null 'note' => $_
) )
); );
} }
// 3 crafted items [items] // tab: crafted items [items]
$filterItem = [null, 171, 164, 185, 333, 202, 129, 755, 165, 186, 197, null, null, 356, 182, 773];
$created = []; $created = [];
foreach ($recipes->iterate() as $__) foreach ($recipes->iterate() as $__)
if ($idx = $recipes->canCreateItem()) if ($idx = $recipes->canCreateItem())
@@ -109,6 +118,9 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$created->addGlobalsToJscript($smarty, GLOBALINFO_SELF); $created->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
if ($_ = array_search($_id, $filterItem))
$_ = sprintf(Util::$filterResultString, "?items&filter=cr=86;crs=".$_.";crv=0");
$pageData['relTabs'][] = array( $pageData['relTabs'][] = array(
'file' => 'item', 'file' => 'item',
'data' => $created->getListviewData(), 'data' => $created->getListviewData(),
@@ -116,13 +128,13 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'id' => 'crafted-items', 'id' => 'crafted-items',
'name' => '$LANG.tab_crafteditems', 'name' => '$LANG.tab_crafteditems',
'tabs' => '$tabsRelated', 'tabs' => '$tabsRelated',
// 'note' => sprintf(Util::$filterResultString, "?items&filter=cr=86;crs=6;crv=0") // todo (med): after items; [craftedbyProfession (name)] 'note' => $_
) )
); );
} }
} }
// 4a required by [item] // tab: required by [item]
$conditions = array( $conditions = array(
['requiredSkill', $_id], ['requiredSkill', $_id],
['class', ITEM_CLASS_RECIPE, '!'], ['class', ITEM_CLASS_RECIPE, '!'],
@@ -134,6 +146,9 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
{ {
$reqBy->addGlobalsToJscript($smarty, GLOBALINFO_SELF); $reqBy->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
if ($_ = array_search($_id, $filterItem))
$_ = sprintf(Util::$filterResultString, "?items&filter=cr=99:168;crs=".$_.":2;crv=0:0");
$pageData['relTabs'][] = array( $pageData['relTabs'][] = array(
'file' => 'item', 'file' => 'item',
'data' => $reqBy->getListviewData(), 'data' => $reqBy->getListviewData(),
@@ -141,12 +156,12 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'id' => 'required-by', 'id' => 'required-by',
'name' => '$LANG.tab_requiredby', 'name' => '$LANG.tab_requiredby',
'tabs' => '$tabsRelated', 'tabs' => '$tabsRelated',
// 'note' => sprintf(Util::$filterResultString, "?items&filter=cr=99:168;crs=6:2;crv=0:0") // todo (med): after items; [requiresProfession (yes), teachesSpell (no)] 'note' => $_
) )
); );
} }
// 4b required by [itemset] // tab: required by [itemset]
$conditions = array( $conditions = array(
['skillId', $_id], ['skillId', $_id],
0 0
@@ -169,7 +184,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
} }
// 5 spells [spells] (exclude first tab) // tab: spells [spells] (exclude first tab)
$reqClass = 0x0; $reqClass = 0x0;
$reqRace = 0x0; $reqRace = 0x0;
$condition = array( $condition = array(
@@ -223,7 +238,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
} }
// 6 trainers [npcs] // tab: trainers [npcs]
if (in_array($_cat, [-5, 6, 7, 8, 9, 11])) if (in_array($_cat, [-5, 6, 7, 8, 9, 11]))
{ {
$list = []; $list = [];
@@ -268,7 +283,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
} }
// 7 quests [quests] // tab: quests [quests]
if (in_array($_cat, [9, 11])) // only for professions if (in_array($_cat, [9, 11])) // only for professions
{ {
$sort = 0; $sort = 0;
@@ -304,7 +319,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
} }
// 8 related classes (apply classes from 5) // tab: related classes (apply classes from [itemset])
$class = []; $class = [];
for ($i = 0; $i < 11; $i++) for ($i = 0; $i < 11; $i++)
if ($reqClass & (1 << $i)) if ($reqClass & (1 << $i))
@@ -325,7 +340,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
} }
// 9 related races (apply races from 5) // tab: related races (apply races from [itemset])
$race = []; $race = [];
for ($i = 0; $i < 12; $i++) for ($i = 0; $i < 12; $i++)
if ($reqRace & (1 << $i)) if ($reqRace & (1 << $i))
@@ -349,19 +364,10 @@ 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_SKILL,
'typeId' => $_id
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_SKILL, $_id)); // comments, screenshots, videos $smarty->assign('community', CommunityContent::getAll(TYPE_SKILL, $_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('detail-page-generic.tpl'); $smarty->display('detail-page-generic.tpl');

View File

@@ -4,11 +4,11 @@ if (!defined('AOWOW_REVISION'))
die('illegal access'); die('illegal access');
$cat = Util::extractURLParams($pageParam)[0]; $cat = Util::extractURLParams($pageParam);
$path = [0, 14]; $path = [0, 14];
$title = [Util::ucFirst(Lang::$game['skills'])]; $title = [Util::ucFirst(Lang::$game['skills'])];
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_SKILL, -1, $cat ? $cat : -1, User::$localeId]); $cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_SKILL, -1, $cat ? $cat[0] : -1, User::$localeId]);
$validCats = [-6, -5, -4, 6, 8, 9, 10, 11]; $validCats = [-6, -5, -4, 6, 7, 8, 9, 10, 11];
if (!Util::isValidPage($validCats, $cat)) if (!Util::isValidPage($validCats, $cat))
$smarty->error(); $smarty->error();
@@ -18,17 +18,22 @@ if (!$smarty->loadCache($cacheKey, $pageData))
$conditions = [['categoryId', 12, '!']]; // DND $conditions = [['categoryId', 12, '!']]; // DND
if ($cat) if ($cat)
{ {
$conditions[] = ['typeCat', $cat]; $conditions[] = ['typeCat', $cat[0]];
$path[] = $cat; $path[] = $cat[0];
array_unshift($title, Lang::$skill['cat'][$cat]); array_unshift($title, Lang::$skill['cat'][$cat[0]]);
} }
$skills = new SkillList($conditions); $skills = new SkillList($conditions);
// menuId 14: Skill 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' => 'skill', 'file' => 'skill',
'data' => $skills->getListviewData(), 'data' => $skills->getListviewData(),
@@ -41,15 +46,9 @@ if (!$smarty->loadCache($cacheKey, $pageData))
} }
// menuId 14: Skill 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('list-page-generic.tpl'); $smarty->display('list-page-generic.tpl');

View File

@@ -179,7 +179,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
if ($_ = $spell->getField('spellFocusObject')) // spellFocus if ($_ = $spell->getField('spellFocusObject')) // spellFocus
{ {
$bar = DB::Aowow()->selectRow('SELECT * FROM ?_spellFocusObject WHERE id = ?d', $_); $bar = DB::Aowow()->selectRow('SELECT * FROM ?_spellFocusObject WHERE id = ?d', $_);
$focus = new GameObjectList(array(['type', 8], ['data0', $_], 1)); $focus = new GameObjectList(array(['spellFocusId', $_], 1));
$infobox[] = '[li]'.Lang::$game['requires2'].' '.($focus->error ? Util::localizedString($bar, 'name') : '[url=?object='.$focus->id.']'.Util::localizedString($bar, 'name').'[/url]').'[/li]'; $infobox[] = '[li]'.Lang::$game['requires2'].' '.($focus->error ? Util::localizedString($bar, 'name') : '[url=?object='.$focus->id.']'.Util::localizedString($bar, 'name').'[/url]').'[/li]';
} }
@@ -399,25 +399,31 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
array_unshift($reagentResult, null); array_unshift($reagentResult, null);
unset($reagentResult[0]); unset($reagentResult[0]);
// menuId 1: Spell g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array( $pageData = array(
'title' => $spell->getField('name', true), 'page' => array(
'title' => $spell->getField('name', true).' - '.Util::ucFirst(Lang::$game['spell']),
'path' => json_encode($_path, JSON_NUMERIC_CHECK), 'path' => json_encode($_path, JSON_NUMERIC_CHECK),
'infobox' => $infobox, 'tab' => 0,
'relTabs' => [], 'type' => TYPE_SPELL,
'buttons' => array( 'typeId' => $_id,
'reqJS' => array(
$pageData['buttons'][BUTTON_VIEW3D] ? 'template/js/swfobject.js' : null
),
'redButtons' => array(
BUTTON_LINKS => ['color' => 'ff71d5ff', 'linkId' => Util::$typeStrings[TYPE_SPELL].':'.$_id], BUTTON_LINKS => ['color' => 'ff71d5ff', 'linkId' => Util::$typeStrings[TYPE_SPELL].':'.$_id],
BUTTON_VIEW3D => false, BUTTON_VIEW3D => false,
BUTTON_WOWHEAD => true BUTTON_WOWHEAD => true
), ),
'page' => array( 'infobox' => $infobox,
'scaling' => '', 'scaling' => '',
'powerCost' => $spell->createPowerCostForCurrent(), 'powerCost' => $spell->createPowerCostForCurrent(),
'castTime' => $spell->createCastTimeForCurrent(false, false), 'castTime' => $spell->createCastTimeForCurrent(false, false),
'tools' => $spell->getToolsForCurrent(), 'tools' => $spell->getToolsForCurrent(),
'reagents' => [$enhanced, $reagentResult], 'reagents' => [$enhanced, $reagentResult],
'name' => $spell->getField('name', true), 'name' => $spell->getField('name', true),
'icon' => $spell->getField('iconString'), 'headIcons' => [$spell->getField('iconString'), $spell->getField('stackAmount')],
'stack' => $spell->getField('stackAmount'),
'level' => $spell->getField('spellLevel'), 'level' => $spell->getField('spellLevel'),
'rangeName' => $spell->getField('rangeText', true), 'rangeName' => $spell->getField('rangeText', true),
'range' => $spell->getField('rangeMaxHostile'), 'range' => $spell->getField('rangeMaxHostile'),
@@ -426,7 +432,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'school' => User::isInGroup(U_GROUP_STAFF) ? sprintf(Util::$dfnString, Util::asHex($spell->getField('schoolMask')), Lang::getMagicSchools($spell->getField('schoolMask'))) : Lang::getMagicSchools($spell->getField('schoolMask')), 'school' => User::isInGroup(U_GROUP_STAFF) ? sprintf(Util::$dfnString, Util::asHex($spell->getField('schoolMask')), Lang::getMagicSchools($spell->getField('schoolMask'))) : Lang::getMagicSchools($spell->getField('schoolMask')),
'dispel' => Lang::$game['dt'][$spell->getField('dispelType')], 'dispel' => Lang::$game['dt'][$spell->getField('dispelType')],
'mechanic' => Lang::$game['me'][$spell->getField('mechanic')], 'mechanic' => Lang::$game['me'][$spell->getField('mechanic')],
) ),
'relTabs' => []
); );
if ($spell->getField('attributes2') & 0x80000) if ($spell->getField('attributes2') & 0x80000)
@@ -706,11 +713,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$foo['name'] .= Lang::$colon.Util::ucFirst(Lang::$game['quest']).' #'.$effMV;; $foo['name'] .= Lang::$colon.Util::ucFirst(Lang::$game['quest']).' #'.$effMV;;
break; break;
case 28: // Summon case 28: // Summon
case 75: // Summon Totem case 90: // Kill Credit
case 87: // Summon Totem (slot 1)
case 88: // Summon Totem (slot 2)
case 89: // Summon Totem (slot 3)
case 90: // Summon Totem (slot 4)
$_ = Lang::$game['npc'].' #'.$effMV; $_ = Lang::$game['npc'].' #'.$effMV;
$summon = new CreatureList(array(['ct.id', $effMV])); $summon = new CreatureList(array(['ct.id', $effMV]));
if (!$summon->error) if (!$summon->error)
@@ -759,18 +762,17 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
break; break;
case 50: // Trans Door case 50: // Trans Door
case 76: // Summon Object (Wild) case 76: // Summon Object (Wild)
case 86: // Activate Object // case 86: // Activate Object
case 104: // Summon Object (slot 1) case 104: // Summon Object (slot 1)
case 105: // Summon Object (slot 2) case 105: // Summon Object (slot 2)
case 106: // Summon Object (slot 3) case 106: // Summon Object (slot 3)
case 107: // Summon Object (slot 4) case 107: // Summon Object (slot 4)
// todo (low): create go/modelviewer-data
$_ = Util::ucFirst(Lang::$game['gameObject']).' #'.$effMV; $_ = Util::ucFirst(Lang::$game['gameObject']).' #'.$effMV;
$n = GameObjectList::getName($effMV); // $summon = new GameObjectList(array(['go.id', $effMV])); $summon = new GameObjectList(array(['o.id', $effMV]));
if ($n/*!$summon->error*/) if (!$summon->error)
{ {
$_ = '(<a href="?object='.$effMV.'">'.$n/*$summon->getField('name', true)*/.'</a>)'; $_ = '(<a href="?object='.$effMV.'">'.$summon->getField('name', true).'</a>)';
//$pageData['buttons'][BUTTON_VIEW3D] = ['type' => TYPE_NPC, 'displayId' => $summon->getRandomModelId()]; $pageData['buttons'][BUTTON_VIEW3D] = ['type' => TYPE_OBJECT, 'displayId' => $summon->getField('displayId')];
} }
$foo['name'] .= Lang::$colon.$_; $foo['name'] .= Lang::$colon.$_;
@@ -894,7 +896,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
); );
if ($st['creatureType'] > 0) if ($st['creatureType'] > 0)
$pageData['infobox'][] = '[li]'.Lang::$game['type'].Lang::$colon.Lang::$game['ct'][$st['creatureType']].'[/li]'; $pageData['page']['infobox'][] = '[li]'.Lang::$game['type'].Lang::$colon.Lang::$game['ct'][$st['creatureType']].'[/li]';
if ($_ = Util::localizedString($st, 'name')) if ($_ = Util::localizedString($st, 'name'))
$bar = User::isInGroup(U_GROUP_STAFF) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$colon.$effMV, $_) : $_; $bar = User::isInGroup(U_GROUP_STAFF) ? sprintf(Util::$dfnString, Lang::$spell['_value'].Lang::$colon.$effMV, $_) : $_;
@@ -1070,7 +1072,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
unset($foo['value']); unset($foo['value']);
} }
$pageData['infobox'] = !empty($pageData['infobox']) ? '[ul]'.implode('', $pageData['infobox']).'[/ul]' : null; $pageData['page']['infobox'] = !empty($pageData['page']['infobox']) ? '[ul]'.implode('', $pageData['page']['infobox']).'[/ul]' : null;
unset($foo); // clear reference unset($foo); // clear reference
@@ -1315,6 +1317,30 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$ubItems->addGlobalsToJScript($smarty, GLOBALINFO_SELF); $ubItems->addGlobalsToJScript($smarty, GLOBALINFO_SELF);
} }
// tab: used by - object
$conditions = array(
'OR',
['onUseSpell', $spell->id], ['onSuccessSpell', $spell->id],
['auraSpell', $spell->id], ['triggeredSpell', $spell->id]
);
$ubObjects = new GameObjectList($conditions);
if (!$ubObjects->error)
{
$pageData['relTabs'][] = array(
'file' => 'object',
'data' => $ubObjects->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'id' => 'used-by-object',
'name' => '$LANG.tab_usedby'
]
);
$ubObjects->addGlobalsToJScript($smarty);
}
// tab: criteria of
$conditions = array( $conditions = array(
['ac.type', [ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, ['ac.type', [ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL,
ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2, ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL] ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2, ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL]
@@ -1728,22 +1754,10 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
// menuId 1: Spell g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => $pageData['title'].' - '.Util::ucFirst(Lang::$game['spell']),
'path' => $pageData['path'],
'tab' => 0,
'type' => TYPE_SPELL,
'typeId' => $_id,
'reqJS' => array(
$pageData['buttons'][BUTTON_VIEW3D] ? 'template/js/swfobject.js' : null
)
));
$smarty->assign('redButtons', $pageData['buttons']);
$smarty->assign('community', CommunityContent::getAll(TYPE_SPELL, $_id)); // comments, screenshots, videos $smarty->assign('community', CommunityContent::getAll(TYPE_SPELL, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$spell, ['colon' => Lang::$colon])); $smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$spell, ['colon' => Lang::$colon]));
$smarty->assign('lvData', $pageData); $smarty->assign('lvData', $pageData['relTabs']);
// load the page // load the page
$smarty->display('spell.tpl'); $smarty->display('spell.tpl');

View File

@@ -78,9 +78,21 @@ $shortFilter = array(
if (!Util::isValidPage($validCats, $cats)) if (!Util::isValidPage($validCats, $cats))
$smarty->error(); $smarty->error();
if (!$smarty->loadCache($cacheKey, $pageData, $filter))
{
$conditions = [];
$visibleCols = [];
$hiddenCols = [];
$lv = array(
'file' => 'spell',
'data' => [],
'params' => []
);
// reconstruct path & title
$path = array_merge($path, $cats); $path = array_merge($path, $cats);
if (isset($cats)) if ($cats)
{ {
if (isset($cats[1])) if (isset($cats[1]))
array_pop($title); array_pop($title);
@@ -95,21 +107,6 @@ if (isset($cats))
} }
else if ($x !== null) else if ($x !== null)
array_unshift($title, $x); array_unshift($title, $x);
}
if (!$smarty->loadCache($cacheKey, $pageData, $filter))
{
$conditions = [];
$visibleCols = [];
$hiddenCols = [];
$pageData = array(
'page' => [],
'data' => [],
'title' => '',
'path' => '',
'params' => []
);
switch($cats[0]) switch($cats[0])
{ {
@@ -208,10 +205,10 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
break; break;
} }
$pageData['params']['note'] = '$$WH.sprintf(LANG.lvnote_pettalents, "'.$url.'")'; $lv['params']['note'] = '$$WH.sprintf(LANG.lvnote_pettalents, "'.$url.'")';
} }
$pageData['params']['_petTalents'] = 1; // not conviced, this is correct, but .. it works $lv['params']['_petTalents'] = 1; // not conviced, this is correct, but .. it works
break; break;
case -11: // Proficiencies ... the subIds are actually SkillLineCategories case -11: // Proficiencies ... the subIds are actually SkillLineCategories
@@ -316,8 +313,8 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
if (is_array($note)) if (is_array($note))
$note = $note[0]; $note = $note[0];
$pageData['params']['note'] = sprintf(Lang::$spell['relItems']['base'], $txt, $note); $lv['params']['note'] = sprintf(Lang::$spell['relItems']['base'], $txt, $note);
$pageData['params']['sort'] = "$['skill', 'name']"; $lv['params']['sort'] = "$['skill', 'name']";
} }
} }
@@ -364,8 +361,8 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
if (is_array($note)) if (is_array($note))
$note = $note[0]; $note = $note[0];
$pageData['params']['note'] = sprintf(Lang::$spell['relItems']['base'], $txt, $note); $lv['params']['note'] = sprintf(Lang::$spell['relItems']['base'], $txt, $note);
$pageData['params']['sort'] = "$['skill', 'name']"; $lv['params']['sort'] = "$['skill', 'name']";
} }
} }
@@ -384,49 +381,18 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
break; break;
} }
} }
}
$spells = new SpellList($conditions, true); $spells = new SpellList($conditions, true);
$pageData['data'] = $spells->getListviewData();
$spells->addGlobalsToJscript($smarty, GLOBALINFO_SELF | GLOBALINFO_RELATED); $spells->addGlobalsToJscript($smarty, GLOBALINFO_SELF | GLOBALINFO_RELATED);
$lv['data'] = $spells->getListviewData();
// create note if search limit was exceeded; overwriting 'note' is intentional
if ($spells->getMatches() > SQL_LIMIT_DEFAULT)
{
$pageData['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_spellsfound', $spells->getMatches(), SQL_LIMIT_DEFAULT);
$pageData['params']['_truncated'] = 1;
}
if ($spells->filterGetError())
$pageData['params']['_errors'] = '$1';
$mask = $spells->hasSetFields(['reagent1', 'skillLines', 'trainingCost']);
if ($mask & 0x1)
$visibleCols[] = 'reagents';
if (!($mask & 0x2) && $cats[0] != 9 && $cats[0] != 11)
$hiddenCols[] = 'skill';
if (($mask & 0x4) || $spells->getField('trainingCost'))
$visibleCols[] = 'trainingcost';
if ($visibleCols)
$pageData['params']['visibleCols'] = '$'.json_encode($visibleCols);
if ($hiddenCols)
$pageData['params']['hiddenCols'] = '$'.json_encode($hiddenCols);
// recreate form selection // recreate form selection
$filter = array_merge($spells->filterGetForm('form'), $filter); $filter = array_merge($spells->filterGetForm('form'), $filter);
$filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL; $filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
$filter['fi'] = $spells->filterGetForm(); $filter['fi'] = $spells->filterGetForm();
if (!empty($filter['fi']['extraCols']))
$pageData['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
$smarty->saveCache($cacheKey, $pageData, $filter);
}
if (isset($filter['gl']) && !is_array($filter['gl'])) if (isset($filter['gl']) && !is_array($filter['gl']))
{ {
while (count($path) < 4) while (count($path) < 4)
@@ -435,6 +401,52 @@ if (isset($filter['gl']) && !is_array($filter['gl']))
$path[] = $filter['gl']; $path[] = $filter['gl'];
} }
if (!empty($filter['fi']['extraCols']))
$lv['params']['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
// create note if search limit was exceeded; overwriting 'note' is intentional
if ($spells->getMatches() > SQL_LIMIT_DEFAULT)
{
$lv['params']['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_spellsfound', $spells->getMatches(), SQL_LIMIT_DEFAULT);
$lv['params']['_truncated'] = 1;
}
if ($spells->filterGetError())
$lv['params']['_errors'] = '$1';
$mask = $spells->hasSetFields(['reagent1', 'skillLines', 'trainingCost']);
if ($mask & 0x1)
$visibleCols[] = 'reagents';
if (!($mask & 0x2) && $cats && $cats[0] != 9 && $cats[0] != 11)
$hiddenCols[] = 'skill';
if (($mask & 0x4) || $spells->getField('trainingCost'))
$visibleCols[] = 'trainingcost';
if ($visibleCols)
$lv['params']['visibleCols'] = '$'.json_encode($visibleCols);
if ($hiddenCols)
$lv['params']['hiddenCols'] = '$'.json_encode($hiddenCols);
// menuId 1: Spell g_initPath()
// tabId 0: Database g_initHeader()
$pageData = array(
'page' => array(
'title' => implode(" - ", $title),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0,
'subCat' => $pageParam !== null ? '='.$pageParam : '',
'reqJS' => array(
'template/js/filters.js'
)
),
'lv' => $lv
);
$smarty->saveCache($cacheKey, $pageData, $filter);
}
// sort for dropdown-menus // sort for dropdown-menus
asort(Lang::$game['ra']); asort(Lang::$game['ra']);
@@ -442,20 +454,10 @@ asort(Lang::$game['cl']);
asort(Lang::$game['sc']); asort(Lang::$game['sc']);
asort(Lang::$game['me']); asort(Lang::$game['me']);
// menuId 1: Spell g_initPath() $smarty->updatePageVars($pageData['page']);
// tabId 0: Database g_initHeader()
$smarty->updatePageVars(array(
'title' => implode(" - ", $title),
'path' => "[".implode(", ", $path)."]",
'tab' => 0,
'subCat' => $pageParam !== null ? '='.$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('spells.tpl'); $smarty->display('spells.tpl');

View File

@@ -19,31 +19,8 @@ if (!defined('AOWOW_REVISION'))
str[10][4] // type, typeId, param1 (4:quality, 3,6,9,10,17:icon, 5:faction), param2 (3:quality, 6:rank) str[10][4] // type, typeId, param1 (4:quality, 3,6,9,10,17:icon, 5:faction), param2 (3:quality, 6:rank)
] ]
else else
1: Listview - template: 'classs', id: 'classes', name: LANG.tab_classes, => listviews
2: Listview - template: 'race', id: 'races', name: LANG.tab_races,
3: Listview - template: 'title', id: 'titles', name: LANG.tab_titles,
4: Listview - template: 'holiday', id: 'holidays', name: LANG.tab_holidays,
5: Listview - template: 'currency', id: 'currencies', name: LANG.tab_currencies,
6: Listview - template: 'itemset', id: 'itemsets', name: LANG.tab_itemsets,
7: Listview - template: 'item', id: 'items', name: LANG.tab_items,
8: Listview - template: 'spell', id: 'abilities', name: LANG.tab_abilities,
9: Listview - template: 'spell', id: 'talents', name: LANG.tab_talents,
10: Listview - template: 'spell', id: 'glyphs', name: LANG.tab_glyphs,
11: Listview - template: 'spell', id: 'proficiencies', name: LANG.tab_proficiencies,
12: Listview - template: 'spell', id: 'professions', name: LANG.tab_professions,
13: Listview - template: 'spell', id: 'companions', name: LANG.tab_companions,
14: Listview - template: 'spell', id: 'mounts', name: LANG.tab_mounts,
15: Listview - template: 'npc', id: 'npcs', name: LANG.tab_npcs,
16: Listview - template: 'quest', id: 'quests', name: LANG.tab_quests,
17: Listview - template: 'achievement', id: 'achievements', name: LANG.tab_achievements,
18: Listview - template: 'achievement', id: 'statistics', name: LANG.tab_statistics,
19: Listview - template: 'zone', id: 'zones', name: LANG.tab_zones,
20: Listview - template: 'object', id: 'objects', name: LANG.tab_objects,
21: Listview - template: 'faction', id: 'factions', name: LANG.tab_factions,
22: Listview - template: 'skill', id: 'skills', name: LANG.tab_skills,
23: Listview - template: 'pet', id: 'pets', name: LANG.tab_pets,
24: Listview - template: 'spell', id: 'npc-abilities', name: LANG.tab_npcabilities,
25: Listview - template: 'spell', id: 'spells', name: LANG.tab_uncategorizedspells,
todo 26: Listview - template: 'profile', id: 'characters', name: LANG.tab_characters, visibleCols: ['race','classs','level','talents','gearscore','achievementpoints'], todo 26: Listview - template: 'profile', id: 'characters', name: LANG.tab_characters, visibleCols: ['race','classs','level','talents','gearscore','achievementpoints'],
27: Profiles..? 27: Profiles..?
28: Guilds..? 28: Guilds..?
@@ -55,7 +32,7 @@ $query = Util::sqlEscape(str_replace('?', '_', str_replace('*', '%', ($sear
$type = @intVal($_GET['type']); $type = @intVal($_GET['type']);
$searchMask = 0x0; $searchMask = 0x0;
$found = []; $found = [];
$jsGlobals = []; $cndBase = ['AND'];
$maxResults = SQL_LIMIT_SEARCH; $maxResults = SQL_LIMIT_SEARCH;
$_wt = isset($_GET['wt']) ? explode(':', $_GET['wt']) : null; $_wt = isset($_GET['wt']) ? explode(':', $_GET['wt']) : null;
@@ -73,12 +50,17 @@ if (isset($_GET['json']))
} }
else if (isset($_GET['opensearch'])) else if (isset($_GET['opensearch']))
{ {
$maxResults = 10; $maxResults = SQL_LIMIT_QUCKSEARCH;
$searchMask |= SEARCH_TYPE_OPEN | SEARCH_MASK_OPEN; $searchMask |= SEARCH_TYPE_OPEN | SEARCH_MASK_OPEN;
} }
else else
$searchMask |= SEARCH_TYPE_REGULAR | SEARCH_MASK_ALL; $searchMask |= SEARCH_TYPE_REGULAR | SEARCH_MASK_ALL;
$cndBase[] = $maxResults;
// Exclude internal wow stuff
if (!User::isInGroup(U_GROUP_STAFF))
$cndBase[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
$cacheKey = implode('_', [CACHETYPE_SEARCH, $searchMask, sha1($query), User::$localeId]); $cacheKey = implode('_', [CACHETYPE_SEARCH, $searchMask, sha1($query), User::$localeId]);
@@ -111,10 +93,14 @@ if ((strlen($query) < 3 || !($searchMask & SEARCH_MASK_ALL)) && !($searchMask &
} }
} }
// 1 Classes: if (!$smarty->loadCache($cacheKey, $found))
if ($searchMask & 0x1)
{ {
$classes = new CharClassList(array(['name_loc'.User::$localeId, $query], $maxResults)); // 1 Classes:
if ($searchMask & 0x00000001)
{
$cnd = array_merge($cndBase, [['name_loc'.User::$localeId, $query]]);
$classes = new CharClassList($cnd);
if ($data = $classes->getListviewData()) if ($data = $classes->getListviewData())
{ {
@@ -125,7 +111,7 @@ if ($searchMask & 0x1)
'type' => TYPE_CLASS, 'type' => TYPE_CLASS,
'appendix' => ' (Class)', 'appendix' => ' (Class)',
'matches' => $classes->getMatches(), 'matches' => $classes->getMatches(),
'file' => 'class', 'file' => CharClassList::$brickFile,
'data' => $data, 'data' => $data,
'params' => ['tabs' => '$myTabs'] 'params' => ['tabs' => '$myTabs']
); );
@@ -139,7 +125,7 @@ if ($searchMask & 0x1)
} }
// 2 Races: // 2 Races:
if ($searchMask & 0x2) if ($searchMask & 0x00000002)
{ {
/* custom data :( /* custom data :(
faction: dbc-data is internal -> doesn't work how to link to displayable faction..? faction: dbc-data is internal -> doesn't work how to link to displayable faction..?
@@ -147,7 +133,9 @@ if ($searchMask & 0x2)
zone: starting zone... zone: starting zone...
*/ */
$races = new CharRaceList(array(['name_loc'.User::$localeId, $query], $maxResults)); $cnd = array_merge($cndBase, [['name_loc'.User::$localeId, $query]]);
$races = new CharRaceList($cnd);
if ($data = $races->getListviewData()) if ($data = $races->getListviewData())
{ {
@@ -158,7 +146,7 @@ if ($searchMask & 0x2)
'type' => TYPE_RACE, 'type' => TYPE_RACE,
'appendix' => ' (Race)', 'appendix' => ' (Race)',
'matches' => $races->getMatches(), 'matches' => $races->getMatches(),
'file' => 'race', 'file' => CharRaceList::$brickFile,
'data' => $data, 'data' => $data,
'params' => ['tabs' => '$myTabs'] 'params' => ['tabs' => '$myTabs']
); );
@@ -172,7 +160,7 @@ if ($searchMask & 0x2)
} }
// 3 Titles: // 3 Titles:
if ($searchMask & 0x4) if ($searchMask & 0x00000004)
{ {
/* custom data :( /* custom data :(
category:1, // custom data .. FU! category:1, // custom data .. FU!
@@ -188,14 +176,13 @@ if ($searchMask & 0x4)
13 => [] // DB-Text 13 => [] // DB-Text
); );
$conditions = array( $cnd = array_merge($cndBase, array(
'OR', 'OR',
['male_loc'.User::$localeId, $query], ['male_loc'.User::$localeId, $query],
['female_loc'.User::$localeId, $query], ['female_loc'.User::$localeId, $query]
$maxResults ));
);
$titles = new TitleList($conditions); $titles = new TitleList($cnd);
if ($data = $titles->getListviewData()) if ($data = $titles->getListviewData())
{ {
@@ -203,7 +190,7 @@ if ($searchMask & 0x4)
'type' => TYPE_TITLE, 'type' => TYPE_TITLE,
'appendix' => ' (Title)', 'appendix' => ' (Title)',
'matches' => $titles->getMatches(), 'matches' => $titles->getMatches(),
'file' => 'title', 'file' => TitleList::$brickFile,
'data' => $data, 'data' => $data,
'params' => ['tabs' => '$myTabs'] 'params' => ['tabs' => '$myTabs']
); );
@@ -217,20 +204,19 @@ if ($searchMask & 0x4)
} }
// 4 World Events: // 4 World Events:
if ($searchMask & 0x8) if ($searchMask & 0x00000008)
{ {
/* custom data :( /* custom data :(
icons: data/interface/calendar/calendar_[a-z]start.blp icons: data/interface/calendar/calendar_[a-z]start.blp
*/ */
$conditions = array( $cnd = array_merge($cndBase, array(
'OR', 'OR',
['h.name_loc'.User::$localeId, $query], ['h.name_loc'.User::$localeId, $query],
['AND', ['e.description', $query], ['e.holidayId', 0]], ['AND', ['e.description', $query], ['e.holidayId', 0]]
$maxResults ));
);
$wEvents = new WorldEventList($conditions); $wEvents = new WorldEventList($cnd);
if ($data = $wEvents->getListviewData()) if ($data = $wEvents->getListviewData())
{ {
@@ -249,7 +235,7 @@ if ($searchMask & 0x8)
'type' => TYPE_WORLDEVENT, 'type' => TYPE_WORLDEVENT,
'appendix' => ' (World Event)', 'appendix' => ' (World Event)',
'matches' => $wEvents->getMatches(), 'matches' => $wEvents->getMatches(),
'file' => 'event', 'file' => WorldEventList::$brickFile,
'data' => $data, 'data' => $data,
'params' => ['tabs' => '$myTabs'] 'params' => ['tabs' => '$myTabs']
); );
@@ -263,9 +249,11 @@ if ($searchMask & 0x8)
} }
// 5 Currencies // 5 Currencies
if ($searchMask & 0x10) if ($searchMask & 0x0000010)
{ {
$money = new CurrencyList(array($maxResults, ['name_loc'.User::$localeId, $query])); $cnd = array_merge($cndBase, [['name_loc'.User::$localeId, $query]]);
$money = new CurrencyList($cnd);
if ($data = $money->getListviewData()) if ($data = $money->getListviewData())
{ {
@@ -276,7 +264,7 @@ if ($searchMask & 0x10)
'type' => TYPE_CURRENCY, 'type' => TYPE_CURRENCY,
'appendix' => ' (Currency)', 'appendix' => ' (Currency)',
'matches' => $money->getMatches(), 'matches' => $money->getMatches(),
'file' => 'currency', 'file' => CurrencyList::$brickFile,
'data' => $data, 'data' => $data,
'params' => ['tabs' => '$myTabs'] 'params' => ['tabs' => '$myTabs']
); );
@@ -290,15 +278,12 @@ if ($searchMask & 0x10)
} }
// 6 Itemsets // 6 Itemsets
if ($searchMask & 0x20) if ($searchMask & 0x0000020)
{ {
$conditions = array( // ['item1', 0, '!'], // remove empty sets from search, set in cuFlags
['item1', 0, '!'], // remove empty sets from search $cnd = array_merge($cndBase, is_int($query) ? ['id', $query] : ['name_loc'.User::$localeId, $query]);
is_int($query) ? ['id', $query] : ['name_loc'.User::$localeId, $query],
$maxResults
);
$sets = new ItemsetList($conditions); $sets = new ItemsetList($cnd);
if ($data = $sets->getListviewData()) if ($data = $sets->getListviewData())
{ {
@@ -311,7 +296,7 @@ if ($searchMask & 0x20)
'type' => TYPE_ITEMSET, 'type' => TYPE_ITEMSET,
'appendix' => ' (Item Set)', 'appendix' => ' (Item Set)',
'matches' => $sets->getMatches(), 'matches' => $sets->getMatches(),
'file' => 'itemset', 'file' => ItemsetList::$brickFile,
'data' => $data, 'data' => $data,
'params' => ['tabs' => '$myTabs'], 'params' => ['tabs' => '$myTabs'],
'pcsToSet' => $sets->pieceToSet 'pcsToSet' => $sets->pieceToSet
@@ -326,25 +311,25 @@ if ($searchMask & 0x20)
} }
// 7 Items // 7 Items
if ($searchMask & 0x40) if ($searchMask & 0x0000040)
{ {
$miscData = $conditions = []; $miscData = [];
$cnd = is_int($query) ? ['id', $query] : ['name_loc'.User::$localeId, $query]; $cndAdd = is_int($query) ? ['id', $query] : ['name_loc'.User::$localeId, $query];
if (($searchMask & SEARCH_TYPE_JSON) && $type == TYPE_ITEMSET && isset($found['itemset'])) if (($searchMask & SEARCH_TYPE_JSON) && $type == TYPE_ITEMSET && isset($found['itemset']))
{ {
$conditions = [['i.id', array_keys($found['itemset']['pcsToSet'])], SQL_LIMIT_NONE]; $cnd = [['i.id', array_keys($found['itemset']['pcsToSet'])], SQL_LIMIT_NONE];
$miscData = ['pcsToSet' => @$found['itemset']['pcsToSet']]; $miscData = ['pcsToSet' => @$found['itemset']['pcsToSet']];
} }
else if (($searchMask & SEARCH_TYPE_JSON) && $type == TYPE_ITEM) else if (($searchMask & SEARCH_TYPE_JSON) && $type == TYPE_ITEM)
{ {
$conditions = [['i.class', [ITEM_CLASS_WEAPON, ITEM_CLASS_GEM, ITEM_CLASS_ARMOR]], $cnd, SQL_LIMIT_DEFAULT]; $cnd = array_merge($cndBase, [['AND', ['i.class', [ITEM_CLASS_WEAPON, ITEM_CLASS_GEM, ITEM_CLASS_ARMOR]], $cndAdd]]);
$miscData = ['wt' => $_wt, 'wtv' => $_wtv]; $miscData = ['wt' => $_wt, 'wtv' => $_wtv];
} }
else else
$conditions = [$cnd, $maxResults]; $cnd = array_merge($cndBase, [$cndAdd]);
$items = new ItemList($conditions, false, $miscData); $items = new ItemList($cnd, false, $miscData);
if ($data = $items->getListviewData($searchMask & SEARCH_TYPE_JSON ? (ITEMINFO_SUBITEMS | ITEMINFO_JSON) : 0)) if ($data = $items->getListviewData($searchMask & SEARCH_TYPE_JSON ? (ITEMINFO_SUBITEMS | ITEMINFO_JSON) : 0))
{ {
@@ -363,7 +348,7 @@ if ($searchMask & 0x40)
'type' => TYPE_ITEM, 'type' => TYPE_ITEM,
'appendix' => ' (Item)', 'appendix' => ' (Item)',
'matches' => $items->getMatches(), 'matches' => $items->getMatches(),
'file' => 'item', 'file' => ItemList::$brickFile,
'data' => $data, 'data' => $data,
'params' => ['tabs' => '$myTabs'] 'params' => ['tabs' => '$myTabs']
); );
@@ -377,17 +362,17 @@ if ($searchMask & 0x40)
} }
// 8 Abilities (Player + Pet) // 8 Abilities (Player + Pet)
if ($searchMask & 0x80) if ($searchMask & 0x0000080)
{ {
$conditions = array( // hmm, inclued classMounts..? $cnd = array_merge($cndBase, array( // hmm, inclued classMounts..?
'AND',
['s.typeCat', [7, -2, -3]], ['s.typeCat', [7, -2, -3]],
[['s.cuFlags', (SPELL_CU_TRIGGERED | SPELL_CU_TALENT | CUSTOM_EXCLUDE_FOR_LISTVIEW), '&'], 0], [['s.cuFlags', (SPELL_CU_TRIGGERED | SPELL_CU_TALENT), '&'], 0],
[['s.attributes0', 0x80, '&'], 0], [['s.attributes0', 0x80, '&'], 0],
['s.name_loc'.User::$localeId, $query], ['s.name_loc'.User::$localeId, $query]
$maxResults ));
);
$abilities = new SpellList($conditions); $abilities = new SpellList($cnd);
if ($data = $abilities->getListviewData()) if ($data = $abilities->getListviewData())
{ {
@@ -407,7 +392,7 @@ if ($searchMask & 0x80)
'type' => TYPE_SPELL, 'type' => TYPE_SPELL,
'appendix' => ' (Ability)', 'appendix' => ' (Ability)',
'matches' => $abilities->getMatches(), 'matches' => $abilities->getMatches(),
'file' => 'spell', 'file' => SpellList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'id' => 'abilities', 'id' => 'abilities',
@@ -426,15 +411,15 @@ if ($searchMask & 0x80)
} }
// 9 Talents (Player + Pet) // 9 Talents (Player + Pet)
if ($searchMask & 0x100) if ($searchMask & 0x0000100)
{ {
$conditions = array( $cnd = array_merge($cndBase, array(
'AND',
['s.typeCat', [-7, -2]], ['s.typeCat', [-7, -2]],
['s.name_loc'.User::$localeId, $query], ['s.name_loc'.User::$localeId, $query]
$maxResults ));
);
$talents = new SpellList($conditions); $talents = new SpellList($cnd);
if ($data = $talents->getListviewData()) if ($data = $talents->getListviewData())
{ {
@@ -454,7 +439,7 @@ if ($searchMask & 0x100)
'type' => TYPE_SPELL, 'type' => TYPE_SPELL,
'appendix' => ' (Talent)', 'appendix' => ' (Talent)',
'matches' => $talents->getMatches(), 'matches' => $talents->getMatches(),
'file' => 'spell', 'file' => SpellList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'id' => 'talents', 'id' => 'talents',
@@ -473,15 +458,15 @@ if ($searchMask & 0x100)
} }
// 10 Glyphs // 10 Glyphs
if ($searchMask & 0x200) if ($searchMask & 0x0000200)
{ {
$conditions = array( $cnd = array_merge($cndBase, array(
'AND',
['s.typeCat', -13], ['s.typeCat', -13],
['s.name_loc'.User::$localeId, $query], ['s.name_loc'.User::$localeId, $query]
$maxResults ));
);
$glyphs = new SpellList($conditions); $glyphs = new SpellList($cnd);
if ($data = $glyphs->getListviewData()) if ($data = $glyphs->getListviewData())
{ {
@@ -494,7 +479,7 @@ if ($searchMask & 0x200)
'type' => TYPE_SPELL, 'type' => TYPE_SPELL,
'appendix' => ' (Glyph)', 'appendix' => ' (Glyph)',
'matches' => $glyphs->getMatches(), 'matches' => $glyphs->getMatches(),
'file' => 'spell', 'file' => SpellList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'id' => 'glyphs', 'id' => 'glyphs',
@@ -513,15 +498,15 @@ if ($searchMask & 0x200)
} }
// 11 Proficiencies // 11 Proficiencies
if ($searchMask & 0x400) if ($searchMask & 0x0000400)
{ {
$conditions = array( $cnd = array_merge($cndBase, array(
'AND',
['s.typeCat', -11], ['s.typeCat', -11],
['s.name_loc'.User::$localeId, $query], ['s.name_loc'.User::$localeId, $query]
$maxResults ));
);
$prof = new SpellList($conditions); $prof = new SpellList($cnd);
if ($data = $prof->getListviewData()) if ($data = $prof->getListviewData())
{ {
@@ -534,7 +519,7 @@ if ($searchMask & 0x400)
'type' => TYPE_SPELL, 'type' => TYPE_SPELL,
'appendix' => ' (Proficiency)', 'appendix' => ' (Proficiency)',
'matches' => $prof->getMatches(), 'matches' => $prof->getMatches(),
'file' => 'spell', 'file' => SpellList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'id' => 'proficiencies', 'id' => 'proficiencies',
@@ -553,15 +538,15 @@ if ($searchMask & 0x400)
} }
// 12 Professions (Primary + Secondary) // 12 Professions (Primary + Secondary)
if ($searchMask & 0x800) if ($searchMask & 0x0000800)
{ {
$conditions = array( $cnd = array_merge($cndBase, array(
'AND',
['s.typeCat', [9, 11]], ['s.typeCat', [9, 11]],
['s.name_loc'.User::$localeId, $query], ['s.name_loc'.User::$localeId, $query]
$maxResults ));
);
$prof = new SpellList($conditions); $prof = new SpellList($cnd);
if ($data = $prof->getListviewData()) if ($data = $prof->getListviewData())
{ {
@@ -574,7 +559,7 @@ if ($searchMask & 0x800)
'type' => TYPE_SPELL, 'type' => TYPE_SPELL,
'appendix' => ' (Profession)', 'appendix' => ' (Profession)',
'matches' => $prof->getMatches(), 'matches' => $prof->getMatches(),
'file' => 'spell', 'file' => SpellList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'id' => 'professions', 'id' => 'professions',
@@ -593,16 +578,15 @@ if ($searchMask & 0x800)
} }
// 13 Companions // 13 Companions
if ($searchMask & 0x1000) if ($searchMask & 0x0001000)
{ {
$cnd = array_merge($cndBase, array(
$conditions = array( 'AND',
['s.typeCat', -6], ['s.typeCat', -6],
['s.name_loc'.User::$localeId, $query], ['s.name_loc'.User::$localeId, $query]
$maxResults ));
);
$vPets = new SpellList($conditions); $vPets = new SpellList($cnd);
if ($data = $vPets->getListviewData()) if ($data = $vPets->getListviewData())
{ {
@@ -615,7 +599,7 @@ if ($searchMask & 0x1000)
'type' => TYPE_SPELL, 'type' => TYPE_SPELL,
'appendix' => ' (Companion)', 'appendix' => ' (Companion)',
'matches' => $vPets->getMatches(), 'matches' => $vPets->getMatches(),
'file' => 'spell', 'file' => SpellList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'id' => 'companions', 'id' => 'companions',
@@ -634,15 +618,15 @@ if ($searchMask & 0x1000)
} }
// 14 Mounts // 14 Mounts
if ($searchMask & 0x2000) if ($searchMask & 0x0002000)
{ {
$conditions = array( $cnd = array_merge($cndBase, array(
'AND',
['s.typeCat', -5], ['s.typeCat', -5],
['s.name_loc'.User::$localeId, $query], ['s.name_loc'.User::$localeId, $query]
$maxResults ));
);
$mounts = new SpellList($conditions); $mounts = new SpellList($cnd);
if ($data = $mounts->getListviewData()) if ($data = $mounts->getListviewData())
{ {
@@ -655,7 +639,7 @@ if ($searchMask & 0x2000)
'type' => TYPE_SPELL, 'type' => TYPE_SPELL,
'appendix' => ' (Mount)', 'appendix' => ' (Mount)',
'matches' => $mounts->getMatches(), 'matches' => $mounts->getMatches(),
'file' => 'spell', 'file' => SpellList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'id' => 'mounts', 'id' => 'mounts',
@@ -673,18 +657,12 @@ if ($searchMask & 0x2000)
} }
// 15 NPCs // 15 NPCs
if ($searchMask & 0x4000) if ($searchMask & 0x0004000)
{ {
$conditions = array(
[
'OR',
['name_loc'.User::$localeId, $query]
],
// [['cuFlags', MASKE, '&'], 0], // todo (med): exclude trigger creatures and difficulty entries // [['cuFlags', MASKE, '&'], 0], // todo (med): exclude trigger creatures and difficulty entries
$maxResults $cnd = array_merge($cndBase, [['name_loc'.User::$localeId, $query]]);
);
$npcs = new CreatureList($conditions); $npcs = new CreatureList($cnd);
if ($data = $npcs->getListviewData()) if ($data = $npcs->getListviewData())
{ {
@@ -692,7 +670,7 @@ if ($searchMask & 0x4000)
'type' => TYPE_NPC, 'type' => TYPE_NPC,
'appendix' => ' (NPC)', 'appendix' => ' (NPC)',
'matches' => $npcs->getMatches(), 'matches' => $npcs->getMatches(),
'file' => 'creature', 'file' => CreatureList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'id' => 'npcs', 'id' => 'npcs',
@@ -710,15 +688,16 @@ if ($searchMask & 0x4000)
} }
// 16 Quests // 16 Quests
if ($searchMask & 0x8000) if ($searchMask & 0x0008000)
{ {
$conditions = array(
// [['cuFlags', MASK, '&'], 0], // todo (med): identify disabled quests // [['cuFlags', MASK, '&'], 0], // todo (med): identify disabled quests
[User::$localeId ? 'lq.Title_loc'.User::$localeId : 'Title', $query], // todo (high): unify name-fields // use defined $conditions array when using own table
$cnd = array(
[User::$localeId ? 'lq.Title_loc'.User::$localeId : 'Title', $query],
$maxResults $maxResults
); );
$quests = new QuestList($conditions); $quests = new QuestList($cnd);
if ($data = $quests->getListviewData()) if ($data = $quests->getListviewData())
{ {
@@ -728,7 +707,7 @@ if ($searchMask & 0x8000)
'type' => TYPE_QUEST, 'type' => TYPE_QUEST,
'appendix' => ' (Quest)', 'appendix' => ' (Quest)',
'matches' => $quests->getMatches(), 'matches' => $quests->getMatches(),
'file' => 'quest', 'file' => QuestList::$brickFile,
'data' => $data, 'data' => $data,
'params' => ['tabs' => '$myTabs'] 'params' => ['tabs' => '$myTabs']
); );
@@ -742,15 +721,15 @@ if ($searchMask & 0x8000)
} }
// 17 Achievements // 17 Achievements
if ($searchMask & 0x10000) if ($searchMask & 0x0010000)
{ {
$conditions = array( $cnd = array_merge($cndBase, array(
'AND',
[['flags', ACHIEVEMENT_FLAG_COUNTER, '&'], 0], [['flags', ACHIEVEMENT_FLAG_COUNTER, '&'], 0],
['name_loc'.User::$localeId, $query], ['name_loc'.User::$localeId, $query]
$maxResults ));
);
$acvs = new AchievementList($conditions); $acvs = new AchievementList($cnd);
if ($data = $acvs->getListviewData()) if ($data = $acvs->getListviewData())
{ {
@@ -763,7 +742,7 @@ if ($searchMask & 0x10000)
'type' => TYPE_ACHIEVEMENT, 'type' => TYPE_ACHIEVEMENT,
'appendix' => ' (Achievement)', 'appendix' => ' (Achievement)',
'matches' => $acvs->getMatches(), 'matches' => $acvs->getMatches(),
'file' => 'achievement', 'file' => AchievementList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'tabs' => '$myTabs', 'tabs' => '$myTabs',
@@ -780,15 +759,15 @@ if ($searchMask & 0x10000)
} }
// 18 Statistics // 18 Statistics
if ($searchMask & 0x20000) if ($searchMask & 0x0020000)
{ {
$conditions = array( $cnd = array_merge($cndBase, array(
'AND',
['flags', ACHIEVEMENT_FLAG_COUNTER, '&'], ['flags', ACHIEVEMENT_FLAG_COUNTER, '&'],
['name_loc'.User::$localeId, $query], ['name_loc'.User::$localeId, $query]
$maxResults ));
);
$stats = new AchievementList($conditions); $stats = new AchievementList($cnd);
if ($data = $stats->getListviewData()) if ($data = $stats->getListviewData())
{ {
@@ -797,7 +776,7 @@ if ($searchMask & 0x20000)
$found['statistic'] = array( $found['statistic'] = array(
'type' => TYPE_ACHIEVEMENT, 'type' => TYPE_ACHIEVEMENT,
'matches' => $stats->getMatches(), 'matches' => $stats->getMatches(),
'file' => 'achievement', 'file' => AchievementList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'tabs' => '$myTabs', 'tabs' => '$myTabs',
@@ -817,14 +796,11 @@ if ($searchMask & 0x20000)
} }
// 19 Zones // 19 Zones
if ($searchMask & 0x40000) if ($searchMask & 0x0040000)
{ {
$conditions = array( $cnd = array_merge($cndBase, [['name_loc'.User::$localeId, $query]]);
['name_loc'.User::$localeId, $query],
$maxResults
);
$zones = new ZoneList($conditions); $zones = new ZoneList($cnd);
if ($data = $zones->getListviewData()) if ($data = $zones->getListviewData())
{ {
@@ -834,7 +810,7 @@ if ($searchMask & 0x40000)
'type' => TYPE_ZONE, 'type' => TYPE_ZONE,
'appendix' => ' (Zone)', 'appendix' => ' (Zone)',
'matches' => $zones->getMatches(), 'matches' => $zones->getMatches(),
'file' => 'zone', 'file' => ZoneList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'tabs' => '$myTabs' 'tabs' => '$myTabs'
@@ -850,14 +826,11 @@ if ($searchMask & 0x40000)
} }
// 20 Objects // 20 Objects
if ($searchMask & 0x80000) if ($searchMask & 0x0080000)
{ {
$conditions = array( $cnd = array_merge($cndBase, [['name_loc'.User::$localeId, $query]]);
[(User::$localeId ? 'lg.name_loc'.User::$localeId : 'name'), $query],
$maxResults
);
$objects = new GameObjectList($conditions); $objects = new GameObjectList($cnd);
if ($data = $objects->getListviewData()) if ($data = $objects->getListviewData())
{ {
@@ -867,7 +840,7 @@ if ($searchMask & 0x80000)
'type' => TYPE_OBJECT, 'type' => TYPE_OBJECT,
'appendix' => ' (Object)', 'appendix' => ' (Object)',
'matches' => $objects->getMatches(), 'matches' => $objects->getMatches(),
'file' => 'object', 'file' => GameObjectList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'tabs' => '$myTabs' 'tabs' => '$myTabs'
@@ -883,15 +856,11 @@ if ($searchMask & 0x80000)
} }
// 21 Factions // 21 Factions
if ($searchMask & 0x100000) if ($searchMask & 0x0100000)
{ {
$conditions = array( $cnd = array_merge($cndBase, [['name_loc'.User::$localeId, $query]]);
['name_loc'.User::$localeId, $query],
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0],
$maxResults
);
$factions = new FactionList($conditions); $factions = new FactionList($cnd);
if ($data = $factions->getListviewData()) if ($data = $factions->getListviewData())
{ {
@@ -899,7 +868,7 @@ if ($searchMask & 0x100000)
'type' => TYPE_FACTION, 'type' => TYPE_FACTION,
'appendix' => ' (Faction)', 'appendix' => ' (Faction)',
'matches' => $factions->getMatches(), 'matches' => $factions->getMatches(),
'file' => 'faction', 'file' => FactionList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'tabs' => '$myTabs' 'tabs' => '$myTabs'
@@ -915,9 +884,11 @@ if ($searchMask & 0x100000)
} }
// 22 Skills // 22 Skills
if ($searchMask & 0x200000) if ($searchMask & 0x0200000)
{ {
$skills = new SkillList(array($maxResults, ['name_loc'.User::$localeId, $query])); $cnd = array_merge($cndBase, [['name_loc'.User::$localeId, $query]]);
$skills = new SkillList($cnd);
if ($data = $skills->getListviewData()) if ($data = $skills->getListviewData())
{ {
@@ -928,7 +899,7 @@ if ($searchMask & 0x200000)
'type' => TYPE_SKILL, 'type' => TYPE_SKILL,
'appendix' => ' (Skill)', 'appendix' => ' (Skill)',
'matches' => $skills->getMatches(), 'matches' => $skills->getMatches(),
'file' => 'skill', 'file' => SkillList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'tabs' => '$myTabs' 'tabs' => '$myTabs'
@@ -944,9 +915,11 @@ if ($searchMask & 0x200000)
} }
// 23 Pets // 23 Pets
if ($searchMask & 0x400000) if ($searchMask & 0x0400000)
{ {
$pets = new PetList(array($maxResults, ['name_loc'.User::$localeId, $query])); $cnd = array_merge($cndBase, [['name_loc'.User::$localeId, $query]]);
$pets = new PetList($cnd);
if ($data = $pets->getListviewData()) if ($data = $pets->getListviewData())
{ {
@@ -957,7 +930,7 @@ if ($searchMask & 0x400000)
'type' => TYPE_PET, 'type' => TYPE_PET,
'appendix' => ' (Pet)', 'appendix' => ' (Pet)',
'matches' => $pets->getMatches(), 'matches' => $pets->getMatches(),
'file' => 'pet', 'file' => PetList::$brickFile,
'data' => $data, 'data' => $data,
'params' => ['tabs' => '$myTabs'] 'params' => ['tabs' => '$myTabs']
); );
@@ -971,15 +944,15 @@ if ($searchMask & 0x400000)
} }
// 24 NPCAbilities // 24 NPCAbilities
if ($searchMask & 0x800000) if ($searchMask & 0x0800000)
{ {
$conditions = array( $cnd = array_merge($cndBase, array(
'AND',
['s.name_loc'.User::$localeId, $query], ['s.name_loc'.User::$localeId, $query],
['s.typeCat', -8], ['s.typeCat', -8]
$maxResults ));
);
$npcAbilities = new SpellList($conditions); $npcAbilities = new SpellList($cnd);
if ($data = $npcAbilities->getListviewData()) if ($data = $npcAbilities->getListviewData())
{ {
@@ -992,7 +965,7 @@ if ($searchMask & 0x800000)
'type' => TYPE_SPELL, 'type' => TYPE_SPELL,
'appendix' => ' (Spell)', 'appendix' => ' (Spell)',
'matches' => $npcAbilities->getMatches(), 'matches' => $npcAbilities->getMatches(),
'file' => 'spell', 'file' => SpellList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'id' => 'npc-abilities', 'id' => 'npc-abilities',
@@ -1014,13 +987,13 @@ if ($searchMask & 0x800000)
// 25 Spells (Misc + GM) // 25 Spells (Misc + GM)
if ($searchMask & 0x1000000) if ($searchMask & 0x1000000)
{ {
$conditions = array( $cnd = array_merge($cndBase, array(
'AND',
['s.name_loc'.User::$localeId, $query], ['s.name_loc'.User::$localeId, $query],
['OR', ['s.typeCat', [0, -9]], ['s.cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&']], ['s.typeCat', [0, -9]]
$maxResults ));
);
$misc = new SpellList($conditions); $misc = new SpellList($cnd);
if ($data = $misc->getListviewData()) if ($data = $misc->getListviewData())
{ {
@@ -1033,7 +1006,7 @@ if ($searchMask & 0x1000000)
'type' => TYPE_SPELL, 'type' => TYPE_SPELL,
'appendix' => ' (Spell)', 'appendix' => ' (Spell)',
'matches' => $misc->getMatches(), 'matches' => $misc->getMatches(),
'file' => 'spell', 'file' => SpellList::$brickFile,
'data' => $data, 'data' => $data,
'params' => [ 'params' => [
'tabs' => '$myTabs', 'tabs' => '$myTabs',
@@ -1057,6 +1030,9 @@ if ($searchMask & 0x1000000)
// 27 Guilds // 27 Guilds
// if ($searchMask & 0x4000000) // if ($searchMask & 0x4000000)
$smarty->saveCache($cacheKey, $found);
}
/* /*
!note! dear reader, if you ever try to generate a string, that is to be evaled by JS, NEVER EVER terminate with a \n !note! dear reader, if you ever try to generate a string, that is to be evaled by JS, NEVER EVER terminate with a \n
$totalHoursWasted +=2; $totalHoursWasted +=2;
@@ -1176,7 +1152,6 @@ else /* if ($searchMask & SEARCH_TYPE_REGULAR) */
)); ));
$smarty->assign('lang', array_merge(Lang::$main, Lang::$search)); $smarty->assign('lang', array_merge(Lang::$main, Lang::$search));
$smarty->assign('found', $found); $smarty->assign('found', $found);
$smarty->assign('lvData', $jsGlobals);
$smarty->assign('search', $search); $smarty->assign('search', $search);
$smarty->display('search.tpl'); $smarty->display('search.tpl');

15
template/bricks/book.tpl Normal file
View File

@@ -0,0 +1,15 @@
{if !empty($pageText)}
<div class="clear"></div>
<h3>{$lang.content}</h3>
<div id="book-generic"></div>
<script>//<![CDATA[
{strip}new Book({ldelim} parent: 'book-generic', pages: [
{foreach from=$pageText item=page name=j}
'{$page|escape:"javascript"}'
{if $smarty.foreach.j.last}{else},{/if}
{/foreach}
]{rdelim}){/strip}
//]]></script>
{/if}

View File

@@ -0,0 +1,8 @@
var _ = g_objects;
{strip}
{foreach from=$data key=id item=item}
_[{$id}]={ldelim}
name_{$user.language}:'{$item.name|escape:"javascript"}'
{rdelim};
{/foreach}
{/strip}

View File

@@ -65,21 +65,7 @@
</div> </div>
{/if} {/if}
{/if} {/if}
{if !empty($pageText)} {include file='bricks/book.tpl'}
<div class="clear"></div>
<h3>{$lang.content}</h3>
<div id="book-generic"></div>
<script>//<![CDATA[
{strip}new Book({ldelim} parent: 'book-generic', pages: [
{foreach from=$pageText item=page name=j}
'{$page|escape:"javascript"}'
{if $smarty.foreach.j.last}{else},{/if}
{/foreach}
]{rdelim}){/strip}
//]]></script>
{/if}
<h2 class="clear">{$lang.related}</h2> <h2 class="clear">{$lang.related}</h2>
</div> </div>

View File

@@ -5731,6 +5731,8 @@ Listview.extraCols = {
}, },
getState: function(cond) { getState: function(cond) {
switch (g_types[cond.type]) { switch (g_types[cond.type]) {
case 'skill':
return Listview.extraCols.condition.getSkillState(cond);
case 'spell': case 'spell':
return Listview.extraCols.condition.getSpellState(cond); return Listview.extraCols.condition.getSpellState(cond);
case 'item': case 'item':
@@ -5745,6 +5747,26 @@ Listview.extraCols = {
return {}; return {};
} }
}, },
getSkillState: function(cond) {
if (!cond.typeId || !g_skills[cond.typeId]) {
return;
}
var
cnd = {},
item = g_skills[cond.typeId];
cnd.icon = item.icon.toLowerCase();
cnd.state = cond.status ? $WH.ct(LANG.pr_note_known) : $WH.ct(LANG.pr_note_missing);
cnd.color = cond.status ? 'q2' : 'q10';
cnd.name = item['name_' + g_locale.name];
cnd.url = '?skill=' + cond.typeId;
if (cond.reqSkillLvl)
cnd.name += ' (' + cond.reqSkillLvl + ')';
return cnd;
},
getSpellState: function(cond) { getSpellState: function(cond) {
if (!cond.typeId || !g_spells[cond.typeId]) { if (!cond.typeId || !g_spells[cond.typeId]) {
return; return;

View File

@@ -1,36 +1,31 @@
{include file='header.tpl'} {include file='header.tpl'}
<div id="main"> <div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents">
<div id="main-precontents"></div> {if !empty($announcements)}
<div id="main-contents" class="main-contents"> {foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
<script type="text/javascript"> {/foreach}
{include file='bricks/community.tpl'}
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$object.name|escape:"quotes"}'{rdelim};
g_initPath({$page.path});
</script>
{if isset($object.key) or isset($object.lockpicking) or isset($object.mining) or isset($object.herbalism)}
<table class="infobox">
<tr><th>{#Quick_Facts#}</th></tr>
<tr><td><div class="infobox-spacer"></div>
<ul>
{if isset($object.key)}<li><div>{#Key#}{$lang.colon}<a class="q{$object.key.quality}" href="?item={$object.key.id}">[{$object.key.name}]</a></div></li>{/if}
{if isset($object.lockpicking)}<li><div>{#Lockpickable#} (<span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, '{#Required_lockpicking_skill#}', 0, 0, 'q')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">{$object.lockpicking}</span>)</div></li>{/if}
{if isset($object.mining)}<li><div>{#Mining#} (<span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, '{#Required_mining_skill#}', 0, 0, 'q')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">{$object.mining}</span>)</div></li>{/if}
{if isset($object.herbalism)}<li><div>{#Herb#} (<span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, '{#Required_herb_skill#}', 0, 0, 'q')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()">{$object.herbalism}</span>)</div></li>{/if}
</ul>
</td></tr>
</table>
{/if} {/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"> <div class="text">
{include file='bricks/redButtons.tpl'}
<a href="{$wowhead}" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a> <h1>{$name}</h1>
<h1>{$object.name}</h1>
{if $object.position} {include file='bricks/article.tpl'}
{if $positions}
<div>{#This_Object_can_be_found_in#} <div>{#This_Object_can_be_found_in#}
{strip} {strip}
<span id="locations"> <span id="locations">
@@ -75,33 +70,18 @@
<div class="clear"></div> <div class="clear"></div>
<script type="text/javascript"> <script type="text/javascript">
var myMapper = new Mapper({ldelim}parent: 'mapper-generic', zone: '{$object.position[0].atid}'{rdelim}); var myMapper = new Mapper({ldelim}parent: 'mapper-generic', zone: '{$position[0].atid}'{rdelim});
$WH.gE($WH.ge('locations'), 'a')[0].onclick(); $WH.gE($WH.ge('locations'), 'a')[0].onclick();
</script> </script>
{else} {else}
{#This_Object_cant_be_found#} {$lang.unkPosition}
{/if}
{if isset($object.pagetext)}
<h3>Content</h3>
<div id="book-generic"></div>
{strip}
<script>
new Book({ldelim} parent: 'book-generic', pages: [
{foreach from=$object.pagetext item=pagetext name=j}
'{$pagetext|escape:"javascript"}'
{if $smarty.foreach.j.last}{else},{/if}
{/foreach}
]{rdelim})
</script>
{/strip}
{/if} {/if}
{include file='bricks/book.tpl'}
<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 +1,61 @@
{include file='header.tpl'} {include file='header.tpl'}
<div id="main"> <div class="main" id="main">
<div id="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">
<script type="text/javascript">
g_initPath({$page.path});
</script>
<div id="lv-objects" class="listview"></div> {if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
<script type="text/javascript"> <script type="text/javascript">
{include file='bricks/listviews/object.tpl' data=$objects.data params=$objects.params} g_initPath({$path}, {if empty($filter.query)} 0 {else} 1 {/if});
{if !empty($filter.query)}
Menu.modifyUrl(Menu.findItem(mn_database, [5]), {ldelim} filter: '+={$filter.query|escape:'quotes'}' {rdelim}, {ldelim} onAppendCollision: fi_mergeFilterParams, onAppendEmpty: fi_setFilterParams, menuUrl: Menu.getItemUrl(Menu.findItem(mn_database, [5])) {rdelim});
{/if}
</script> </script>
<div id="fi" style="display: {if empty($filter.query)}none{else}block{/if};">
<form action="?objects{$subCat}&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
<table>
<tr><td>{$lang.name|ucFirst}: </td><td>&nbsp;<input type="text" name="na" size="30" {if isset($filter.na)}value="{$filter.na|escape:'html'}" {/if}/></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="clear"></div>
</div>
<div class="padded">
<input type="submit" value="{$lang.applyFilter}" />
<input type="reset" value="{$lang.resetForm}" />
</div> </div>
</form>
<div class="pad"></div>
</div>
<script type="text/javascript">//<![CDATA[
fi_init('objects');
{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/object.tpl' data=$lvData.data params=$lvData.params}
//]]></script>
<div class="clear"></div>
</div><!-- main-contents -->
</div><!-- main -->
{include file='footer.tpl'} {include file='footer.tpl'}

View File

@@ -12,55 +12,55 @@
<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: {$type}, typeId: {$typeId}, name: '{$lvData.name|escape:"quotes"}'{rdelim}; var g_pageInfo = {ldelim}type: {$type}, typeId: {$typeId}, name: '{$name|escape:"quotes"}'{rdelim};
g_initPath({$path}); g_initPath({$path});
//]]></script> //]]></script>
{include file='bricks/infobox.tpl'} {include file='bricks/infobox.tpl'}
<div class="text"> <div class="text">
{include file='bricks/headIcons.tpl' icons=$lvData.icons} {*include file='bricks/headIcons.tpl'*}
{include file='bricks/redButtons.tpl'} {include file='bricks/redButtons.tpl'}
<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> <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 $lvData.page.reagents} {if $reagents[0]}
{if $lvData.page.tools}<div style="float: left; margin-right: 75px">{/if} {if $tools}<div style="float: left; margin-right: 75px">{/if}
{include file='bricks/reagentList.tpl' reagents=$lvData.page.reagents[1] enhanced=$lvData.page.reagents[0]} {include file='bricks/reagentList.tpl' reagents=$reagents[1] enhanced=$reagents[0]}
{if $lvData.page.tools}</div>{/if} {if $tools}</div>{/if}
{/if} {/if}
{if $lvData.page.tools} {if $tools}
{if $lvData.page.reagents}<div style="float: left">{/if} {if $reagents[0]}<div style="float: left">{/if}
<h3>{$lang.tools}</h3> <h3>{$lang.tools}</h3>
<table class="iconlist"> <table class="iconlist">
{section name=i loop=$lvData.page.tools} {section name=i loop=$tools}
<tr><th align="right" id="iconlist-icon{$iconlist1++}"></th><td><span class="q1"><a href="{$lvData.page.tools[i].url}">{$lvData.page.tools[i].name}</a></span></td></tr> <tr><th align="right" id="iconlist-icon{$iconlist1++}"></th><td><span class="q1"><a href="{$tools[i].url}">{$tools[i].name}</a></span></td></tr>
{/section} {/section}
</table> </table>
<script type="text/javascript"> <script type="text/javascript">
{section name=i loop=$lvData.page.tools}{if isset($lvData.page.tools[i].itemId)} {section name=i loop=$tools}{if isset($tools[i].itemId)}
$WH.ge('iconlist-icon{$iconlist2++}').appendChild(g_items.createIcon({$lvData.page.tools[i].itemId}, 0, 1)); $WH.ge('iconlist-icon{$iconlist2++}').appendChild(g_items.createIcon({$tools[i].itemId}, 0, 1));
{/if}{/section} {/if}{/section}
</script> </script>
{if $lvData.page.reagents}</div>{/if}{ {if $reagents[0]}</div>{/if}
/if} {/if}
<div class="clear"></div> <div class="clear"></div>
{include file='bricks/article.tpl'} {include file='bricks/article.tpl'}
{* {*
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.icon:$lvData.page.transfer.name:$lvData.page.transfer.facInt:$lvData.page.transfer.facName} {$lang._transfer|sprintf:$transfer.id:´´:$transfer.icon:$transfer.name:$transfer.facInt:$transfer.facName}
{/if} {/if}
*} *}
{if isset($lvData.page.unavailable)} {if isset($unavailable)}
<div class="pad"></div> <div class="pad"></div>
<b style="color: red">{$lang._unavailable}</b> <b style="color: red">{$lang._unavailable}</b>
{/if} {/if}
@@ -82,92 +82,92 @@ if !empty($lvData.page.transfer)}
</tr> </tr>
<tr> <tr>
<th style="border-left: 0; border-top: 0">{$lang.duration}</th> <th style="border-left: 0; border-top: 0">{$lang.duration}</th>
<td width="100%" style="border-top: 0">{if !empty($lvData.page.duration)}{$lvData.page.duration}{else}<span class="q0">{$lang.n_a}</span>{/if}</td> <td width="100%" style="border-top: 0">{if !empty($duration)}{$duration}{else}<span class="q0">{$lang.n_a}</span>{/if}</td>
</tr> </tr>
<tr> <tr>
<th style="border-left: 0">{$lang.school}</th> <th style="border-left: 0">{$lang.school}</th>
<td>{$lvData.page.school}</td> <td>{$school}</td>
</tr> </tr>
<tr> <tr>
<th style="border-left: 0">{$lang.mechanic}</th> <th style="border-left: 0">{$lang.mechanic}</th>
<td width="100%" style="border-top: 0">{if $lvData.page.mechanic}{$lvData.page.mechanic}{else}<span class="q0">{$lang.n_a}</span>{/if}</td> <td width="100%" style="border-top: 0">{if $mechanic}{$mechanic}{else}<span class="q0">{$lang.n_a}</span>{/if}</td>
</tr> </tr>
<tr> <tr>
<th style="border-left: 0">{$lang.dispelType}</th> <th style="border-left: 0">{$lang.dispelType}</th>
<td width="100%" style="border-top: 0">{if $lvData.page.dispel}{$lvData.page.dispel}{else}<span class="q0">{$lang.n_a}</span>{/if}</td> <td width="100%" style="border-top: 0">{if $dispel}{$dispel}{else}<span class="q0">{$lang.n_a}</span>{/if}</td>
</tr> </tr>
<tr> <tr>
<th style="border-bottom: 0; border-left: 0">{$lang._gcdCategory}</th> <th style="border-bottom: 0; border-left: 0">{$lang._gcdCategory}</th>
<td style="border-bottom: 0">{$lvData.page.gcdCat}</td> <td style="border-bottom: 0">{$gcdCat}</td>
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="border-top: 0">{$lang._cost}</th> <th style="border-top: 0">{$lang._cost}</th>
<td style="border-top: 0">{if !empty($lvData.page.powerCost)}{$lvData.page.powerCost}{else}{$lang._none}{/if}</td> <td style="border-top: 0">{if !empty($powerCost)}{$powerCost}{else}{$lang._none}{/if}</td>
</tr> </tr>
<tr> <tr>
<th>{$lang._range}</th> <th>{$lang._range}</th>
<td>{$lvData.page.range} {$lang._distUnit} <small>({$lvData.page.rangeName})</small></td> <td>{$range} {$lang._distUnit} <small>({$rangeName})</small></td>
</tr> </tr>
<tr> <tr>
<th>{$lang._castTime}</th> <th>{$lang._castTime}</th>
<td>{$lvData.page.castTime}</td> <td>{$castTime}</td>
</tr> </tr>
<tr> <tr>
<th>{$lang._cooldown}</th> <th>{$lang._cooldown}</th>
<td>{if !empty($lvData.page.cooldown)}{$lvData.page.cooldown}{else}<span class="q0">{$lang.n_a}</span>{/if}</td> <td>{if !empty($cooldown)}{$cooldown}{else}<span class="q0">{$lang.n_a}</span>{/if}</td>
</tr> </tr>
<tr> <tr>
<th><dfn title="{$lang._globCD}">{$lang._gcd}</dfn></th> <th><dfn title="{$lang._globCD}">{$lang._gcd}</dfn></th>
<td>{$lvData.page.gcd}</td> <td>{$gcd}</td>
</tr> </tr>
{if !empty($lvData.page.scaling)} {if !empty($scaling)}
<tr> <tr>
<th>{$lang._scaling}</th> <th>{$lang._scaling}</th>
<td colspan="3">{$lvData.page.scaling}</td> <td colspan="3">{$scaling}</td>
</tr> </tr>
{/if} {/if}
{if !empty($lvData.page.stances)} {if !empty($stances)}
<tr> <tr>
<th>{$lang._forms}</th> <th>{$lang._forms}</th>
<td colspan="3">{$lvData.page.stances}</td> <td colspan="3">{$stances}</td>
</tr> </tr>
{/if} {/if}
{if !empty($lvData.page.items)} {if !empty($items)}
<tr> <tr>
<th>{$lang.requires2}</th> <th>{$lang.requires2}</th>
<td colspan="3">{$lvData.page.items}</td> <td colspan="3">{$items}</td>
</tr> </tr>
{/if} {/if}
{section name=i loop=$lvData.page.effect} {section name=i loop=$effect}
<tr> <tr>
<th>{$lang._effect} #{$smarty.section.i.index+1}</th> <th>{$lang._effect} #{$smarty.section.i.index+1}</th>
<td colspan="3" style="line-height: 17px"> <td colspan="3" style="line-height: 17px">
{$lvData.page.effect[i].name} {$effect[i].name}
<small> <small>
{if isset($lvData.page.effect[i].value)}<br>{$lang._value}{$lang.colon}{$lvData.page.effect[i].value}{/if} {if isset($effect[i].value)}<br>{$lang._value}{$lang.colon}{$effect[i].value}{/if}
{if isset($lvData.page.effect[i].radius)}<br>{$lang._radius}{$lang.colon}{$lvData.page.effect[i].radius} {$lang._distUnit}{/if} {if isset($effect[i].radius)}<br>{$lang._radius}{$lang.colon}{$effect[i].radius} {$lang._distUnit}{/if}
{if isset($lvData.page.effect[i].interval)}<br>{$lang._interval}{$lang.colon}{$lvData.page.effect[i].interval}{/if} {if isset($effect[i].interval)}<br>{$lang._interval}{$lang.colon}{$effect[i].interval}{/if}
{if isset($lvData.page.effect[i].mechanic)}<br>{$lang.mechanic}{$lang.colon}{$lvData.page.effect[i].mechanic}{/if} {if isset($effect[i].mechanic)}<br>{$lang.mechanic}{$lang.colon}{$effect[i].mechanic}{/if}
{if isset($lvData.page.effect[i].procData)}<br>{if $lvData.page.effect[i].procData[0] < 0}{$lang.ppm|sprintf:$lvData.page.effect[i].procData[0]*-1}{else}{$lang.procChance}{$lang.colon}{$lvData.page.effect[i].procData[0]}%{/if}{if $lvData.page.effect[i].procData[1]} ({$lang.cooldown|sprintf:$lvData.page.effect[i].procData[1]}){/if}{/if} {if isset($effect[i].procData)}<br>{if $effect[i].procData[0] < 0}{$lang.ppm|sprintf:$effect[i].procData[0]*-1}{else}{$lang.procChance}{$lang.colon}{$effect[i].procData[0]}%{/if}{if $effect[i].procData[1]} ({$lang.cooldown|sprintf:$effect[i].procData[1]}){/if}{/if}
</small> </small>
{if isset($lvData.page.effect[i].icon)} {if isset($effect[i].icon)}
<table class="icontab"> <table class="icontab">
<tr> <tr>
<th id="icontab-icon{$smarty.section.i.index}"></th> <th id="icontab-icon{$smarty.section.i.index}"></th>
{if isset($lvData.page.effect[i].icon.quality)} {if isset($effect[i].icon.quality)}
<td><span class="q{$lvData.page.effect[i].icon.quality}"><a href="?item={$lvData.page.effect[i].icon.id}">{$lvData.page.effect[i].icon.name}</a></span></td> <td><span class="q{$effect[i].icon.quality}"><a href="?item={$effect[i].icon.id}">{$effect[i].icon.name}</a></span></td>
{else} {else}
<td>{if !$lvData.page.effect[i].icon.name|strpos:"#"}<a href="?spell={$lvData.page.effect[i].icon.id}">{/if}{$lvData.page.effect[i].icon.name}{if !$lvData.page.effect[i].icon.name|strpos:"#"}</a>{/if}</td> <td>{if !$effect[i].icon.name|strpos:"#"}<a href="?spell={$effect[i].icon.id}">{/if}{$effect[i].icon.name}{if !$effect[i].icon.name|strpos:"#"}</a>{/if}</td>
{/if} {/if}
<th></th><td></td> <th></th><td></td>
</tr> </tr>
</table> </table>
<script type="text/javascript"> <script type="text/javascript">
$WH.ge('icontab-icon{$smarty.section.i.index}').appendChild({if isset($lvData.page.effect[i].icon.quality)}g_items{else}g_spells{/if}.createIcon({$lvData.page.effect[i].icon.id}, 1, {$lvData.page.effect[i].icon.count})); $WH.ge('icontab-icon{$smarty.section.i.index}').appendChild({if isset($effect[i].icon.quality)}g_items{else}g_spells{/if}.createIcon({$effect[i].icon.id}, 1, {$effect[i].icon.count}));
</script> </script>
{/if} {/if}
</td> </td>
@@ -178,7 +178,7 @@ if !empty($lvData.page.transfer)}
<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,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 !empty($filter.query)} {if !empty($filter.query)}
Menu.modifyUrl(Menu.findItem(mn_database, [1]), {ldelim} filter: '+={$filter.query|escape:'quotes'}' {rdelim}, {ldelim} onAppendCollision: fi_mergeFilterParams, onAppendEmpty: fi_setFilterParams, menuUrl: Menu.getItemUrl(Menu.findItem(mn_database, [1])) {rdelim}); Menu.modifyUrl(Menu.findItem(mn_database, [1]), {ldelim} filter: '+={$filter.query|escape:'quotes'}' {rdelim}, {ldelim} onAppendCollision: fi_mergeFilterParams, onAppendEmpty: fi_setFilterParams, menuUrl: Menu.getItemUrl(Menu.findItem(mn_database, [1])) {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="?spells{$page.subCat}&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)"> <form action="?spells{$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.school}{$lang.colon}</div> <div style="float: left">{$lang.school}{$lang.colon}</div>
<small><a href="javascript:;" onclick="document.forms['fi'].elements['sc[]'].selectedIndex = -1; return false" onmousedown="return false">{$lang.clear}</a></small> <small><a href="javascript:;" onclick="document.forms['fi'].elements['sc[]'].selectedIndex = -1; return false" onmousedown="return false">{$lang.clear}</a></small>