r621 - in trunk/web: . include
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat Mar 4 16:54:03 EST 2006
Author: floam
Date: 2006-03-04 16:54:02 -0500 (Sat, 04 Mar 2006)
New Revision: 621
Modified:
trunk/web/include/news.php
trunk/web/index.php
trunk/web/ioq3.css
Log:
It works!
Modified: trunk/web/include/news.php
===================================================================
--- trunk/web/include/news.php 2006-03-04 18:45:14 UTC (rev 620)
+++ trunk/web/include/news.php 2006-03-04 21:54:02 UTC (rev 621)
@@ -2,24 +2,25 @@
require("/webspace/icculus.org/news/IcculusNews.php");
$id = $_GET['id'];
-if (empty($_GET['news_index'])) { $news_index = 0; }
+if (empty($_GET['news_index']))
+ $news_index = false;
+else
+ $news_index = $_GET['news_index'];
$news_queue = 2;
-$news_item_count = 5;
+$news_item_max = 5;
if ($err = news_login($sock, 'localhost', 263, NULL, NULL, $news_queue))
$err = "Failed to log in: $err";
else
{
- if (isset($id))
+ if ($err = news_digest($sock, $digestarray, $news_index, $news_item_max))
{
- $digestarray[] = array( 'id' => $id );
- }
-
- else if ($err = news_digest($sock, $digestarray, false, $news_item_count))
- {
$err = "Failed to get news digest: $err";
}
-
+
+ $current_post = 0;
+ $news_item_count = count($digestarray);
+
if (!isset($err))
{
foreach($digestarray as $digestItem)
@@ -29,26 +30,19 @@
$err = "Failed to grab news item: $err";
break;
}
- echo "<h3>" . $item['title'] . "-" . $item['postdate'] . "</h3>\n<p>" . $item['text'] . "</p>";
+ echo "<h3>" . $item['title'] . " - <em>" . date("F j, Y", strtotime($item['postdate'])) . "</em></h3>\n<p>" . $item['text'] . "</p>";
+ if ($current_post++ == $news_item_count - 1)
+ $lastid = $digestItem['id'];
+ }
}
-
- $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&news_index=" . $ncount . "\">Newer→</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&news_index=" . $ncount . "\">←Older</a>";
+ echo "<p>";
+ if ($news_item_count == $news_item_max)
+ echo "<a class=\"left\" href=\"?page=news&news_index=$lastid\">←Backpedal</a>";
+ if ($news_index != false)
+ echo "<a class=\"right\" href=\"?page=news\">To Newest→</a>";
+ echo "</p>";
}
- }
-}
-
news_logout($sock);
if ($err) {
Modified: trunk/web/index.php
===================================================================
--- trunk/web/index.php 2006-03-04 18:45:14 UTC (rev 620)
+++ trunk/web/index.php 2006-03-04 21:54:02 UTC (rev 621)
@@ -34,8 +34,7 @@
</div>
<div id="footer">
<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://icculus.org/quake3/ioq3.css&warning=0">Valid CSS</a> |
- <a href="http://validator.w3.org/check?uri=http://icculus.org<?php
-echo $_SERVER['REQUEST_URI'];?>">Valid XHTML</a> |
+ <a href="http://validator.w3.org/check?uri=referer">Valid XHTML</a> |
<a href="http://icculus.org">icculus.org</a>
<br />
Website designed and handled by <a href="http://floam.sh.nu" title="floam">Aaron Gyes</a>.
Modified: trunk/web/ioq3.css
===================================================================
--- trunk/web/ioq3.css 2006-03-04 18:45:14 UTC (rev 620)
+++ trunk/web/ioq3.css 2006-03-04 21:54:02 UTC (rev 621)
@@ -10,11 +10,13 @@
float: left;
clear: left;
width: 100%;
+ padding-bottom: .2em;
}
#footer {
clear: left;
color: #4d4d4d;
+ margin-top: .2em;
border-top: 1px dashed #222222;
font-size: .8em;
padding: .35em;
@@ -125,6 +127,10 @@
float: right;
}
+.left {
+ float: left;
+}
+
tt, .shell {
font-family: "smoothansi", "Bitstream Vera Sans Mono", "Terminal", monospace;
}
More information about the quake3-commits
mailing list