From 0fca2e25213eaccd0179ffdac317b934c66dc22b Mon Sep 17 00:00:00 2001 From: floam Date: Sat, 4 Mar 2006 18:44:08 +0000 Subject: First try at navigating through history. git-svn-id: svn://svn.icculus.org/quake3/trunk@619 edf5b092-35ff-0310-97b2-ce42778d08ea --- web/include/news.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/include/news.php b/web/include/news.php index 07dc3cf..a1c4c2a 100644 --- a/web/include/news.php +++ b/web/include/news.php @@ -2,7 +2,9 @@ require("/webspace/icculus.org/news/IcculusNews.php"); $id = $_GET['id']; +if (empty($_GET['news_index'])) { $news_index = 0; } $news_queue = 2; +$news_item_count = 5; if ($err = news_login($sock, 'localhost', 263, NULL, NULL, $news_queue)) $err = "Failed to log in: $err"; @@ -13,7 +15,7 @@ else $digestarray[] = array( 'id' => $id ); } - else if ($err = news_digest($sock, $digestarray, false, 10)) + else if ($err = news_digest($sock, $digestarray, $news_index, $news_item_count)) { $err = "Failed to get news digest: $err"; } @@ -29,6 +31,21 @@ else } echo "

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

\n

" . $item['text'] . "

"; } + + $post_count = count($digestarray); + + if ($news_index != 0) + { + $ncount = ($news_index - $news_item_count); + if ($ncount == 0) { unset($ncount); } + echo "Newer→"; + } + if ($post_count == $news_item_count) { + $ncount = ($news_index + $news_item_count); + if ($ncount == 0) { unset($ncount); } + echo "←Older"; +} + } } -- cgit v1.2.3