From 135d5257dc3351291a66bdf697c840d516995cd5 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 28 Jan 2010 15:04:03 +0000 Subject: Option to show only a single news entry. Vague attempt on news->rss feed conversion. --- utils/modules/news.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'utils/modules/news.php') diff --git a/utils/modules/news.php b/utils/modules/news.php index 4d00b24..8c693c3 100644 --- a/utils/modules/news.php +++ b/utils/modules/news.php @@ -3,6 +3,7 @@ global $UTIL_DIR, $MODULES_DIR; +include_once($UTIL_DIR . "/rss.php"); include_once($UTIL_DIR . "/convert.php"); include_once($UTIL_DIR . "/forms.php"); include_once($UTIL_DIR . "/user.php"); @@ -272,6 +273,8 @@ class News { public function run($params) { + global $newsid; + $str = ""; $module = "all"; @@ -295,7 +298,12 @@ class News { } } - $str .= $this->show($number, $module); + if($newsid && $this->news[$newsid]) { + // $str .= $this->show($number, $module); + $str .= $this->news[$newsid]->show(); + } else { + $str .= $this->show($number, $module); + } return $str; } @@ -334,6 +342,9 @@ class News { fwrite($fp, "\n"); fclose($fp); + + $rss = new RSS($this->file, "rss.xml"); + $rss->write(); } private function read() -- cgit v1.2.3