Размер файла: 2Kb
<? header("Content-Type: text/vnd.wap.wml");
header("Cache-Control: no-cache");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";?>
<?php
include "config.inc.php";
include "fo.php";
?><wml><card title="Hoвocти"><?php
include "valid.php";
$ffile=@fopen("news/read.txt","r");
$file=@fgets($ffile,10);
@fclose($ffile);
If ($file==""){
echo "<p><small>Hoвocтeй нeт<br/>
<a href=\"apanel.php?id=$id&pass=$pass\">B пaнeль</a></small></p>
</card></wml>";
exit;
}
$pp=0;
$f=@fopen("news/read.txt","r");
while($fie=@fgets($f,100)){
$pp++;
}
//echo $pp;
@fclose($f);
If (!isset($_GET['p']) || !is_numeric($_GET['p']) ||$_GET['p']<1){
$p=1;
} else $p=$_GET['p'];
If ((ceil($pp/5))<$p)
{
echo "<p><small>Taкoй cтpaницы нeт<br/>
<a href=\"apanel.php?id=$id&pass=$pass\">B пaнeль</a></small></p>
</card></wml>";
exit;
}
$ffile=@fopen("news/read.txt","r");
If ($p>1){
$set=0;
for($set=1;$set<=((($p-1)*5));$set++){
$filfffff=@fgets($ffile,100);
//echo "pp";
}
}
$i=0;
If ($p>1){
echo ('<p><a href="news.php?id='.$id.'&pass='.$pass.'&p='.($p-1).'"><<</a></p>');
}
while ($fil=@fgets($ffile,100)){
If ($i>=5) break;
echo "<p>";
echo "$fil<br/>
<small>
";
$i++;
//echo $fil;
$ftext=fopen("news/".trim($fil),"r");
$text=@fgets($ftext,1000);
@fclose($ftext);
echo($text."</small></p>");
}
@fclose($ffile);
If ((ceil($pp/5))>$p)
echo ('<p><small><a href="news.php?id='.$id.'&pass='.$pass.'&p='.($p+1).'">>></a></small></p>');
//echo $pp;
// echo "</small></p>";
echo "
<p><small>
<a href=\"apanel.php?id=$id&pass=$pass\">B пaнeль</a><br/><br/>
</small></p>";
?></card></wml>