Files
aowow/pages/more.php
Sarjuuk 70f703b4b2 Cache:
- implemented Memcached (untested though (tough luck trying to get it to run using win))
 - added config value to select caching method (default: filecache; setting debug to 1 will still disable caching)
 - implemented url-param 'refresh' to clear cache for this page
2014-09-11 00:06:08 +02:00

76 lines
2.4 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
// the actual text is an article accessed by type + typeId
// menuId 2: More g_initPath()
// tabid 2: More g_initHeader()
class MorePage extends GenericPage
{
protected $tpl = 'text-page-generic';
protected $path = [2];
protected $tabId = 2;
protected $mode = CACHE_TYPE_NONE;
protected $js = ['swfobject.js'];
private $subPages = [ -13 => ['commenting-and-you', 'modelviewer', 'screenshots-tips-tricks', 'stat-weighting', 'talent-calculator', 'item-comparison', 'profiler', 'markup-guide']];
private $validPages = array( // [type, typeId, name]
'whats-new' => [ -7, 0, "What's New"],
'searchbox' => [-16, 0, 'Search Box'],
'tooltips' => [-10, 0, 'Tooltips'],
'faq' => [ -3, 0, 'Frequently Asked Questions'],
'aboutus' => [ 0, 0, 'What is AoWoW?'],
'searchplugins' => [ -8, 0, 'Search Plugins'],
'help' => [-13, null, '']
);
public function __construct($pageCall, $subPage)
{
parent::__construct($pageCall, $subPage);
// chack if page is valid
if ($_ = @$this->validPages[$pageCall])
{
// check if subpage is valid
if (!isset($_[1]))
{
if (($_[1] = array_search($subPage, $this->subPages[$_[0]])) === false)
$this->error();
if ($pageCall == 'help') // ye.. hack .. class definitions only allow static values
$_[2] = Lang::$main['helpTopics'][$_[1]];
}
$this->type = $_[0];
$this->typeId = $_[1];
$this->name = $_[2];
$this->gPageInfo = array(
'type' => $this->type,
'typeId' => $this->typeId,
'name' => $this->name
);
}
else
$this->error();
}
protected function generatePath()
{
$this->path[] = abs($this->type);
if ($this->typeId > -1)
$this->path[] = $this->typeId;
}
protected function generateTitle()
{
array_unshift($this->title, $this->name);
}
protected function generateContent() {} // its just articles here
}
?>