Просмотр файла wapcatalog/lic.php

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

 
  header("Content-type:text/vnd.wap.wml;charset=utf-8"); 

  print "<?xml version=\"1.0\"?>\n";
  print "<wml>\n";
  print "<card title=\"TROportal\">\n";

  $xfile = @file("lic.txt");

  $p = 13;

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

  print $gline_rew." :: ".$gline_next."<br/>";
  print "<a href=http://www.trofimov.com.ru/wap/>Home</a></card></wml>\n";

?>