From f26a34c463ebe37bdbe7b0a614d749089c8886c4 Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 2 Apr 2015 16:25:35 +0200 Subject: [PATCH] xml --- main/news.php | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) 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);