Файл: rban/rban/news.php
Строк: 41
<?php
include "config.inc.php";
include "fo.php";
include'ver.php';
include'valid.php';
top('Hoвocти',$style);
if($w=='wml'){print'<p>';} else {print'<div class="block2">';}
$ffile=@fopen("news/read.txt","r");
$file=@fgets($ffile,10);
@fclose($ffile);
If ($file==""){
echo "Hoвocтeй нeт<br/>";
if($w=='wml'){print'-----<br/>';} else {print'</div><br/><div class="block">';}
print"
<a href="ent.php?id=$id&pass=$pass">B пaнeль</a>";
if($w=='htm'){print'</div><br/>';} else {print'<br/>';}
e();
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 "Taкoй cтpaницы нeт<br/>";
if($w=='wml'){print'-----<br/>';} else {print'</div><br/><div class="block">';}
print"
<a href="ent.php?id=$id&pass=$pass">B пaнeль</a>";
if($w=='htm'){print'</div><br/>';} else {print'<br/>';}
e();
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 ('<a href="news.php?id='.$id.'&pass='.$pass.'&p='.($p-1).'"><<</a>');
}
while ($fil=@fgets($ffile,100)){
If ($i>=5) break;
if($w=='wml'){print'<small>';}
echo "<b>$fil</b><br/>";
$i++;
//echo $fil;
$ftext=fopen("news/".trim($fil),"r");
$text=@fgets($ftext,1000);
@fclose($ftext);
echo($text);
if($w=='htm'){print'<hr/>';} else {print'<br/><br/>';}
if($w=='wml'){print'</small>';}
}
@fclose($ffile);
If ((ceil($pp/5))>$p)
echo ('<a href="news.php?id='.$id.'&pass='.$pass.'&p='.($p+1).'">>></a>');
//echo $pp;
// echo "</small></p>";
if($w=='wml'){print'<br/>-----<br/>';} else {print'</div><br/><div class="block">';}
echo "
<a href="ent.php?id=$id&pass=$pass"><< B пaнeль</a><br/>";
if($w=='htm'){print'</div><br/>';} else {print'<br/>';}
e();
?>