diff --git a/main/news.php b/main/news.php index b69ae5f..d073584 100644 --- a/main/news.php +++ b/main/news.php @@ -13,7 +13,45 @@ require_once '/var/www/flashii.net/_sakura/sakura.php'; $renderData['page'] = [ 'title' => 'Flashii News' ]; -$renderData['newsPosts'] = Main::getNewsPosts((isset($_GET['id']) && is_numeric($_GET['id'])) ? $_GET['id'] : null); +$renderData['newsPosts'] = Main::getNewsPosts((isset($_GET['id']) && !isset($_GET['xml']) && is_numeric($_GET['id'])) ? $_GET['id'] : null); + +// News XML, don't really care so yeah +if(isset($_GET['xml'])) { + + print ''; + print ''; + + print ''; + + print 'Flashii News'; + print 'http://flashii.net/'; + print 'News on Flashii.net.'; + print 'en-gb'; + print 'admin@flashii.net (Flashii Administrator)'; + print ''. date('D, d M Y G:i:s O') .''; + print ''. date('D, d M Y G:i:s O') .''; + + foreach($renderData['newsPosts'] as $newsPost) { + + print ''; + + print ''. $newsPost['title'] .''; + print 'http://flashii.net/news/'. $newsPost['id'] .''; + print 'http://flashii.net/news/'. $newsPost['id'] .''; + print ''. date('D, d M Y G:i:s O', $newsPost['date']) .''; + print ''. $flashii->getUserdata($newsPost['uid'])['username'] .''; + print 'text($newsPost['content']) .']]>'; + + print ''; + + } + + print ''; + + print ''; + exit; + +} // Print page contents print Main::tplRender('main/news.tpl', $renderData);