mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
- implemented factions basics (search, listview and details)
- added forgotten shared brick for tooltips
This commit is contained in:
@@ -136,6 +136,7 @@ define('CUSTOM_HAS_VIDEO', 0x04000000);
|
||||
define('CUSTOM_DISABLED', 0x08000000);
|
||||
define('CUSTOM_SERVERSIDE', 0x10000000);
|
||||
define('CUSTOM_UNAVAILABLE', 0x20000000);
|
||||
define('CUSTOM_EXCLUDE_FOR_LISTVIEW', 0x40000000); // will not show up in search or on listPage (override for staff)
|
||||
|
||||
// Custom Flags (per type)
|
||||
define('SPELL_CU_TALENT', 0x0001); // passive talent
|
||||
@@ -147,7 +148,7 @@ define('SPELL_CU_PET_TALENT_TYPE2', 0x0020); // Cunning
|
||||
define('SPELL_CU_GLYPH_MAJOR', 0x0040);
|
||||
define('SPELL_CU_GLYPH_MINOR', 0x0080);
|
||||
define('SPELL_CU_QUALITY_MASK', 0x0F00); // set if spell creates an item: (7 - Quality) << 8
|
||||
define('SPELL_CU_EXCLUDE_CATEGORY_SEARCH', 0x1000); // only display, when searching for spells in general (!cat || cat = 0)
|
||||
// define('SPELL_CU_EXCLUDE_CATEGORY_SEARCH', 0x1000); // migrate to CUSTOM_EXCLUDE_FOR_LISTVIEW
|
||||
define('SPELL_CU_FIRST_RANK', 0x2000); // used by filter
|
||||
define('SPELL_CU_LAST_RANK', 0x4000);
|
||||
|
||||
|
||||
@@ -6,7 +6,33 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
class FactionList extends BaseType
|
||||
{
|
||||
public static $type = TYPE_FACTION;
|
||||
public static $type = TYPE_FACTION;
|
||||
|
||||
protected $queryBase = 'SELECT f1.*, f1.id AS ARRAY_KEY, f1.parentFactionId AS cat FROM ?_factions f1';
|
||||
protected $queryOpts = array(
|
||||
'f1' => [['f2']],
|
||||
'f2' => ['j' => ['?_factions f2 ON f1.parentFactionId = f2.id', true], 's' => ', IFNULL(f2.parentFactionId, 0) AS cat2']
|
||||
);
|
||||
|
||||
public function __construct($conditions = [])
|
||||
{
|
||||
parent::__construct($conditions);
|
||||
|
||||
if ($this->error)
|
||||
return;
|
||||
|
||||
// post processing
|
||||
foreach ($this->iterate() as &$_curTpl)
|
||||
{
|
||||
// prepare factionTemplates
|
||||
if ($_curTpl['templateIds'])
|
||||
$_curTpl['templateIds'] = explode(' ', $_curTpl['templateIds']);
|
||||
|
||||
// prepare quartermaster
|
||||
if ($_curTpl['qmNpcIds'])
|
||||
$_curTpl['qmNpcIds'] = explode(' ', $_curTpl['qmNpcIds']);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getName($id)
|
||||
{
|
||||
@@ -20,24 +46,37 @@ class FactionList extends BaseType
|
||||
FROM
|
||||
?_factions
|
||||
WHERE
|
||||
factionID = ?d',
|
||||
id = ?d',
|
||||
$id
|
||||
);
|
||||
return Util::localizedString($n, 'name');
|
||||
}
|
||||
|
||||
public function reactsAgainst($faction)
|
||||
public function getListviewData()
|
||||
{
|
||||
// see factionTemplate
|
||||
/*
|
||||
1: friendly
|
||||
0: neutral
|
||||
-1: hostile
|
||||
*/
|
||||
$data = [];
|
||||
|
||||
foreach ($this->iterate() as $__)
|
||||
{
|
||||
$data[$this->id] = array(
|
||||
'category' => $this->curTpl['cat'],
|
||||
'category2' => $this->curTpl['cat2'],
|
||||
'expansion' => $this->curTpl['expansion'],
|
||||
'id' => $this->id,
|
||||
'side' => $this->curTpl['side'],
|
||||
'name' => $this->getField('name', true)
|
||||
);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function addGlobalsToJScript(&$template, $addMask = 0)
|
||||
{
|
||||
foreach ($this->iterate() as $__)
|
||||
$template->extendGlobalData(self::$type, [$this->id => ['name' => $this->getField('name', true)]]);
|
||||
}
|
||||
|
||||
public function getListviewData() { }
|
||||
public function addGlobalsToJScript(&$template, $addMask = 0) { }
|
||||
public function renderTooltip() { }
|
||||
|
||||
}
|
||||
|
||||
@@ -316,7 +316,10 @@ class ItemList extends BaseType
|
||||
$data[$this->id]['reqfaction'] = $x;
|
||||
|
||||
if ($x = $this->curTpl['requiredFactionRank'])
|
||||
$data[$this->id]['reqrep'] = $x;
|
||||
{
|
||||
$data[$this->id]['reqrep'] = $x;
|
||||
$data[$this->id]['standing'] = $x; // used in /faction item-listing
|
||||
}
|
||||
|
||||
if ($x = $this->curTpl['slots'])
|
||||
$data[$this->id]['nslots'] = $x;
|
||||
@@ -1237,6 +1240,9 @@ class ItemList extends BaseType
|
||||
{
|
||||
$this->ssd[$this->id] = DB::Aowow()->selectRow("SELECT * FROM ?_scalingstatdistribution WHERE id = ?", $this->curTpl['scalingStatDistribution']);
|
||||
|
||||
if (!$this->ssd[$this->id])
|
||||
return;
|
||||
|
||||
// stats and ratings
|
||||
for ($i = 1; $i <= 10; $i++)
|
||||
{
|
||||
|
||||
@@ -112,7 +112,7 @@ class QuestList extends BaseType
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getListviewData()
|
||||
public function getListviewData($extraFactionId = 0) // i should formulate a propper parameter..
|
||||
{
|
||||
$data = [];
|
||||
|
||||
@@ -170,6 +170,7 @@ class QuestList extends BaseType
|
||||
$data[$this->id]['weekly'] = true;
|
||||
|
||||
// flags & 64: Hostile - there are quests, that flag the player for pvp when taken .. where is that set..?
|
||||
// wflags: &1: disabled/historical; &32: AutoAccept; &64: Hostile(?)
|
||||
if ($this->curTpl['Flags'] & 0x4000) // Unavailable (todo (med): get disables)
|
||||
{
|
||||
$data[$this->id]['historical'] = true; // post 5.0
|
||||
@@ -179,7 +180,23 @@ class QuestList extends BaseType
|
||||
if ($this->curTpl['Flags'] & 0x80000) // Auto Accept
|
||||
$data[$this->id]['wflags'] |= 0x20;
|
||||
|
||||
// todo reprewards .. accesses QuestFactionReward.dbc
|
||||
$data[$this->id]['reprewards'] = [];
|
||||
for ($i = 1; $i < 6; $i++)
|
||||
{
|
||||
$foo = $this->curTpl['RewardFactionId'.$i];
|
||||
$bar = $this->curTpl['RewardFactionValueIdOverride'.$i] / 100;
|
||||
|
||||
if (!$bar && ($_ = $this->curTpl['RewardFactionValueId'.$i]))
|
||||
$bar = Util::$questFactionReward[abs($_)] * ($_ < 0 ? -1 : 1);
|
||||
|
||||
if ($foo && $bar)
|
||||
{
|
||||
$data[$this->id]['reprewards'][] = [$foo, $bar];
|
||||
|
||||
if ($extraFactionId == $foo)
|
||||
$data[$this->id]['reputation'] = $bar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
||||
@@ -53,7 +53,6 @@ class SkillList extends BaseType
|
||||
|
||||
foreach ($this->iterate() as $__)
|
||||
{
|
||||
|
||||
$data[$this->id] = array(
|
||||
'category' => $this->curTpl['typeCat'],
|
||||
'categorybak' => $this->curTpl['categoryId'],
|
||||
|
||||
@@ -18,6 +18,7 @@ class Lang
|
||||
public static $class;
|
||||
public static $currency;
|
||||
public static $event;
|
||||
public static $faction;
|
||||
public static $item;
|
||||
public static $itemset;
|
||||
public static $maps;
|
||||
@@ -344,7 +345,7 @@ class SmartyAoWoW extends Smarty
|
||||
|
||||
if ($article)
|
||||
{
|
||||
$tv['article'] = ['text' => $article['article']];
|
||||
$tv['article'] = ['text' => Util::jsEscape($article['article'])];
|
||||
if (empty($tv['infobox']) && !empty($article['quickInfo']))
|
||||
$tv['infobox'] = $article['quickInfo'];
|
||||
|
||||
@@ -493,7 +494,7 @@ class SmartyAoWoW extends Smarty
|
||||
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.entry', $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;
|
||||
@@ -638,6 +639,11 @@ class Util
|
||||
10 => [ 65, 66, 67, 210, 394, 495, 3537, 3711, 4024, 4197, 4395]
|
||||
);
|
||||
|
||||
public static $questFactionReward = array( // from QuestFactionReward.dbc
|
||||
0, 10, 25, 75, 150, 250, 350, 500, 1000, 5
|
||||
);
|
||||
|
||||
|
||||
/* why:
|
||||
Because petSkills (and ranged weapon skills) are the only ones with more than two skillLines attached. Because Left Joining ?_spell with ?_skillLineAbility causes more trouble than it has uses.
|
||||
Because this is more or less the only reaonable way to fit all that information into one database field, so..
|
||||
@@ -750,8 +756,7 @@ class Util
|
||||
null, 4, 10, 9, 8, 6, 15, 11, 3, 5, null, 7
|
||||
);
|
||||
|
||||
// from DurabilityQuality.dbc
|
||||
public static $itemDurabilityQualityMod = array(
|
||||
public static $itemDurabilityQualityMod = array( // from DurabilityQuality.dbc
|
||||
null, 1.0, 0.6, 1.0, 0.8, 1.0, 1.0, 1.2, 1.25, 1.44, 2.5, 1.728, 3.0, 0.0, 0.0, 1.2, 1.25
|
||||
);
|
||||
|
||||
|
||||
@@ -330,6 +330,12 @@ $lang = array(
|
||||
'exotic' => "Exotisch",
|
||||
'cat' => ["Wildheit", "Hartnäckigkeit", "Gerissenheit"]
|
||||
),
|
||||
'faction' => array(
|
||||
'spillover' => "Reputationsüberlauf",
|
||||
'spilloverDesc' => "Für diese Fraktion erhaltener Ruf wird zusätzlich mit den unten aufgeführten Fraktionen anteilig verrechnet.",
|
||||
'maxStanding' => "Max. Ruf",
|
||||
'quartermaster' => "Rüstmeister"
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> ist das <b>%s</b>. Es enthält %s Teile.",
|
||||
'_descTagless' => "<b>%s</b> ist ein Ausrüstungsset, das %s Teile enthält.",
|
||||
|
||||
@@ -317,6 +317,12 @@ $lang = array(
|
||||
'exotic' => "Exotic",
|
||||
'cat' => ["Ferocity", "Tenacity", "Cunning"]
|
||||
),
|
||||
'faction' => array(
|
||||
'spillover' => "Reputation Spillover",
|
||||
'spilloverDesc' => "Gaining Reputation with this faction also yields a proportional gain with the factions listed below.",
|
||||
'maxStanding' => "Max. Standing",
|
||||
'quartermaster' => "Quartermaster"
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> is the <b>%s</b>. It contains %s pieces.",
|
||||
'_descTagless' => "<b>%s</b> is an item set that contains %s pieces.",
|
||||
|
||||
@@ -288,6 +288,12 @@ $lang = array(
|
||||
'exotic' => "Exótica",
|
||||
'cat' => ["Ferocidad", "Tenacidad", "Astucia"]
|
||||
),
|
||||
'faction' => array(
|
||||
'spillover' => "[Reputation Spillover]",
|
||||
'spilloverDesc' => "[Gaining Reputation with this faction also yields a proportional gain with the factions listed below.]",
|
||||
'maxStanding' => "Posición máxima",
|
||||
'quartermaster' => "Intendente"
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> es el <b>%s</b>. Contiene %s piezas.",
|
||||
'_descTagless' => "<b>%s</b> es un conjunto de objetos que tiene %s piezas.",
|
||||
|
||||
@@ -288,6 +288,12 @@ $lang = array(
|
||||
'exotic' => "Exotique",
|
||||
'cat' => ["Férocité", "Tenacité", "Ruse"]
|
||||
),
|
||||
'faction' => array(
|
||||
'spillover' => "[Reputation Spillover]",
|
||||
'spilloverDesc' => "[Gaining Reputation with this faction also yields a proportional gain with the factions listed below.]",
|
||||
'maxStanding' => "Niveau maximum",
|
||||
'quartermaster' => "Intendant"
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> est le <b>%s</b>. Il contient %s pièces.",
|
||||
'_descTagless' => "<b>%s</b> est un ensemble d'objet qui contient %s pièces.",
|
||||
|
||||
@@ -288,6 +288,12 @@ $lang = array(
|
||||
'exotic' => "Экзотический",
|
||||
'cat' => ["Свирепость", "Упорство", "Хитрость"]
|
||||
),
|
||||
'faction' => array(
|
||||
'spillover' => "[Reputation Spillover]",
|
||||
'spilloverDesc' => "[Gaining Reputation with this faction also yields a proportional gain with the factions listed below.]",
|
||||
'maxStanding' => "Макс Уровень",
|
||||
'quartermaster' => "Интендант"
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> — <b>%s</b>. Он состоит из %s предметов.",
|
||||
'_descTagless' => "<b>%s</b> — набор из %s предметов.",
|
||||
|
||||
@@ -88,13 +88,13 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
switch ($acv->getField('faction'))
|
||||
{
|
||||
case 1:
|
||||
$infobox[] = Lang::$main['side'].': [span class=alliance-icon]'.Lang::$game['si'][SIDE_ALLIANCE].'[/span]';
|
||||
$infobox[] = Lang::$main['side'].Lang::$colon.'[span class=alliance-icon]'.Lang::$game['si'][SIDE_ALLIANCE].'[/span]';
|
||||
break;
|
||||
case 2:
|
||||
$infobox[] = Lang::$main['side'].': [span class=horde-icon]'.Lang::$game['si'][SIDE_HORDE].'[/span]';
|
||||
$infobox[] = Lang::$main['side'].Lang::$colon.'[span class=horde-icon]'.Lang::$game['si'][SIDE_HORDE].'[/span]';
|
||||
break;
|
||||
default: // case 3
|
||||
$infobox[] = Lang::$main['side'].': '.Lang::$game['si'][SIDE_BOTH];
|
||||
$infobox[] = Lang::$main['side'].Lang::$colon.Lang::$game['si'][SIDE_BOTH];
|
||||
}
|
||||
|
||||
// todo (low): crosslink with charactersDB to check if realmFirsts are still available
|
||||
|
||||
236
pages/faction.php
Normal file
236
pages/faction.php
Normal file
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
require 'includes/community.class.php';
|
||||
|
||||
$_id = intVal($pageParam);
|
||||
|
||||
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_FACTION, $_id, -1, User::$localeId]);
|
||||
|
||||
if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
{
|
||||
$faction = new FactionList(array(['id', $_id]));
|
||||
if ($faction->error)
|
||||
$smarty->notFound(Lang::$game['faction']);
|
||||
|
||||
/***********/
|
||||
/* Infobox */
|
||||
/***********/
|
||||
|
||||
$infobox = [];
|
||||
|
||||
// Quartermaster if any
|
||||
if ($ids = $faction->getField('qmNpcIds'))
|
||||
{
|
||||
Util::$pageTemplate->extendGlobalIds(TYPE_NPC, $ids);
|
||||
|
||||
$qmStr = Lang::$faction['quartermaster'].Lang::$colon;
|
||||
|
||||
if (count($ids) == 1)
|
||||
$qmStr .= '[npc='.$ids[0].']';
|
||||
else if (count($ids) > 1)
|
||||
{
|
||||
$qmStr .= '[ul]';
|
||||
foreach ($ids as $id)
|
||||
$qmStr .= '[li][npc='.$id.'][/li]';
|
||||
|
||||
$qmStr .= '[/ul]';
|
||||
}
|
||||
|
||||
$infobox[] = $qmStr;
|
||||
}
|
||||
|
||||
// side if any
|
||||
if ($_ = $faction->getField('side'))
|
||||
$infobox[] = Lang::$main['side'].Lang::$colon.'[span class='.($_ == 1 ? 'alliance' : 'horde').'-icon]'.Lang::$game['si'][$_].'[/span]';
|
||||
|
||||
/****************/
|
||||
/* Main Content */
|
||||
/****************/
|
||||
|
||||
$pageData = array(
|
||||
'title' => $faction->getField('name', true),
|
||||
'path' => [0, 7],
|
||||
'relTabs' => [],
|
||||
'spillover' => null,
|
||||
'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null,
|
||||
'buttons' => array(
|
||||
BUTTON_WOWHEAD => true,
|
||||
BUTTON_LINKS => true
|
||||
),
|
||||
'page' => array(
|
||||
'name' => $faction->getField('name', true),
|
||||
'id' => $_id
|
||||
),
|
||||
);
|
||||
|
||||
if ($_ = $faction->getField('cat2'))
|
||||
$pageData['path'][] = $_;
|
||||
|
||||
if ($_ = $faction->getField('cat'))
|
||||
$pageData['path'][] = $_;
|
||||
|
||||
// Spillover Effects
|
||||
$conditions = array(
|
||||
['id', $_id, '!'], // not self
|
||||
['reputationIndex', -1, '!'] // only gainable
|
||||
);
|
||||
|
||||
if ($p = $faction->getField('parentFactionId')) // linked via parent
|
||||
$conditions[] = ['OR', ['id', $p], ['parentFactionId', $p]];
|
||||
else
|
||||
$conditions[] = ['parentFactionId', $_id]; // self as parent
|
||||
|
||||
$spillover = new FactionList($conditions);
|
||||
$spillover->addGlobalsToJscript(Util::$pageTemplate);
|
||||
$buff = [];
|
||||
|
||||
foreach ($spillover->iterate() as $spillId => $__)
|
||||
if ($val = ($spillover->getField('spilloverRateIn') * $faction->getField('spilloverRateOut') * 100))
|
||||
$buff[] = '[tr][td][faction='.$spillId.'][/td][td][span class=q'.($val > 0 ? '2]+' : '10]').$val.'%[/span][/td][td]'.Lang::$game['rep'][$spillover->getField('spilloverMaxRank')].'[/td][/tr]';
|
||||
|
||||
if ($buff)
|
||||
$pageData['spillover'] = '[h3 class=clear]'.Lang::$faction['spillover'].'[/h3][div margin=15px]'.Lang::$faction['spilloverDesc'].'[/div][table class=grid width=400px][tr][td width=150px][b]'.Util::ucFirst(Lang::$game['faction']).'[/b][/td][td width=100px][b]'.Lang::$spell['_value'].'[/b][/td][td width=150px][b]'.Lang::$faction['maxStanding'].'[/b][/td][/tr]'.implode('', $buff).'[/table]';
|
||||
|
||||
/**************/
|
||||
/* Extra Tabs */
|
||||
/**************/
|
||||
|
||||
// tab: items
|
||||
$items = new ItemList(array(['requiredFaction', $_id]));
|
||||
if (!$items->error)
|
||||
{
|
||||
$items->addGlobalsToJscript($smarty, GLOBALINFO_SELF);
|
||||
|
||||
$pageData['relTabs'][] = array(
|
||||
'file' => 'item',
|
||||
'data' => $items->getListviewData(),
|
||||
'showRep' => true,
|
||||
'params' => array(
|
||||
'tabs' => '$tabsRelated',
|
||||
'extraCols' => '$_',
|
||||
'sort' => "$['standing', 'name']",
|
||||
'note' => sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$_id.';crv=0')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// tab: creatures with onKill reputation
|
||||
$cIds = DB::Aowow()->selectCol('SELECT DISTINCT creature_id FROM creature_onkill_reputation cor, ?_factions f WHERE
|
||||
(RewOnKillRepValue1 > 0 AND (RewOnKillRepFaction1 = ?d OR (cor.RewOnKillRepFaction1 = f.id AND f.parentFactionId = ?d AND IsTeamAward1 <> 0))) OR
|
||||
(RewOnKillRepValue2 > 0 AND (RewOnKillRepFaction2 = ?d OR (cor.RewOnKillRepFaction2 = f.id AND f.parentFactionId = ?d AND IsTeamAward2 <> 0)))',
|
||||
$_id, $faction->getField('parentFactionId'),
|
||||
$_id, $faction->getField('parentFactionId')
|
||||
);
|
||||
$killCreatures = new CreatureList(array(['id', $cIds]));
|
||||
if (!$killCreatures->error)
|
||||
{
|
||||
$killCreatures->addGlobalsToJscript($smarty);
|
||||
|
||||
$pageData['relTabs'][] = array(
|
||||
'file' => 'npc',
|
||||
'data' => $killCreatures->getListviewData(),
|
||||
'showRep' => true,
|
||||
'params' => array(
|
||||
'tabs' => '$tabsRelated',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// tab: members
|
||||
$conditions = array(
|
||||
['factionA', $faction->getField('templateIds')],
|
||||
['factionH', $faction->getField('templateIds')],
|
||||
'OR'
|
||||
);
|
||||
|
||||
$killCreatures = new CreatureList($conditions);
|
||||
if (!$killCreatures->error)
|
||||
{
|
||||
$killCreatures->addGlobalsToJscript($smarty);
|
||||
|
||||
$pageData['relTabs'][] = array(
|
||||
'file' => 'npc',
|
||||
'data' => $killCreatures->getListviewData(),
|
||||
'showRep' => true,
|
||||
'params' => array(
|
||||
'id' => 'member',
|
||||
'name' => '$LANG.tab_member',
|
||||
'tabs' => '$tabsRelated',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// tab: quests
|
||||
$conditions = array(
|
||||
['AND', ['RewardFactionId1', $_id], ['OR', ['RewardFactionValueId1', 0, '>'], ['RewardFactionValueIdOverride1', 0, '>']]],
|
||||
['AND', ['RewardFactionId2', $_id], ['OR', ['RewardFactionValueId2', 0, '>'], ['RewardFactionValueIdOverride2', 0, '>']]],
|
||||
['AND', ['RewardFactionId3', $_id], ['OR', ['RewardFactionValueId3', 0, '>'], ['RewardFactionValueIdOverride3', 0, '>']]],
|
||||
['AND', ['RewardFactionId4', $_id], ['OR', ['RewardFactionValueId4', 0, '>'], ['RewardFactionValueIdOverride4', 0, '>']]],
|
||||
['AND', ['RewardFactionId5', $_id], ['OR', ['RewardFactionValueId5', 0, '>'], ['RewardFactionValueIdOverride5', 0, '>']]],
|
||||
'OR'
|
||||
);
|
||||
$quests = new QuestList($conditions);
|
||||
if (!$quests->error)
|
||||
{
|
||||
$quests->addGlobalsToJscript($smarty, GLOBALINFO_ANY);
|
||||
|
||||
$pageData['relTabs'][] = array(
|
||||
'file' => 'quest',
|
||||
'data' => $quests->getListviewData($_id),
|
||||
'showRep' => true,
|
||||
'params' => array(
|
||||
'tabs' => '$tabsRelated',
|
||||
'extraCols' => '$_',
|
||||
'note' => sprintf(Util::$filterResultString, '?quests?filter=cr=1;crs='.$_id.';crv=0')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// tab: achievements
|
||||
$conditions = array(
|
||||
['ac.type', ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION],
|
||||
['ac.value1', $_id]
|
||||
);
|
||||
$acvs = new AchievementList($conditions);
|
||||
if (!$acvs->error)
|
||||
{
|
||||
$acvs->addGlobalsToJscript($smarty, GLOBALINFO_ANY);
|
||||
|
||||
$pageData['relTabs'][] = array(
|
||||
'file' => 'achievement',
|
||||
'data' => $acvs->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'criteria-of',
|
||||
'name' => '$LANG.tab_criteriaof',
|
||||
'tabs' => '$tabsRelated',
|
||||
'visibleCols' => "$['category']"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$smarty->saveCache($cacheKeyPage, $pageData);
|
||||
}
|
||||
|
||||
|
||||
// menuId 7: Faction g_initPath()
|
||||
// tabId 0: Database g_initHeader()
|
||||
$smarty->updatePageVars(array(
|
||||
'title' => $pageData['title']." - ".Util::ucfirst(Lang::$game['skill']),
|
||||
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
|
||||
'tab' => 0,
|
||||
'type' => TYPE_FACTION,
|
||||
'typeId' => $_id
|
||||
));
|
||||
$smarty->assign('redButtons', $pageData['buttons']);
|
||||
$smarty->assign('community', CommunityContent::getAll(TYPE_FACTION, $_id)); // comments, screenshots, videos
|
||||
$smarty->assign('lang', array_merge(Lang::$main, [Lang::$colon]));
|
||||
$smarty->assign('lvData', $pageData);
|
||||
|
||||
// load the page
|
||||
$smarty->display('faction.tpl');
|
||||
|
||||
?>
|
||||
80
pages/factions.php
Normal file
80
pages/factions.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
$cats = Util::extractURLParams($pageParam);
|
||||
$path = [0, 7];
|
||||
$title = [Util::ucFirst(Lang::$game['factions'])];
|
||||
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_FACTION, -1, implode('.', $cats), User::$localeId]);
|
||||
$validCats = array(
|
||||
1118 => [469, 891, 67, 892, 169],
|
||||
980 => [936],
|
||||
1097 => [1037, 1052, 1117],
|
||||
0 => true
|
||||
);
|
||||
|
||||
if (!Util::isValidPage($validCats, $cats))
|
||||
$smarty->error();
|
||||
|
||||
if (!$smarty->loadCache($cacheKey, $pageData))
|
||||
{
|
||||
$conditions = [];
|
||||
|
||||
if (User::isInGroup(U_GROUP_STAFF))
|
||||
$conditions[] = ['reputationIndex', -1, '!']; // unlisted factions
|
||||
|
||||
if (isset($cats[0]) && empty($cats[1]))
|
||||
{
|
||||
if (!$cats[0])
|
||||
$conditions[] = ['f1.parentFactionId', [1118, 980, 1097, 469, 891, 67, 892, 169, 1037, 1052, 1117, 936], '!'];
|
||||
else
|
||||
{
|
||||
$subs = DB::Aowow()->selectCol('SELECT id FROM ?_factions WHERE parentFactionId = ?d', $cats[0]);
|
||||
$conditions[] = ['OR', ['f1.parentFactionId', $subs], ['f1.id', $subs]];
|
||||
}
|
||||
|
||||
$path[] = $cats[0];
|
||||
// array_unshift($title, Lang::$factions['cat'][$cats[0]]);
|
||||
}
|
||||
else if (!empty($cats[1]))
|
||||
{
|
||||
$conditions[] = ['f1.parentFactionId', $cats[1]];
|
||||
$path[] = $cats[0];
|
||||
$path[] = $cats[1];
|
||||
// array_unshift($title, Lang::$factions['cat'][$cats[1]]);
|
||||
}
|
||||
|
||||
$factions = new FactionList($conditions);
|
||||
|
||||
$pageData = array(
|
||||
'title' => $title,
|
||||
'path' => $path,
|
||||
'listviews' => array(
|
||||
array(
|
||||
'file' => 'faction',
|
||||
'data' => $factions->getListviewData(),
|
||||
'params' => []
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$smarty->saveCache($cacheKey, $pageData);
|
||||
}
|
||||
|
||||
|
||||
// menuId 7: Faction g_initPath()
|
||||
// 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('lvData', $pageData);
|
||||
|
||||
// load the page
|
||||
$smarty->display('generic-no-filter.tpl');
|
||||
|
||||
?>
|
||||
@@ -71,7 +71,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
}
|
||||
|
||||
// 2 recipe Items [items] (Books)
|
||||
$conditions = array(
|
||||
$skill2Filter = [null, 171, 164, 185, 333, 202, 129, 755, 165, 186, 197, null, null, 356, 182, 773];
|
||||
$conditions = array(
|
||||
['requiredSkill', $_id],
|
||||
['class', ITEM_CLASS_RECIPE],
|
||||
0
|
||||
@@ -89,7 +90,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
'id' => 'recipe-items',
|
||||
'name' => '$LANG.tab_recipeitems',
|
||||
'tabs' => '$tabsRelated',
|
||||
// 'note' => sprintf(Util::$filterResultString, "?items=9.subClass") // todo (med): after items
|
||||
'note' => !empty(array_flip($skill2Filter)[$_id]) ? sprintf(Util::$filterResultString, "?items=9.".array_flip($skill2Filter)[$_id]) : null
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -345,7 +346,6 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$smarty->saveCache($cacheKeyPage, $pageData);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ if (!$smarty->loadCache($cacheKey, $pageData))
|
||||
$skills = new SkillList($conditions);
|
||||
|
||||
$pageData = array(
|
||||
'title' => $title,
|
||||
'path' => $path,
|
||||
'listviews' => array(
|
||||
array(
|
||||
'file' => 'skill',
|
||||
|
||||
43
search.php
43
search.php
@@ -39,7 +39,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
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,
|
||||
todo 21: Listview - template: 'faction', id: 'factions', name: LANG.tab_factions,
|
||||
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,
|
||||
@@ -379,7 +379,7 @@ if ($searchMask & 0x80)
|
||||
{
|
||||
$conditions = array( // hmm, inclued classMounts..?
|
||||
['s.typeCat', [7, -2, -3]],
|
||||
[['s.cuFlags', (SPELL_CU_TRIGGERED | SPELL_CU_TALENT | SPELL_CU_EXCLUDE_CATEGORY_SEARCH), '&'], 0],
|
||||
[['s.cuFlags', (SPELL_CU_TRIGGERED | SPELL_CU_TALENT | CUSTOM_EXCLUDE_FOR_LISTVIEW), '&'], 0],
|
||||
[['s.attributes0', 0x80, '&'], 0],
|
||||
['s.name_loc'.User::$localeId, $query],
|
||||
$maxResults
|
||||
@@ -861,7 +861,7 @@ if ($searchMask & 0x80000)
|
||||
{
|
||||
$objects->addGlobalsToJScript($smarty);
|
||||
|
||||
$found['zone'] = array(
|
||||
$found['object'] = array(
|
||||
'type' => TYPE_OBJECT,
|
||||
'appendix' => ' (Object)',
|
||||
'matches' => $objects->getMatches(),
|
||||
@@ -874,14 +874,43 @@ if ($searchMask & 0x80000)
|
||||
|
||||
if ($objects->getMatches() > $maxResults)
|
||||
{
|
||||
$found['zone']['params']['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_objectsfound', $objects->getMatches(), $maxResults);
|
||||
$found['zone']['params']['_truncated'] = 1;
|
||||
$found['object']['params']['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_objectsfound', $objects->getMatches(), $maxResults);
|
||||
$found['object']['params']['_truncated'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 21 Factions
|
||||
// if ($searchMask & 0x100000)
|
||||
if ($searchMask & 0x100000)
|
||||
{
|
||||
$conditions = array(
|
||||
['name_loc'.User::$localeId, $query],
|
||||
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0],
|
||||
$maxResults
|
||||
);
|
||||
|
||||
$factions = new FactionList($conditions);
|
||||
|
||||
if ($data = $factions->getListviewData())
|
||||
{
|
||||
$found['faction'] = array(
|
||||
'type' => TYPE_FACTION,
|
||||
'appendix' => ' (Faction)',
|
||||
'matches' => $factions->getMatches(),
|
||||
'file' => 'faction',
|
||||
'data' => $data,
|
||||
'params' => [
|
||||
'tabs' => '$myTabs'
|
||||
]
|
||||
);
|
||||
|
||||
if ($factions->getMatches() > $maxResults)
|
||||
{
|
||||
$found['faction']['params']['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_factionsfound', $factions->getMatches(), $maxResults);
|
||||
$found['faction']['params']['_truncated'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 22 Skills
|
||||
if ($searchMask & 0x200000)
|
||||
@@ -985,7 +1014,7 @@ if ($searchMask & 0x1000000)
|
||||
{
|
||||
$conditions = array(
|
||||
['s.name_loc'.User::$localeId, $query],
|
||||
['OR', ['s.typeCat', [0, -9]], ['s.cuFlags', SPELL_CU_EXCLUDE_CATEGORY_SEARCH, '&']],
|
||||
['OR', ['s.typeCat', [0, -9]], ['s.cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&']],
|
||||
$maxResults
|
||||
);
|
||||
|
||||
|
||||
28
template/bricks/listviews/faction.tpl
Normal file
28
template/bricks/listviews/faction.tpl
Normal file
@@ -0,0 +1,28 @@
|
||||
{strip}
|
||||
new Listview({ldelim}
|
||||
template:'faction',
|
||||
{if !isset($params.id)}id:'factions',{/if}
|
||||
{if !isset($params.name)}name:LANG.tab_factions,{/if}
|
||||
{if !isset($params.parent)}parent:'lv-generic',{/if}
|
||||
{foreach from=$params key=k item=v}
|
||||
{if $v[0] == '$'}
|
||||
{$k}:{$v|substr:1},
|
||||
{else if $v}
|
||||
{$k}:'{$v}',
|
||||
{/if}
|
||||
{/foreach}
|
||||
data:[
|
||||
{foreach name=i from=$data item=curr}
|
||||
{ldelim}
|
||||
{foreach from=$curr key='name' item=val}
|
||||
{if $name != 'id'}
|
||||
{$name}:{$val|@json_encode:$smarty.const.JSON_NUMERIC_CHECK},
|
||||
{/if}
|
||||
{/foreach}
|
||||
id:{$curr.id}
|
||||
{rdelim}
|
||||
{if $smarty.foreach.i.last}{else},{/if}
|
||||
{/foreach}
|
||||
]
|
||||
{rdelim});
|
||||
{/strip}
|
||||
@@ -1,3 +1,24 @@
|
||||
{if !empty($tab.showRep)}
|
||||
var _ = [
|
||||
{ldelim}
|
||||
id: 'standing',
|
||||
after: 'reqlevel',
|
||||
name: LANG.standing,
|
||||
width: '12%',
|
||||
value: 'standing',
|
||||
type: 'text',
|
||||
getValue: function(item)
|
||||
{ldelim}
|
||||
return g_reputation_standings[item.standing];
|
||||
{rdelim},
|
||||
compute: function(item, td)
|
||||
{ldelim}
|
||||
return g_reputation_standings[item.standing];
|
||||
{rdelim}
|
||||
{rdelim}
|
||||
];
|
||||
{/if}
|
||||
|
||||
{strip}
|
||||
new Listview({ldelim}
|
||||
template:'item',
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
{if !empty($tab.showRep)}
|
||||
var _ = [
|
||||
{ldelim}
|
||||
id: 'reputation',
|
||||
after: 'rewards',
|
||||
name: LANG.rep,
|
||||
tooltip: LANG.tooltip_repgain,
|
||||
width: '8%',
|
||||
value: 'reputation'
|
||||
{rdelim}
|
||||
];
|
||||
{/if}
|
||||
|
||||
{strip}
|
||||
new Listview({ldelim}
|
||||
template:'quest',
|
||||
@@ -14,62 +27,12 @@
|
||||
data:[
|
||||
{foreach name=i from=$data item=curr}
|
||||
{ldelim}
|
||||
id:'{$curr.id}',
|
||||
name:'{$curr.name|escape:"quotes"}',
|
||||
level:'{$curr.level}',
|
||||
{if isset($curr.reqlevel)}
|
||||
reqlevel:{$curr.reqlevel},
|
||||
{/if}
|
||||
{if isset($curr.reqclass)}
|
||||
reqclass:{$curr.reqclass},
|
||||
{/if}
|
||||
{if isset($curr.reqrace)}
|
||||
reqrace:{$curr.reqrace},
|
||||
{/if}
|
||||
side:'{$curr.side}'
|
||||
{if isset($curr.itemrewards)}
|
||||
,itemrewards:[
|
||||
{section name=j loop=$curr.itemrewards}
|
||||
[{$curr.itemrewards[j][0]},{$curr.itemrewards[j][1]}]
|
||||
{if $smarty.section.j.last}{else},{/if}
|
||||
{/section}
|
||||
]
|
||||
{/if}
|
||||
{if isset($curr.itemchoices)}
|
||||
,itemchoices:[
|
||||
{section name=j loop=$curr.itemchoices}
|
||||
[{$curr.itemchoices[j][0]},{$curr.itemchoices[j][1]}]
|
||||
{if $smarty.section.j.last}{else},{/if}
|
||||
{/section}
|
||||
]
|
||||
{/if}
|
||||
{if $curr.xp}
|
||||
,xp:{$curr.xp}
|
||||
{/if}
|
||||
{if isset($curr.titlereward)}
|
||||
,titlereward:{$curr.titlereward}
|
||||
{/if}
|
||||
{if isset($curr.money)}
|
||||
,money:{$curr.money}
|
||||
{/if}
|
||||
{if isset($curr.category)}
|
||||
,category:{$curr.category}
|
||||
{/if}
|
||||
{if isset($curr.category2)}
|
||||
,category2:{$curr.category2}
|
||||
{/if}
|
||||
{if isset($curr.type)}
|
||||
,type:{$curr.type}
|
||||
{/if}
|
||||
{if isset($curr.daily)}
|
||||
,daily:1
|
||||
{/if}
|
||||
{if isset($curr.weekly)}
|
||||
,weekly:1
|
||||
{/if}
|
||||
{if $curr.wflags}
|
||||
,wflags:{$curr.wflags} {* wflags: &1: disabled/historical; &32: AutoAccept; &64: Hostile(?) *}
|
||||
{/if}
|
||||
{foreach from=$curr key='name' item=val}
|
||||
{if $name != 'id'}
|
||||
{$name}:{$val|@json_encode:$smarty.const.JSON_NUMERIC_CHECK},
|
||||
{/if}
|
||||
{/foreach}
|
||||
id:{$curr.id}
|
||||
{rdelim}
|
||||
{if $smarty.foreach.i.last}{else},{/if}
|
||||
{/foreach}
|
||||
|
||||
28
template/bricks/tooltip.tpl
Normal file
28
template/bricks/tooltip.tpl
Normal file
@@ -0,0 +1,28 @@
|
||||
<div id="ic{$page.typeId}" style="float: left"></div>
|
||||
<div id="tt{$page.typeId}" class="tooltip" style="float: left; padding-top: 1px"></div>
|
||||
<div style="clear: left"></div>
|
||||
<div id="sl{$page.typeId}" style="margin-left: 70px; margin-top: 4px;"></div>
|
||||
<div id="ks{$page.typeId}" style="margin-left: 70px; margin-top: 4px;"></div>
|
||||
|
||||
{if !empty($jsGlobals[6][2].buff)} {* not set with items *}
|
||||
<h3>{$lang._aura}</h3>
|
||||
<div id="btt{$page.typeId}" class="tooltip"></div>
|
||||
{/if}
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
$WH.ge('ic{$page.typeId}').appendChild(Icon.create('{$lvData.page.icon}', 2, null, 0, {$lvData.page.stack}));
|
||||
var
|
||||
tt = $WH.ge('tt{$page.typeId}'),
|
||||
{if !empty($jsGlobals[6][2].buff)}
|
||||
btt = $WH.ge('btt{$page.typeId}'),
|
||||
{/if}
|
||||
sl = $WH.ge('sl{$page.typeId}'),
|
||||
ks = $WH.ge('ks{$page.typeId}');
|
||||
|
||||
tt.innerHTML = '<table><tr><td>' + ($WH.g_enhanceTooltip.bind(tt))({$page.typeId}, true, true, sl, null, [{$page.typeId}], ks, null) + '</td><th style="background-position: top right"></th></tr><tr><th style="background-position: bottom left"></th><th style="background-position: bottom right"></th></tr></table>';
|
||||
$WH.Tooltip.fixSafe(tt, 1, 1);
|
||||
{if !empty($jsGlobals[6][2].buff)}
|
||||
btt.innerHTML = '<table><tr><td>' + ($WH.g_enhanceTooltip.bind(btt))({$page.typeId}, true, true, sl, tt, [{$page.typeId}], ks) + '</td><th style="background-position: top right"></th></tr><tr><th style="background-position: bottom left"></th><th style="background-position: bottom right"></th></tr></table>';
|
||||
$WH.Tooltip.fixSafe(btt, 1, 1);
|
||||
{/if}
|
||||
//]]></script>
|
||||
51
template/faction.tpl
Normal file
51
template/faction.tpl
Normal file
@@ -0,0 +1,51 @@
|
||||
{include file='header.tpl'}
|
||||
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
|
||||
{if !empty($announcements)}
|
||||
{foreach from=$announcements item=item}
|
||||
{include file='bricks/announcement.tpl' an=$item}
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
{include file='bricks/community.tpl'}
|
||||
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"quotes"}'{rdelim};
|
||||
g_initPath({$page.path});
|
||||
//]]></script>
|
||||
|
||||
{include file='bricks/infobox.tpl' info=$lvData.infobox}
|
||||
|
||||
<div class="text">
|
||||
|
||||
{include file='bricks/redButtons.tpl'}
|
||||
|
||||
<h1>{$lvData.page.name}</h1>
|
||||
|
||||
{include file='bricks/article.tpl'}
|
||||
|
||||
{if $lvData.spillover}
|
||||
<div id="spillover" class="left"></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
Markup.printHtml("{$lvData.spillover}", "spillover", {strip}{ldelim}
|
||||
allow: Markup.CLASS_ADMIN,
|
||||
dbpage: true
|
||||
{rdelim}{/strip});
|
||||
//]]></script>
|
||||
|
||||
<div class="pad2"></div>
|
||||
{/if}
|
||||
|
||||
<h2 class="clear">{$lang.related}</h2>
|
||||
</div>
|
||||
|
||||
{include file='bricks/tabsRelated.tpl' tabs=$lvData.relTabs}
|
||||
|
||||
{include file='bricks/contribute.tpl'}
|
||||
|
||||
</div><!-- main-contents -->
|
||||
</div><!-- main -->
|
||||
|
||||
{include file='footer.tpl'}
|
||||
20
template/factions.tpl
Normal file
20
template/factions.tpl
Normal file
@@ -0,0 +1,20 @@
|
||||
{include file='header.tpl'}
|
||||
|
||||
<div id="main">
|
||||
<div id="main-precontents"></div>
|
||||
<div id="main-contents" class="main-contents">
|
||||
<script type="text/javascript">
|
||||
g_initPath({$page.path});
|
||||
</script>
|
||||
|
||||
<div id="lv-factions" class="listview"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
{include file='bricks/factions_table.tpl' data=$factions.data params=$factions.params}
|
||||
</script>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file='footer.tpl'}
|
||||
@@ -507,7 +507,7 @@ var Markup = {
|
||||
unnamed: { req: false, valid: /^hidden$/i },
|
||||
'float': { req: false, valid: /^(left|right)$/i },
|
||||
align: { req: false, valid: /^(left|right|center)$/i },
|
||||
margin: { req: false, valid: /^\d+$/ },
|
||||
margin: { req: false, valid: /^\d+(px|em|\%)$/ },
|
||||
width: { req: false, valid: /^[0-9]+(px|em|\%)$/ }
|
||||
},
|
||||
allowedClass: MARKUP_CLASS_STAFF,
|
||||
@@ -1739,7 +1739,7 @@ var Markup = {
|
||||
if(g_quests[id] && g_quests[id][nameCol])
|
||||
{
|
||||
var quest = g_quests[id];
|
||||
return '<a href="' + url + '?quest=' + id + '"' + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/tiny/' + (quest.daily ? 'quest_start_daily' : 'quest_start') + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(quest[nameCol]) + '</span></a>';
|
||||
return '<a href="' + url + '?quest=' + id + '"' + (!attr.icon ? ' class="icontiny"><img src="' + g_staticUrl + '/images/icons/' + (quest.daily ? 'quest_start_daily' : 'quest_start') + '.gif"' : '') + Markup._addGlobalAttributes(attr) + ' align="absmiddle" /> <span class="tinyicontxt">' + Markup._safeHtml(quest[nameCol]) + '</span></a>';
|
||||
}
|
||||
return '<a href="' + url + '?quest=' + id + '"' + Markup._addGlobalAttributes(attr) + '>(' + LANG.types[5][0] + ' #' + id + ')</a>';
|
||||
},
|
||||
|
||||
@@ -825,132 +825,164 @@ function g_formatTimeSimple(d, txt, noPrefix) {
|
||||
return txt;
|
||||
}
|
||||
|
||||
function g_cleanCharacterName(e) {
|
||||
var d = "";
|
||||
for (var c = 0, a = e.length; c < a; ++c) {
|
||||
var b = e.charAt(c).toLowerCase();
|
||||
if (b >= "a" && b <= "z") {
|
||||
d += b
|
||||
} else {
|
||||
d += e.charAt(c)
|
||||
}
|
||||
}
|
||||
return d
|
||||
}
|
||||
function g_createGlow(a, h) {
|
||||
var e = $WH.ce("span");
|
||||
for (var c = -1; c <= 1; ++c) {
|
||||
for (var b = -1; b <= 1; ++b) {
|
||||
var g = $WH.ce("div");
|
||||
g.style.position = "absolute";
|
||||
g.style.whiteSpace = "nowrap";
|
||||
g.style.left = c + "px";
|
||||
g.style.top = b + "px";
|
||||
if (c == 0 && b == 0) {
|
||||
g.style.zIndex = 4
|
||||
} else {
|
||||
g.style.color = "black";
|
||||
g.style.zIndex = 2
|
||||
function g_createGlow(txt, cn) {
|
||||
var s = $WH.ce('span');
|
||||
|
||||
for (var i = -1; i <= 1; ++i) {
|
||||
for (var j = -1; j <= 1; ++j) {
|
||||
var d = $WH.ce('div');
|
||||
d.style.position = 'absolute';
|
||||
d.style.whiteSpace = 'nowrap';
|
||||
d.style.left = i + 'px';
|
||||
d.style.top = j + 'px';
|
||||
|
||||
if (i == 0 && j == 0) {
|
||||
d.style.zIndex = 4;
|
||||
}
|
||||
g.innerHTML = a;
|
||||
$WH.ae(e, g)
|
||||
else {
|
||||
d.style.color = 'black';
|
||||
d.style.zIndex = 2;
|
||||
}
|
||||
//$WH.ae(d, $WH.ct(txt));
|
||||
d.innerHTML = txt;
|
||||
$WH.ae(s, d);
|
||||
}
|
||||
}
|
||||
e.style.position = "relative";
|
||||
e.className = "glow" + (h != null ? " " + h: "");
|
||||
var f = $WH.ce("span");
|
||||
f.style.visibility = "hidden";
|
||||
$WH.ae(f, $WH.ct(a));
|
||||
$WH.ae(e, f);
|
||||
return e
|
||||
|
||||
s.style.position = 'relative';
|
||||
s.className = 'glow' + (cn != null ? ' ' + cn : '');
|
||||
|
||||
var ph = $WH.ce('span');
|
||||
ph.style.visibility = 'hidden';
|
||||
$WH.ae(ph, $WH.ct(txt));
|
||||
$WH.ae(s, ph);
|
||||
|
||||
return s;
|
||||
}
|
||||
function g_createProgressBar(c) {
|
||||
if (c == null) {
|
||||
c = {}
|
||||
|
||||
function g_createProgressBar(opt) {
|
||||
if (opt == null) {
|
||||
opt = {};
|
||||
}
|
||||
if (!c.text) {
|
||||
c.text = " "
|
||||
|
||||
if (typeof opt.text == 'undefined') {
|
||||
opt.text = ' ';
|
||||
}
|
||||
if (c.color == null) {
|
||||
c.color = "rep0"
|
||||
|
||||
if (opt.color == null) {
|
||||
opt.color = 'rep0';
|
||||
|
||||
}
|
||||
if (c.width == null || c.width > 100) {
|
||||
c.width = 100
|
||||
if (opt.width == null || opt.width > 100) {
|
||||
opt.width = 100;
|
||||
}
|
||||
var d, e;
|
||||
if (c.hoverText) {
|
||||
d = $WH.ce("a");
|
||||
d.href = "javascript:;"
|
||||
} else {
|
||||
d = $WH.ce("span")
|
||||
|
||||
var el, div;
|
||||
if (opt.hoverText) {
|
||||
el = $WH.ce('a');
|
||||
el.href = 'javascript:;';
|
||||
}
|
||||
d.className = "progressbar";
|
||||
if (c.text || c.hoverText) {
|
||||
e = $WH.ce("div");
|
||||
e.className = "progressbar-text";
|
||||
if (c.text) {
|
||||
var a = $WH.ce("del");
|
||||
$WH.ae(a, $WH.ct(c.text));
|
||||
$WH.ae(e, a)
|
||||
else {
|
||||
el = $WH.ce('span');
|
||||
}
|
||||
|
||||
el.className = 'progressbar';
|
||||
|
||||
if (opt.text || opt.hoverText) {
|
||||
div = $WH.ce('div');
|
||||
div.className = 'progressbar-text';
|
||||
|
||||
if (opt.text) {
|
||||
var del = $WH.ce('del');
|
||||
$WH.ae(del, $WH.ct(opt.text));
|
||||
$WH.ae(div, del);
|
||||
}
|
||||
if (c.hoverText) {
|
||||
var b = $WH.ce("ins");
|
||||
$WH.ae(b, $WH.ct(c.hoverText));
|
||||
$WH.ae(e, b)
|
||||
|
||||
if (opt.hoverText) {
|
||||
var ins = $WH.ce('ins');
|
||||
$WH.ae(ins, $WH.ct(opt.hoverText));
|
||||
$WH.ae(div, ins);
|
||||
}
|
||||
$WH.ae(d, e)
|
||||
|
||||
$WH.ae(el, div);
|
||||
}
|
||||
e = $WH.ce("div");
|
||||
e.className = "progressbar-" + c.color;
|
||||
e.style.width = c.width + "%";
|
||||
$WH.ae(e, $WH.ct(String.fromCharCode(160)));
|
||||
$WH.ae(d, e);
|
||||
return d
|
||||
|
||||
div = $WH.ce('div');
|
||||
div.className = 'progressbar-' + opt.color;
|
||||
div.style.width = opt.width + '%';
|
||||
if (opt.height) {
|
||||
div.style.height = opt.height;
|
||||
}
|
||||
|
||||
$WH.ae(div, $WH.ct(String.fromCharCode(160)));
|
||||
$WH.ae(el, div);
|
||||
|
||||
if (opt.text) {
|
||||
var div = $WH.ce('div');
|
||||
div.className = 'progressbar-text progressbar-hidden';
|
||||
$WH.ae(div, $WH.ct(opt.text));
|
||||
$WH.ae(el, div);
|
||||
}
|
||||
|
||||
return el;
|
||||
}
|
||||
function g_createReputationBar(g) {
|
||||
var f = g_createReputationBar.P;
|
||||
if (!g) {
|
||||
g = 0
|
||||
|
||||
function g_createReputationBar(totalRep) {
|
||||
var P = g_createReputationBar.P;
|
||||
|
||||
if (!totalRep) {
|
||||
totalRep = 0;
|
||||
}
|
||||
g += 42000;
|
||||
if (g < 0) {
|
||||
g = 0
|
||||
} else {
|
||||
if (g > 84999) {
|
||||
g = 84999
|
||||
|
||||
totalRep += 42000;
|
||||
if (totalRep < 0) {
|
||||
totalRep = 0;
|
||||
}
|
||||
else if (totalRep > 84999) {
|
||||
totalRep = 84999;
|
||||
}
|
||||
|
||||
var
|
||||
currentRep = totalRep,
|
||||
maxRep,
|
||||
standing = 0;
|
||||
|
||||
for (var i = 0, len = P.length; i < len; ++i) {
|
||||
if (P[i] > currentRep) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < len - 1) {
|
||||
currentRep -= P[i];
|
||||
standing = i + 1;
|
||||
}
|
||||
}
|
||||
var e = g,
|
||||
h, b = 0;
|
||||
for (var d = 0, a = f.length; d < a; ++d) {
|
||||
if (f[d] > e) {
|
||||
break
|
||||
}
|
||||
if (d < a - 1) {
|
||||
e -= f[d];
|
||||
b = d + 1
|
||||
}
|
||||
}
|
||||
h = f[b];
|
||||
var c = {
|
||||
text: g_reputation_standings[b],
|
||||
hoverText: e + " / " + h,
|
||||
color: "rep" + b,
|
||||
width: parseInt(e / h * 100)
|
||||
|
||||
maxRep = P[standing];
|
||||
|
||||
var opt = {
|
||||
text: g_reputation_standings[standing],
|
||||
hoverText: currentRep + ' / ' + maxRep,
|
||||
color: 'rep' + standing,
|
||||
width: parseInt(currentRep / maxRep * 100)
|
||||
};
|
||||
return g_createProgressBar(c)
|
||||
|
||||
return g_createProgressBar(opt);
|
||||
}
|
||||
g_createReputationBar.P = [36000, 3000, 3000, 3000, 6000, 12000, 21000, 999];
|
||||
function g_createAchievementBar(b, d, a) {
|
||||
if (!b) {
|
||||
b = 0
|
||||
|
||||
function g_createAchievementBar(points, outOf, overall, bonus) {
|
||||
if (!points) {
|
||||
points = 0;
|
||||
}
|
||||
var c = {
|
||||
text: b + (d > 0 ? " / " + d: ""),
|
||||
color: (a ? "rep7": "ach" + (d > 0 ? 0 : 1)),
|
||||
width: (d > 0 ? parseInt(b / d * 100) : 100)
|
||||
|
||||
var opt = {
|
||||
text: points + (bonus > 0 ? '(+' + bonus + ')': '') + (outOf > 0 ? ' / ' + outOf: ''),
|
||||
color: (overall ? 'rep7' : 'ach' + (outOf > 0 ? 0 : 1)),
|
||||
width: (outOf > 0 ? parseInt(points / outOf * 100) : 100)
|
||||
};
|
||||
return g_createProgressBar(c)
|
||||
|
||||
return g_createProgressBar(opt);
|
||||
}
|
||||
|
||||
function g_getMoneyHtml(money, side, costItems, costCurrency, achievementPoints) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
{include file='bricks/redButtons.tpl'}
|
||||
|
||||
<h1 class="h1-icon">{$lvData.page.name}</h1>
|
||||
<h1>{$lvData.page.name}</h1>
|
||||
|
||||
{include file='bricks/article.tpl'}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user