File size: 1.59Kb
<?php
Defined('INDEX_S_S') or die ('Доступ запрещен!!!');
if ($_SESSION['login'] != '')
include($cms.'file/com_add.php');
else
echo 'Ошибка IP адреса.';
if (filesize($cms.'file/'.$_GET['get_kat'].'/'.trim($pt_inf[2]).'_comment.txt') == 0) echo 'Писем нет';
else
{
$st_r = 10;
// столько выводим
if (is_file($cms.'file/'.$_GET['get_kat'].'/'.trim($pt_inf[2]).'_comment.txt')) $post = @file($cms.'file/'.$_GET['get_kat'].'/'.trim($pt_inf[2]).'_comment.txt'); else echo 'Ошибка';
$count_post = count($post);
if (empty($_POST['fapages'])) {
$pages = 1;
} else {
$pages = (int) $_POST['fapages'];
}
$j = ($count_post-1)-(($pages-1)*$st_r);
$i = $j-$st_r;
for(; $i<$j && $j>=0; $j--)
{
$fn = explode("|",$post[$j]);
echo '
<div class="mess1">
<div align="left">'.$fn[0].' - '.$fn[1].'</div>
</div>
<div class="mess2">'.$fn[2].'</div>
<br>
';
}
$all = ceil($count_post/$st_r);
echo '<table><tr>';
for ($i=1;$i<=$all;$i++)
{
if ($pages==$i) {
echo '<td><b class="knopka">'.$i.'</b></td>';
}
else
{
echo '<td>
<form name="" action="" method="post">
<input type="submit" class="knopka" value="'.$i.'">
<input name="fapages" type="hidden" value="'.$i.'">
</form>
</td>';
}
}
echo '</tr></table>';
}
?>