gaim/www

people are dense
WITH_GTK12_ANSWERS
2004-01-19, Luke Schierer
522b8ea7e1b3
people are dense
<?php
require "base.inc.php";
start_html("News");
?>
<div align="left">
&nbsp;&nbsp;&nbsp;
<i><font color="#606060">Get the news in RSS</font></i>
&nbsp;
<a href="/rss.php/news"><img src="/images/xml.png" width="36" height="14" border="0" alt="XML" /></a>
&nbsp;&nbsp;&nbsp;
</div>
<?php
if (!isset($start)) { $start = 0; }
if (!isset($limit)) { $limit = 5; }
/* Parse the news. */
$filename = "news.txt";
$fcontents = file($filename);
$index = 0;
$pos = 0;
print "<br />\n";
while (list($linenum, $line) = each($fcontents)) {
if ($pos < $start) {
if (chop($line) == "#") {
$pos++;
}
continue;
}
elseif ($pos < ($start + $limit)) {
if (chop($line) == "#") {
end_section();
print "<br />\n";
$index = 0;
$pos++;
continue;
}
elseif ($index == 0) { $cur_title = $line; }
elseif ($index == 1) {
start_section($cur_title, $line);
$cur_title = "";
}
else {
print "<p>" . $line . "</p>\n";
}
}
else {
break;
}
$index++;
}
if ($index > 0) {
end_section();
print "<br />\n";
}
if ($index == 0 || $start > 0) {
print "<table border=\"0\" width=\"100%\">\n";
print " <tr>\n";
print " <td nowrap=\"nowrap\">";
if ($start > 0) {
print "<font face=\"Verdana, Tahoma, Arial, Helvetica\"";
print " size=\"-1\">";
print "<a href=\"$PHP_SELF?start=";
print (($start - $limit > 0) ? ($start - $limit) : 0);
print "&limit=$limit\">&lt;- Previous</a>";
print "</font>";
}
else {
print "&nbsp;";
}
print "</td>\n";
print " <td align=\"right\" nowrap=\"nowrap\">";
if ($index == 0) {
print "<font face=\"Verdana, Tahoma, Arial, Helvetica\"";
print " size=\"-1\">";
print "<a href=\"$PHP_SELF?start=$pos&limit=$limit\">";
print "Next -&gt;</a>";
print "</font>";
}
else {
print "&nbsp;";
}
print "</td>\n";
print " </tr>\n";
print "</table>\n";
}
end_html();
?>