From 515144933c77134aeb116629e65372590501b001 Mon Sep 17 00:00:00 2001 From: floam Date: Sat, 4 Mar 2006 18:13:32 +0000 Subject: 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 --- web/include/errors.php | 11 +++++++++-- web/include/news.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 web/include/news.php (limited to 'web') diff --git a/web/include/errors.php b/web/include/errors.php index 1c4656b..7db28b4 100644 --- a/web/include/errors.php +++ b/web/include/errors.php @@ -1,7 +1,9 @@ $error[name] -

$error[description]

"; +

$error[description] $error[detail]

"; ?> 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 @@ + $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 "

" . $item['title'] . "-" . $item['postdate'] . "

\n

" . $item['text'] . "

" + } + } +} + +news_logout($sock); + +if ($err) { + $code = 500; + $detail = $err; + require("errors.php"); +} +?> -- cgit v1.2.3