View file news/vig.php

File size: 1.07Kb
<?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($_GET['pages'])) {
    $pages = 1;
} else {
    $pages = (int) $_GET['pages'];
}

$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,256);
include($cms.'flud/delet_bb.php');
$dec = trim($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 />
     ';


}
}
else
{
echo 'Новостей еще не добавлено.';
}
?>