aboutsummaryrefslogtreecommitdiffstats
path: root/web/include
diff options
context:
space:
mode:
authorfloam <floam@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-03-04 18:44:08 +0000
committerfloam <floam@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-03-04 18:44:08 +0000
commit0fca2e25213eaccd0179ffdac317b934c66dc22b (patch)
treeb2681a71d008a60c7e2ebc89169245b9c2a82f69 /web/include
parent4321eec4d1abc8ef50194a353ea4192914885cad (diff)
downloadioquake3-aero-0fca2e25213eaccd0179ffdac317b934c66dc22b.tar.gz
ioquake3-aero-0fca2e25213eaccd0179ffdac317b934c66dc22b.zip
First try at navigating through history.
git-svn-id: svn://svn.icculus.org/quake3/trunk@619 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'web/include')
-rw-r--r--web/include/news.php19
1 files changed, 18 insertions, 1 deletions
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 "<h3>" . $item['title'] . "-" . $item['postdate'] . "</h3>\n<p>" . $item['text'] . "</p>";
}
+
+ $post_count = count($digestarray);
+
+ if ($news_index != 0)
+ {
+ $ncount = ($news_index - $news_item_count);
+ if ($ncount == 0) { unset($ncount); }
+ echo "<a class=\"floater right\" href=\"?page=news&amp;news_index=" . $ncount . "\">Newer&rarr;</a>";
+ }
+ if ($post_count == $news_item_count) {
+ $ncount = ($news_index + $news_item_count);
+ if ($ncount == 0) { unset($ncount); }
+ echo "<a class=\"floater left\" href=\"?page=news&amp;news_index=" . $ncount . "\">&larr;Older</a>";
+}
+
}
}