Кто-нибудь! проверьте пожалуйста!
$show = "20";
$file = file(\'champ.dat\');
$count = count($file);
$start = $show * ($page - 1);
if(! isset ($what)) $what = 0;
for($i = $start; $i <= $start+$show; $i++){
$record = explode("::", $file[$i]);
$showi = $record[1];
if($what==$i){echo "
$showi";
} else {
echo "
$showi ";}
}
$pages = (int) (($count + $show - 1) / $show);
if (!is_numeric($page) or $page < 1 or $page > $pages)
{
$page = "1";
}
$beginning = $count - ($show * ($page - 1));
$end = $count - ($show * $page) + 1;
if ($end < 1)
{
$end = 1;
}
for ($show = 1; $show <= $pages; $show++)
{
if ($show != $page)
{
$navigation .= " |
$show| ";
}
if ($show == $page)
{
$navigation .= "|
$show|";
}
}
echo "
";
echo "
Cтраница: $navigation";
$therecord = explode("::", $file[$what]);
echo "
![\\"".$therecord[1]."\\"](".$therecord[0].")
";
echo "
".$therecord[1]."
";
$nadprecord = explode("::", $file[$what]);
echo "".$nadprecord[2]."
";
if($what != 0){
$previ = $what-1;
echo "Предыдущая | ";
}
if($what < $count){
$nexti = $what+1;
echo " Следующая ";
}
?>