Размер файла: 1.14Kb
<?
header("Content-type:text/vnd.wap.wml;charset=utf-8");
print "<?xml version=\"1.0\"?>\n";
print "<wml>\n";
print "<card title=\"Chat\">\n";
$xfile = @file("chat.txt");
$p = 10;
if ($npage == ""){$npage = "1";}
$first = count($xfile) - ($p * ($npage - 1));
$second = count($xfile) - ($p * $npage) + 1;
if ($second < 1) {$second = 1;}
$npages = (int)(count($xfile) / $p);
if ($news_limiter>((int) ($npages*$p))) $npages = $npages+1;
if ($npage <= $npages and $npage>1) $gline_rew = "<a href=\"guest.php?npage=".($npage-1)."\">Назад</a>";
if ($npages > 1 and $npage<$npages) $gline_next = "<a href=\"guest.php?npage=".($npage+1)."\">Вперед</a>";
$line = " | ";
for ($p = 1; $p <= $npages; $p++) {
if ($p != $npage) { $line .= "<a href=\"guest.php?npage=$p\"> $p </a>|";}
if ($p == $npage) { $line .= "$p |"; }
}
print $line;
for ($i = $first-1; $i >= $second-1; $i--) {
$ii = $i;
$ii++;
$udata = explode("::",$xfile[$i]);
print "<p><b>$udata[0]</b>:$udata[1]<br/>==".$i."== </p>";
}
print $gline_rew." :: ".$gline_next."<br/>";
?>