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);