File size: 1.61Kb
<?php
Defined('INDEX_S_S') or die ('Доступ запрещен!!!');
$st_r = $cgf_ind_news;
// столько выводим
if (filesize($cms.'news/base.txt') != 0)
{
if (is_file($cms.'news/base.txt')) $post = @file($cms.'news/base.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]);
$mess1 = substr($fn[1],0,320);
include($cms.'flud/delet_bb.php');
$dec = $mess1;
if (is_file($cms.'news/coment/'.trim($fn[3]).'.txt'))
$coment = @count(@file($cms.'news/coment/'.trim($fn[3]).'.txt'));
else
$coment = 0;
echo '
<div class="mess1">'.$fn[2].' - '.$fn[0].' </div>
<div class="mess2">'.$dec.'
<div align="right"><a href="/?page=news&line='.$j.'">Подробнее / Комментарии ('.$coment.')</a></div></div>
<hr />
';
}
$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>';
}
else
{
echo 'Новостей еще не добавлено.';
}
?>