From 0a34bf911bdff47a2c1d79476a496cac152afadc Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 2 Apr 2015 16:21:37 +0200 Subject: [PATCH] news --- main/.htaccess | 4 ++++ main/news.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main/.htaccess b/main/.htaccess index a3181e0..149b62c 100644 --- a/main/.htaccess +++ b/main/.htaccess @@ -24,6 +24,10 @@ RewriteRule ^(.*)$ $1.php ## Info pages RewriteRule ^r/([a-z]+)$ infopage.php?r=$1 +## News +RewriteRule ^news/([0-9]+)$ news.php?id=$1 +RewriteRule ^news.xml$ news.php?xml + # Serving Images RewriteRule ^a/([0-9]+)$ imageserve.php?m=avatar&u=$1 RewriteRule ^a/([0-9]+).png$ imageserve.php?m=avatar&u=$1 diff --git a/main/news.php b/main/news.php index 2c04978..b69ae5f 100644 --- a/main/news.php +++ b/main/news.php @@ -13,7 +13,7 @@ require_once '/var/www/flashii.net/_sakura/sakura.php'; $renderData['page'] = [ 'title' => 'Flashii News' ]; -$renderData['newsPosts'] = Main::getNewsPosts(); +$renderData['newsPosts'] = Main::getNewsPosts((isset($_GET['id']) && is_numeric($_GET['id'])) ? $_GET['id'] : null); // Print page contents print Main::tplRender('main/news.tpl', $renderData);