- 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, ..)
This commit is contained in:
Sarjuuk
2014-07-27 15:47:12 +02:00
parent 48527b0b68
commit 1dfc469d43
91 changed files with 9349 additions and 7450 deletions

52
pages/home.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
class HomePage extends GenericPage
{
protected $tpl = 'home';
protected $js = ['home.js'];
protected $css = [['path' => 'home.css']];
protected $news = [];
public function __construct()
{
parent::__construct('home');
}
protected function generateContent()
{
$this->addCSS(['string' => '.announcement { margin: auto; max-width: 1200px; padding: 0px 15px 15px 15px }']);
// load news
$this->news = DB::Aowow()->selectRow('SELECT id as ARRAY_KEY, n.* FROM ?_news n WHERE active = 1 ORDER BY id DESC LIMIT 1');
if (!$this->news)
return;
$this->news['text'] = Util::localizedString($this->news, 'text', true);
if ($_ = (new Markup($this->news['text']))->parseGlobalsFromText())
$this->extendGlobalData($_);
if (empty($this->news['bgImgUrl']))
$this->news['bgImgUrl'] = STATIC_URL.'/images/'.User::$localeString.'/mainpage-bg-news.jpg';
else
$this->news['bgImgUrl'] = strtr($this->news['bgImgUrl'], ['HOST_URL' => HOST_URL, 'STATIC_URL' => STATIC_URL]);
// load overlay links
$this->news['overlays'] = DB::Aowow()->select('SELECT * FROM ?_news_overlay WHERE newsId = ?d', $this->news['id']);
foreach ($this->news['overlays'] as &$o)
{
$o['title'] = Util::localizedString($o, 'title', true);
$o['title'] = strtr($o['title'], ['HOST_URL' => HOST_URL, 'STATIC_URL' => STATIC_URL]);
}
}
protected function generateTitle() {}
protected function generatePath() {}
}
?>