Files
aowow/pages/compare.php
Sarjuuk 1dfc469d43 - implemented comments (in general and as preview on account page & latest comments)
- partially implemented site reputation (required to grant privileges to comments)
- reworked 'home'-page (the news-box is now as configurable as you want)
- removed some ancient compatibility-code for IE67 (srsly, its 2014!)
- dropped associated stylesheets, reviewed the rest
- split some user-restrictions to trigger on insufficient siteRep
- added text-page: Markup-Guide
- implemented new class to handle Markup

- bugfixes [TM]

- also you will need to reapply the db-dumps (you may want do save account*, news,
reports, ..)
2014-07-30 22:10:34 +02:00

96 lines
2.5 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('invalid access');
// tabId 1: Tools g_initHeader()
class ComparePage extends GenericPage
{
protected $tpl = 'compare';
protected $tabId = 1;
protected $path = [1, 3];
protected $mode = CACHETYPE_NONE;
protected $js = array(
'profile.js',
'Draggable.js',
'filters.js',
'Summary.js',
'swfobject.js',
);
protected $css = [['path' => 'Summary.css']];
protected $summary = [];
protected $cmpItems = [];
private $compareString = '';
public function __construct($pageCall, $__)
{
parent::__construct($pageCall, $__);
// prefer $_GET over $_COOKIE
if (!empty($_GET['compare']))
$this->compareString = $_GET['compare'];
else if (!empty($_COOKIE['compare_groups']))
$this->compareString = urldecode($_COOKIE['compare_groups']);
$this->name = Lang::$main['compareTool'];
}
protected function generateContent()
{
// add conditional js
$this->addJS('?data=weight-presets.gems.enchants.itemsets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
if (!$this->compareString)
return;
$sets = explode(';', $this->compareString);
$items = $outSet = [];
foreach ($sets as $set)
{
$itemSting = explode(':', $set);
$outString = [];
foreach ($itemSting as $substring)
{
$params = explode('.', $substring);
$items[] = (int)$params[0];
while (sizeof($params) < 7)
$params[] = 0;
$outString[] = $params;
}
$outSet[] = $outString;
}
$this->summary = $outSet;
$iList = new ItemList(array(['i.id', $items]));
$data = $iList->getListviewData(ITEMINFO_SUBITEMS | ITEMINFO_JSON);
foreach ($iList->iterate() as $itemId => $__)
{
if (empty($data[$itemId]))
continue;
$this->cmpItems[] = [
$itemId,
$iList->getField('name', true),
$iList->getField('quality'),
$iList->getField('iconString'),
$data[$itemId]
];
}
}
protected function generateTitle()
{
array_unshift($this->title, $this->name);
}
protected function generatePath() {}
}
?>