View file moduls/blog/index.php

File size: 865B
<?php
$st_r = 10;

 if (is_file($cms.'moduls/blog/spisok.txt')) $post = @file($cms.'moduls/blog/spisok.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--)
 {
 include($cms.'moduls/blog/base/'.trim($post[$j]).'_of.php');
 echo '
  <a href="/?page=blog&blog='.trim($post[$j]).'"><div class="mess1">'.trim($post[$j]).' - "'.$bl_name.'"</div></a><hr>
';


 }
 echo 'Страницы:&nbsp;'."\n";
 $all = ceil($count_post/$st_r);
 for ($i=1;$i<=$all;$i++) {
    if ($pages==$i) {
        echo '<b>'.$i.'</b> ';
    } else {
        echo '<a href="/?page='.$_GET['page'].'&id='.trim($_GET['id']).'&pages='.$i.'">'.$i.'</a> '."";
    }

 }
?>