diff options
author | floam <floam@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2006-03-04 18:13:32 +0000 |
---|---|---|
committer | floam <floam@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2006-03-04 18:13:32 +0000 |
commit | 515144933c77134aeb116629e65372590501b001 (patch) | |
tree | 99fb51ed4e58a57637356d0cc5c7c6f2e7d573a2 /web/include/news.php | |
parent | 9faab37c4c3dd92ce003cd4c177d1cd1fc3bf0e7 (diff) | |
download | ioquake3-aero-515144933c77134aeb116629e65372590501b001.tar.gz ioquake3-aero-515144933c77134aeb116629e65372590501b001.zip |
Preparing to use IcculusNews so we can announce stuff without bothering SVN.
git-svn-id: svn://svn.icculus.org/quake3/trunk@617 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'web/include/news.php')
-rw-r--r-- | web/include/news.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/web/include/news.php b/web/include/news.php new file mode 100644 index 0000000..ce544c5 --- /dev/null +++ b/web/include/news.php @@ -0,0 +1,42 @@ +<?php +require("/webspace/icculus.org/news/IcculusNews.php"); + +$id = $_GET['id']; +$news_queue = 2; + +if ($err = news_login($sock, 'localhost', 263, NULL, NULL, $news_queue)) + $err = "Failed to log in: $err"; +else +{ + if (isset($id)) + { + $digestarray[] = array( 'id' => $id ); + } + + else if ($err = news_digest($sock, $digestarray, false, 10)) + { + $err = "Failed to get news digest: $err"; + } + + if (!isset($err)) + { + foreach($digestarray as $digestItem) + { + if ($err = news_get($sock, $digestItem['id'], $item)) + { + $err = "Failed to grab news item: $err"; + break; + } + echo "<h3>" . $item['title'] . "-" . $item['postdate'] . "</h3>\n<p>" . $item['text'] . "</p>" + } + } +} + +news_logout($sock); + +if ($err) { + $code = 500; + $detail = $err; + require("errors.php"); +} +?> |