Просмотр файла waptchat/stats.php

Размер файла: 1.19Kb
<?

 
  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("counter.txt");

  $p = 3;

  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=\"stats.php?npage=".($npage-1)."\">Назад</a>";
  if ($npages > 1 and $npage<$npages) $gline_next = "<a href=\"stats.php?npage=".($npage+1)."\">Вперед</a>"; 
  $line = " | ";
 
  for ($p = 1; $p <= $npages; $p++) {
   if ($p != $npage) { $line .= "<a href=\"stats.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>$udata[0] <br/> $udata[1]<br/> $udata[2] <br/> $udata[3] <br/> $udata[4] <br/> ==".$i."== </p>";
  }

  print $gline_rew." :: ".$gline_next."<br/>";

?>