diff options
author | deva <deva> | 2010-01-28 15:04:03 +0000 |
---|---|---|
committer | deva <deva> | 2010-01-28 15:04:03 +0000 |
commit | 135d5257dc3351291a66bdf697c840d516995cd5 (patch) | |
tree | 4857e96acc07f50e721a4fcd9444d7b625a5b411 | |
parent | 4c8ff7c5787f6d35cca76e3fda0e9e4d051fe4eb (diff) |
Option to show only a single news entry. Vague attempt on news->rss feed conversion.
-rw-r--r-- | .cvsignore | 4 | ||||
-rw-r--r-- | utils/modules/news.php | 13 | ||||
-rw-r--r-- | utils/rss.php | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..f088cf6 --- /dev/null +++ b/.cvsignore @@ -0,0 +1,4 @@ +data/* +forum/* +forum/data/* +htdocs/* 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, "</news>\n"); fclose($fp); + + $rss = new RSS($this->file, "rss.xml"); + $rss->write(); } private function read() diff --git a/utils/rss.php b/utils/rss.php index e6aa83f..b4b4b86 100644 --- a/utils/rss.php +++ b/utils/rss.php @@ -68,7 +68,7 @@ class RSS { fwrite($fp, " <link>http://www.executionroom.com/?page=news&id=".$newsentry->time."</link>\n"); fwrite($fp, " <description>".$newsentry->description."</description>\n"); fwrite($fp, " <pubDate>".$this->date($newsentry->time)."</pubDate>\n"); - fwrite($fp, " <guid>http://www.executionroom.com/?page=news&id=".$newsentry->time."</guid>\n"); + fwrite($fp, " <guid>http://www.executionroom.com/?page=news&id=".$newsentry->time."&newsid="+$newsentry->time+"</guid>\n"); fwrite($fp, " </item>\n"); $i++; if($i > 6) break; |