Template/Update (Part 28)

* convert dbtype 'faction'
This commit is contained in:
Sarjuuk
2025-08-11 21:14:29 +02:00
parent 79c937e0a3
commit a824bb106c
9 changed files with 213 additions and 168 deletions

View File

@@ -6,55 +6,69 @@ if (!defined('AOWOW_REVISION'))
die('illegal access'); die('illegal access');
// menuId 7: Faction g_initPath() class FactionBaseResponse extends TemplateResponse implements ICache
// tabId 0: Database g_initHeader()
class FactionPage extends GenericPage
{ {
use TrDetailPage; use TrDetailPage, TrCache;
protected $type = Type::FACTION; protected int $cacheType = CACHE_TYPE_PAGE;
protected $typeId = 0;
protected $tpl = 'detail-page-generic';
protected $path = [0, 7];
protected $tabId = 0;
protected $mode = CACHE_TYPE_PAGE;
public function __construct($pageCall, $id) protected string $template = 'detail-page-generic';
protected string $pageName = 'faction';
protected ?int $activeTab = parent::TAB_DATABASE;
protected array $breadcrumb = [0, 7];
public int $type = Type::FACTION;
public int $typeId = 0;
private FactionList $subject;
public function __construct(string $id)
{ {
parent::__construct($pageCall, $id); parent::__construct($id);
$this->typeId = intVal($id); $this->typeId = intVal($id);
$this->contribute = Type::getClassAttrib($this->type, 'contribute') ?? CONTRIBUTE_NONE;
$this->subject = new FactionList(array(['id', $this->typeId]));
if ($this->subject->error)
$this->notFound(Lang::game('faction'), Lang::faction('notFound'));
$this->name = $this->subject->getField('name', true);
} }
protected function generatePath() protected function generate() : void
{ {
$this->subject = new FactionList(array(['id', $this->typeId]));
if ($this->subject->error)
$this->generateNotFound(Lang::game('faction'), Lang::faction('notFound'));
$this->h1 = $this->subject->getField('name', true);
$this->gPageInfo += array(
'type' => $this->type,
'typeId' => $this->typeId,
'name' => $this->h1
);
/*************/
/* Menu Path */
/*************/
array_unshift($this->title, $this->h1, Util::ucFirst(Lang::game('faction')));
/**************/
/* Page Title */
/**************/
if ($foo = $this->subject->getField('cat')) if ($foo = $this->subject->getField('cat'))
{ {
if ($bar = $this->subject->getField('cat2')) if ($bar = $this->subject->getField('cat2'))
$this->path[] = $bar; $this->breadcrumb[] = $bar;
$this->path[] = $foo; $this->breadcrumb[] = $foo;
} }
}
protected function generateTitle()
{
array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::game('faction')));
}
protected function generateContent()
{
$this->addScript([SC_JS_FILE, '?data=zones']);
/***********/ /***********/
/* Infobox */ /* Infobox */
/***********/ /***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags')); $infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// Quartermaster if any // Quartermaster if any
@@ -62,7 +76,7 @@ class FactionPage extends GenericPage
{ {
$this->extendGlobalIds(Type::NPC, ...$ids); $this->extendGlobalIds(Type::NPC, ...$ids);
$qmStr = Lang::faction('quartermaster').Lang::main('colon'); $qmStr = Lang::faction('quartermaster');
if (count($ids) == 1) if (count($ids) == 1)
$qmStr .= '[npc='.$ids[0].']'; $qmStr .= '[npc='.$ids[0].']';
@@ -80,14 +94,16 @@ class FactionPage extends GenericPage
// side if any // side if any
if ($_ = $this->subject->getField('side')) if ($_ = $this->subject->getField('side'))
$infobox[] = Lang::main('side').Lang::main('colon').'[span class=icon-'.($_ == 1 ? 'alliance' : 'horde').']'.Lang::game('si', $_).'[/span]'; $infobox[] = Lang::main('side').'[span class=icon-'.($_ == SIDE_ALLIANCE ? 'alliance' : 'horde').']'.Lang::game('si', $_).'[/span]';
if ($infobox)
$this->infobox = new InfoboxMarkup($infobox, ['allow' => Markup::CLASS_STAFF, 'dbpage' => true], 'infobox-contents0');
/****************/ /****************/
/* Main Content */ /* Main Content */
/****************/ /****************/
$this->extraText = '';
$this->infobox = $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null;
$this->redButtons = array( $this->redButtons = array(
BUTTON_WOWHEAD => true, BUTTON_WOWHEAD => true,
BUTTON_LINKS => ['type' => $this->type, 'typeId' => $this->typeId] BUTTON_LINKS => ['type' => $this->type, 'typeId' => $this->typeId]
@@ -122,11 +138,14 @@ class FactionPage extends GenericPage
$buff .= '[tr][td][faction='.$spillId.'][/td][td][span class=q'.($val > 0 ? '2]+' : '10]').$val.'%[/span][/td][td]'.Lang::game('rep', $spillover->getField('spilloverMaxRank')).'[/td][/tr]'; $buff .= '[tr][td][faction='.$spillId.'][/td][td][span class=q'.($val > 0 ? '2]+' : '10]').$val.'%[/span][/td][td]'.Lang::game('rep', $spillover->getField('spilloverMaxRank')).'[/td][/tr]';
if ($buff) if ($buff)
$this->extraText .= '[h3 class=clear]'.Lang::faction('spillover').'[/h3][div margin=15px]'.Lang::faction('spilloverDesc').'[/div][table class=grid width=400px][tr][td width=150px][b]'.Util::ucFirst(Lang::game('faction')).'[/b][/td][td width=100px][b]'.Lang::spell('_value').'[/b][/td][td width=150px][b]'.Lang::faction('maxStanding').'[/b][/td][/tr]'.$buff.'[/table]'; $this->extraText = new Markup(
'[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]'.$buff.'[/table]',
['dbpage' => true, 'allow' => Markup::CLASS_ADMIN],
'text-generic'
);
// reward rates (ultimately this should be calculated into each reward display) // reward rates (ultimately this should be calculated into each reward display)
if ($rates = DB::World()->selectRow('SELECT * FROM reputation_reward_rate WHERE faction = ?d', $this->typeId)) if ($rates = DB::World()->selectRow('SELECT `quest_rate`, `quest_daily_rate`, `quest_weekly_rate`, `quest_monthly_rate`, `quest_repeatable_rate`, `creature_rate`, `spell_rate` FROM reputation_reward_rate WHERE `faction` = ?d', $this->typeId))
{ {
$buff = ''; $buff = '';
foreach ($rates as $k => $v) foreach ($rates as $k => $v)
@@ -134,46 +153,48 @@ class FactionPage extends GenericPage
if ($v == 1) if ($v == 1)
continue; continue;
switch ($k) $head = match ($k)
{ {
case 'quest_rate': $buff .= '[tr][td]'.Lang::game('quests') .Lang::main('colon').'[/td]'; break; 'quest_rate' => Lang::game('quests'),
case 'quest_daily_rate': $buff .= '[tr][td]'.Lang::game('quests').' ('.Lang::quest('daily').')' .Lang::main('colon').'[/td]'; break; 'quest_daily_rate' => Lang::game('quests').' ('.Lang::quest('daily').')',
case 'quest_weekly_rate': $buff .= '[tr][td]'.Lang::game('quests').' ('.Lang::quest('weekly').')' .Lang::main('colon').'[/td]'; break; 'quest_weekly_rate' => Lang::game('quests').' ('.Lang::quest('weekly').')',
case 'quest_monthly_rate': $buff .= '[tr][td]'.Lang::game('quests').' ('.Lang::quest('monthly').')' .Lang::main('colon').'[/td]'; break; 'quest_monthly_rate' => Lang::game('quests').' ('.Lang::quest('monthly').')',
case 'quest_repeatable_rate': $buff .= '[tr][td]'.Lang::game('quests').' ('.Lang::quest('repeatable').')'.Lang::main('colon').'[/td]'; break; 'quest_repeatable_rate' => Lang::game('quests').' ('.Lang::quest('repeatable').')',
case 'creature_rate': $buff .= '[tr][td]'.Lang::game('npcs') .Lang::main('colon').'[/td]'; break; 'creature_rate' => Lang::game('npcs'),
case 'spell_rate': $buff .= '[tr][td]'.Lang::game('spells') .Lang::main('colon').'[/td]'; break; 'spell_rate' => Lang::game('spells')
default: };
continue 2;
}
$buff .= '[td width=35px align=right][span class=q'.($v < 1 ? '10]' : '2]+').intVal(($v - 1) * 100).'%[/span][/td][/tr]'; $buff .= '[tr][td]'.$head.Lang::main('colon').'[/td][td width=35px align=right][span class=q'.($v < 1 ? '10]' : '2]+').intVal(($v - 1) * 100).'%[/span][/td][/tr]';
} }
if ($buff) if ($buff && $this->extraText)
$this->extraText .= '[h3 class=clear]'.Lang::faction('customRewRate').'[/h3][table]'.$buff.'[/table]'; $this->extraText->append('[h3 class=clear]'.Lang::faction('customRewRate').'[/h3][table class=grid width=250px]'.$buff.'[/table]');
else if ($buff)
$this->extraText = new Markup('[h3 class=clear]'.Lang::faction('customRewRate').'[/h3][table class=grid width=250px]'.$buff.'[/table]', ['dbpage' => true, 'allow' => Markup::CLASS_ADMIN], 'text-generic');
} }
// factionchange-equivalent // factionchange-equivalent
if ($pendant = DB::World()->selectCell('SELECT IF(horde_id = ?d, alliance_id, -horde_id) FROM player_factionchange_reputations WHERE alliance_id = ?d OR horde_id = ?d', $this->typeId, $this->typeId, $this->typeId)) if ($pendant = DB::World()->selectCell('SELECT IF(`horde_id` = ?d, `alliance_id`, -`horde_id`) FROM player_factionchange_reputations WHERE `alliance_id` = ?d OR `horde_id` = ?d', $this->typeId, $this->typeId, $this->typeId))
{ {
$altFac = new FactionList(array(['id', abs($pendant)])); $altFac = new FactionList(array(['id', abs($pendant)]));
if (!$altFac->error) if (!$altFac->error)
{ {
$this->transfer = sprintf( $this->transfer = Lang::faction('_transfer', array(
Lang::faction('_transfer'),
$altFac->id, $altFac->id,
$altFac->getField('name', true), $altFac->getField('name', true),
$pendant > 0 ? 'alliance' : 'horde', $pendant > 0 ? 'alliance' : 'horde',
$pendant > 0 ? Lang::game('si', 1) : Lang::game('si', 2) $pendant > 0 ? Lang::game('si', SIDE_ALLIANCE) : Lang::game('si', SIDE_HORDE)
); ));
} }
} }
/**************/ /**************/
/* Extra Tabs */ /* Extra Tabs */
/**************/ /**************/
$this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"], 'tabsRelated', true);
// tab: items // tab: items
$items = new ItemList(array(['requiredFaction', $this->typeId]), ['calcTotal' => true]); $items = new ItemList(array(['requiredFaction', $this->typeId]), ['calcTotal' => true]);
if (!$items->error) if (!$items->error)
@@ -181,7 +202,7 @@ class FactionPage extends GenericPage
$this->extendGlobalData($items->getJSGlobals(GLOBALINFO_SELF)); $this->extendGlobalData($items->getJSGlobals(GLOBALINFO_SELF));
$tabData = array( $tabData = array(
'data' => array_values($items->getListviewData()), 'data' => $items->getListviewData(),
'extraCols' => '$_', 'extraCols' => '$_',
'sort' => ['standing', 'name'] 'sort' => ['standing', 'name']
); );
@@ -189,16 +210,17 @@ class FactionPage extends GenericPage
if ($items->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) if ($items->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
$tabData['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$this->typeId.';crv=0'); $tabData['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$this->typeId.';crv=0');
$this->lvTabs[] = [ItemList::$brickFile, $tabData, 'itemStandingCol']; $this->lvTabs->addListviewTab(new Listview($tabData, ItemList::$brickFile, 'itemStandingCol'));
} }
// tab: creatures with onKill reputation // tab: creatures with onKill reputation
if ($this->subject->getField('reputationIndex') != -1) // only if you can actually gain reputation by kills // only if you can actually gain reputation by kills
if ($this->subject->getField('reputationIndex') != -1)
{ {
// inherit siblings/children from $spillover // inherit siblings/children from $spillover
$cRep = DB::World()->selectCol('SELECT DISTINCT creature_id AS ARRAY_KEY, qty FROM ( $cRep = DB::World()->selectCol('SELECT DISTINCT `creature_id` AS ARRAY_KEY, `qty` FROM (
SELECT creature_id, RewOnKillRepValue1 as qty FROM creature_onkill_reputation WHERE RewOnKillRepValue1 > 0 AND (RewOnKillRepFaction1 = ?d{ OR (RewOnKillRepFaction1 IN (?a) AND IsTeamAward1 <> 0)}) UNION SELECT `creature_id`, `RewOnKillRepValue1` as "qty" FROM creature_onkill_reputation WHERE `RewOnKillRepValue1` > 0 AND (`RewOnKillRepFaction1` = ?d { OR (`RewOnKillRepFaction1` IN (?a) AND `IsTeamAward1` <> 0) } ) UNION
SELECT creature_id, RewOnKillRepValue2 as qty FROM creature_onkill_reputation WHERE RewOnKillRepValue2 > 0 AND (RewOnKillRepFaction2 = ?d{ OR (RewOnKillRepFaction2 IN (?a) AND IsTeamAward2 <> 0)}) SELECT `creature_id`, `RewOnKillRepValue2` as "qty" FROM creature_onkill_reputation WHERE `RewOnKillRepValue2` > 0 AND (`RewOnKillRepFaction2` = ?d { OR (`RewOnKillRepFaction2` IN (?a) AND `IsTeamAward2` <> 0) } )
) x', ) x',
$this->typeId, $spillover->getFoundIDs() ?: DBSIMPLE_SKIP, $this->typeId, $spillover->getFoundIDs() ?: DBSIMPLE_SKIP,
$this->typeId, $spillover->getFoundIDs() ?: DBSIMPLE_SKIP $this->typeId, $spillover->getFoundIDs() ?: DBSIMPLE_SKIP
@@ -214,7 +236,7 @@ class FactionPage extends GenericPage
$d['reputation'] = $cRep[$id]; $d['reputation'] = $cRep[$id];
$tabData = array( $tabData = array(
'data' => array_values($data), 'data' => $data,
'extraCols' => '$_', 'extraCols' => '$_',
'sort' => ['-reputation', 'name'] 'sort' => ['-reputation', 'name']
); );
@@ -222,7 +244,8 @@ class FactionPage extends GenericPage
if ($killCreatures->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) if ($killCreatures->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
$tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=42;crs='.$this->typeId.';crv=0'); $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=42;crs='.$this->typeId.';crv=0');
$this->lvTabs[] = [CreatureList::$brickFile, $tabData, 'npcRepCol']; $this->addDataLoader('zones');
$this->lvTabs->addListviewTab(new Listview($tabData, CreatureList::$brickFile, 'npcRepCol'));
} }
} }
} }
@@ -234,7 +257,7 @@ class FactionPage extends GenericPage
if (!$members->error) if (!$members->error)
{ {
$tabData = array( $tabData = array(
'data' => array_values($members->getListviewData()), 'data' => $members->getListviewData(),
'id' => 'member', 'id' => 'member',
'name' => '$LANG.tab_members' 'name' => '$LANG.tab_members'
); );
@@ -242,7 +265,8 @@ class FactionPage extends GenericPage
if ($members->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) if ($members->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
$tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=3;crs='.$this->typeId.';crv=0'); $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=3;crs='.$this->typeId.';crv=0');
$this->lvTabs[] = [CreatureList::$brickFile, $tabData]; $this->addDataLoader('zones');
$this->lvTabs->addListviewTab(new Listview($tabData, CreatureList::$brickFile));
} }
} }
@@ -251,7 +275,10 @@ class FactionPage extends GenericPage
{ {
$objects = new GameObjectList(array(['faction', $_])); $objects = new GameObjectList(array(['faction', $_]));
if (!$objects->error) if (!$objects->error)
$this->lvTabs[] = [GameObjectList::$brickFile, ['data' => array_values($objects->getListviewData())]]; {
$this->addDataLoader('zones');
$this->lvTabs->addListviewTab(new Listview(['data' => $objects->getListviewData()], GameObjectList::$brickFile));
}
} }
// tab: quests // tab: quests
@@ -269,14 +296,14 @@ class FactionPage extends GenericPage
$this->extendGlobalData($quests->getJSGlobals(GLOBALINFO_ANY)); $this->extendGlobalData($quests->getJSGlobals(GLOBALINFO_ANY));
$tabData = array( $tabData = array(
'data' => array_values($quests->getListviewData($this->typeId)), 'data' => $quests->getListviewData($this->typeId),
'extraCols' => '$_' 'extraCols' => '$_'
); );
if ($quests->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) if ($quests->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
$tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=1;crs='.$this->typeId.';crv=0'); $tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=1;crs='.$this->typeId.';crv=0');
$this->lvTabs[] = [QuestList::$brickFile, $tabData, 'questRepCol']; $this->lvTabs->addListviewTab(new Listview($tabData, QuestList::$brickFile, 'questRepCol'));
} }
// tab: achievements // tab: achievements
@@ -289,12 +316,12 @@ class FactionPage extends GenericPage
{ {
$this->extendGlobalData($acvs->getJSGlobals(GLOBALINFO_ANY)); $this->extendGlobalData($acvs->getJSGlobals(GLOBALINFO_ANY));
$this->lvTabs[] = [AchievementList::$brickFile, array( $this->lvTabs->addListviewTab(new Listview(array(
'data' => array_values($acvs->getListviewData()), 'data' => $acvs->getListviewData(),
'id' => 'criteria-of', 'id' => 'criteria-of',
'name' => '$LANG.tab_criteriaof', 'name' => '$LANG.tab_criteriaof',
'visibleCols' => ['category'] 'visibleCols' => ['category']
)]; ), AchievementList::$brickFile));
} }
// tab: condition-for // tab: condition-for
@@ -303,8 +330,10 @@ class FactionPage extends GenericPage
if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for')) if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for'))
{ {
$this->extendGlobalData($cnd->getJsGlobals()); $this->extendGlobalData($cnd->getJsGlobals());
$this->lvTabs[] = $tab; $this->lvTabs->addDataTab(...$tab);
} }
parent::generate();
} }
} }

View File

@@ -0,0 +1,104 @@
<?php
namespace Aowow;
if (!defined('AOWOW_REVISION'))
die('illegal access');
class FactionsBaseResponse extends TemplateResponse implements ICache
{
use TrListPage, TrCache;
protected int $type = Type::FACTION;
protected int $cacheType = CACHE_TYPE_PAGE;
protected string $template = 'list-page-generic';
protected string $pageName = 'factions';
protected ?int $activeTab = parent::TAB_DATABASE;
protected array $breadcrumb = [0, 7];
protected array $validCats = array(
1118 => [469, 891, 67, 892, 169],
980 => [936],
1097 => [1037, 1052, 1117],
0 => true
);
public function __construct(string $pageParam)
{
$this->getCategoryFromUrl($pageParam);
parent::__construct($pageParam);
}
protected function generate() : void
{
$this->h1 = Util::ucFirst(Lang::game('factions'));
/**************/
/* Page Title */
/**************/
array_unshift($this->title, $this->h1);
if ($this->category)
{
switch (count($this->category))
{
case 1:
$t = Lang::faction('cat', $this->category[0]);
array_unshift($this->title, is_array($t) ? $t[0] : $t);
break;
case 2:
array_unshift($this->title, Lang::faction('cat', $this->category[0], $this->category[1]));
break;
}
}
/*************/
/* Menu Path */
/*************/
foreach ($this->category as $c)
$this->breadcrumb[] = $c;
/****************/
/* Main Content */
/****************/
$this->redButtons[BUTTON_WOWHEAD] = true;
$conditions = [];
if (!User::isInGroup(U_GROUP_EMPLOYEE)) // unlisted factions
$conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
if (isset($this->category[1]))
$conditions[] = ['parentFactionId', $this->category[1]];
else if (isset($this->category[0]))
{
if ($this->category[0])
$subs = DB::Aowow()->selectCol('SELECT `id` FROM ?_factions WHERE `parentFactionId` = ?d', $this->category[0]);
else
$subs = [0];
$conditions[] = ['OR', ['parentFactionId', $subs], ['id', $subs]];
}
$data = [];
$factions = new FactionList($conditions);
if (!$factions->error)
$data = $factions->getListviewData();
$this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]);
$this->lvTabs->addListviewTab(new Listview(['data' => $data], FactionList::$brickFile));
parent::generate();
}
}
?>

View File

@@ -1430,7 +1430,7 @@ $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: ",
'customRewRate' => "Abweichende Belohnungsraten", 'customRewRate' => "Abweichende Belohnungsraten",
'_transfer' => 'Die Reputation mit dieser Fraktion wird mit dem für <a href="?faction=%d" class="q1">%s</a> vertauscht, wenn Ihr zur <span class="icon-%s">%s</span> wechselt.', '_transfer' => 'Die Reputation mit dieser Fraktion wird mit dem für <a href="?faction=%d" class="q1">%s</a> vertauscht, wenn Ihr zur <span class="icon-%s">%s</span> wechselt.',
'cat' => array( 'cat' => array(

View File

@@ -1430,7 +1430,7 @@ $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: ",
'customRewRate' => "Custom Reward Rate", 'customRewRate' => "Custom Reward Rate",
'_transfer' => 'The reputation with this faction will be converted to <a href="?faction=%d" class="q1">%s</a> if you transfer to <span class="icon-%s">%s</span>.', '_transfer' => 'The reputation with this faction will be converted to <a href="?faction=%d" class="q1">%s</a> if you transfer to <span class="icon-%s">%s</span>.',
'cat' => array( 'cat' => array(

View File

@@ -1430,7 +1430,7 @@ $lang = array(
'spillover' => "Excedente de reputación", 'spillover' => "Excedente de reputación",
'spilloverDesc' => "Ganar reputación con esta facción tambien una proporción ganada con las facciones listadas a continuación.", 'spilloverDesc' => "Ganar reputación con esta facción tambien una proporción ganada con las facciones listadas a continuación.",
'maxStanding' => "Posición máxima", 'maxStanding' => "Posición máxima",
'quartermaster' => "Intendente", 'quartermaster' => "Intendente: ",
'customRewRate' => "Radio de recompenza personalizado", 'customRewRate' => "Radio de recompenza personalizado",
'_transfer' => 'La reputación de esta facción sera convertida a <a href="?faction=%d" class="q1">%s</a> Si te transfieres a <span class="icon-%s">%s</span>.', '_transfer' => 'La reputación de esta facción sera convertida a <a href="?faction=%d" class="q1">%s</a> Si te transfieres a <span class="icon-%s">%s</span>.',
'cat' => array( 'cat' => array(

View File

@@ -1430,7 +1430,7 @@ $lang = array(
'spillover' => "Partage de réputations", 'spillover' => "Partage de réputations",
'spilloverDesc' => "Gagner de la réputation avec cette faction fourni une réputation proportionnelle avec les factions ci-dessous.", 'spilloverDesc' => "Gagner de la réputation avec cette faction fourni une réputation proportionnelle avec les factions ci-dessous.",
'maxStanding' => "Niveau maximum", 'maxStanding' => "Niveau maximum",
'quartermaster' => "Intendant", 'quartermaster' => "Intendant : ",
'customRewRate' => "Taux de récompense personnalisé", 'customRewRate' => "Taux de récompense personnalisé",
'_transfer' => 'La réputation de cette faction sera convertie en <a href="?faction=%d" class="q1">%s</a> si vous transférez vers <span class="icon-%s">%s</span>.', '_transfer' => 'La réputation de cette faction sera convertie en <a href="?faction=%d" class="q1">%s</a> si vous transférez vers <span class="icon-%s">%s</span>.',
'cat' => array( 'cat' => array(

View File

@@ -1430,7 +1430,7 @@ $lang = array(
'spillover' => "Распространение репутации", 'spillover' => "Распространение репутации",
'spilloverDesc' => "Получение репутации у этой фракции также дает пропорциональный выигрыш по отношению к фракциям, перечисленным ниже.", 'spilloverDesc' => "Получение репутации у этой фракции также дает пропорциональный выигрыш по отношению к фракциям, перечисленным ниже.",
'maxStanding' => "Макс Уровень", 'maxStanding' => "Макс Уровень",
'quartermaster' => "Интендант", 'quartermaster' => "Интендант: ",
'customRewRate' => "Индивидуальная ставка вознаграждения", 'customRewRate' => "Индивидуальная ставка вознаграждения",
'_transfer' => 'Репутация у этой фракции будет преобразована в <a href="?faction=%d" class="q1">%s</a> если вы перейдете в <span class="icon-%s">%s</span>.', '_transfer' => 'Репутация у этой фракции будет преобразована в <a href="?faction=%d" class="q1">%s</a> если вы перейдете в <span class="icon-%s">%s</span>.',
'cat' => array( 'cat' => array(

View File

@@ -1429,7 +1429,7 @@ $lang = array(
'spillover' => "声望额外效果", 'spillover' => "声望额外效果",
'spilloverDesc' => "获得这个阵营的声望也将按比例获得下列阵营的声望。", 'spilloverDesc' => "获得这个阵营的声望也将按比例获得下列阵营的声望。",
'maxStanding' => "最大关系", 'maxStanding' => "最大关系",
'quartermaster' => "军需官", 'quartermaster' => "军需官",
'customRewRate' => "自定义奖励率", 'customRewRate' => "自定义奖励率",
'_transfer' => '这个阵营的声望将被转换到<a href="?faction=%d" class="q1">%s</a>,如果你转移到<span class="icon-%s">%s</span>。', '_transfer' => '这个阵营的声望将被转换到<a href="?faction=%d" class="q1">%s</a>,如果你转移到<span class="icon-%s">%s</span>。',
'cat' => array( 'cat' => array(

View File

@@ -1,88 +0,0 @@
<?php
namespace Aowow;
if (!defined('AOWOW_REVISION'))
die('illegal access');
// menuId 7: Faction g_initPath()
// tabId 0: Database g_initHeader()
class FactionsPage extends GenericPage
{
use TrListPage;
protected $type = Type::FACTION;
protected $tpl = 'list-page-generic';
protected $path = [0, 7];
protected $tabId = 0;
protected $mode = CACHE_TYPE_PAGE;
protected $validCats = array(
1118 => [469, 891, 67, 892, 169],
980 => [936],
1097 => [1037, 1052, 1117],
0 => true
);
public function __construct($pageCall, $pageParam)
{
$this->getCategoryFromUrl($pageParam);
parent::__construct($pageCall, $pageParam);
$this->name = Util::ucFirst(Lang::game('factions'));
}
protected function generateContent()
{
$conditions = [];
if (!User::isInGroup(U_GROUP_EMPLOYEE)) // unlisted factions
$conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
if (isset($this->category[1]))
$conditions[] = ['parentFactionId', $this->category[1]];
else if (isset($this->category[0]))
{
if ($this->category[0])
$subs = DB::Aowow()->selectCol('SELECT id FROM ?_factions WHERE parentFactionId = ?d', $this->category[0]);
else
$subs = [0];
$conditions[] = ['OR', ['parentFactionId', $subs], ['id', $subs]];
}
$data = [];
$factions = new FactionList($conditions);
if (!$factions->error)
$data = array_values($factions->getListviewData());
$this->lvTabs[] = [FactionList::$brickFile, ['data' => $data]];
}
protected function generateTitle()
{
array_unshift($this->title, $this->name);
if ($this->category)
{
switch (count($this->category))
{
case 1:
$t = Lang::faction('cat', $this->category[0]);
array_unshift($this->title, is_array($t) ? $t[0] : $t);
break;
case 2:
array_unshift($this->title, Lang::faction('cat', $this->category[0], $this->category[1]));
break;
}
}
}
protected function generatePath()
{
foreach ($this->category as $c)
$this->path[] = $c;
}
}
?>