Просмотр файла news/index.php

Размер файла: 3.51Kb
<?php
#-----------------------------------------------------#
#          ********* WAP-MOTORS *********             #
#             Made by   :  VANTUZ                     #
#               E-mail  :  [email protected]         #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#	
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";
 
echo'<img src="../images/img/partners.gif" alt=""> <b>Новости сайта</b><br><br>';


$file = file(BASEDIR."local/news.dat");
$file = array_reverse($file);
$total = count($file);   

if($total<1){echo '<br><img src="../images/img/reload.gif" alt=""> <b>Новостей еще нет!</b><br>';}
 
$start = (int)$_GET['start'];
if($start < 0 || $start > $total){$start = 0;}
if ($total < $start + $config_postnews){ $end = $total; }
else {$end = $start + $config_postnews; }
for ($i = $start; $i < $end; $i++){

$data = explode("|",$file[$i]);
$data[1]=bb_code($data[1]);
echo '<div class=b><img src="../images/img/rss.png" alt=""> ';
echo '<b>'.$data[0].'</b><small> ('.date_fixed($data[3]).')</small></div>';
if ($uzdata[6]!=="") {echo'<img src="../'.check($data[6]).'" alt="" align=left>';}
echo '<div>'.$data[1].'<br>';
echo 'Разместил: <a href="../pages/anketa.php?uz='.$data[4].'&amp;'.SID.'"> '.nickname($data[4]).' </a><br>';
echo '<a href="komm.php?id='.$data[5].'&amp;'.SID.'">Комментарии</a> ';

$countkomm=0;
if (file_exists(BASEDIR."local/datakomm/$data[5].dat")){
$filek = file(BASEDIR."local/datakomm/$data[5].dat");
$countkomm=count($filek);}
echo '('.(int)$countkomm.')</div>';
}

echo'<hr>';    
if ($start != 0) {echo '<a href="index.php?start='.($start - $config_postnews).'&amp;'.SID.'">&lt;-Назад</a>';}else{echo'&lt;-Назад';}
echo' | '; 
if ($total > $start + $config_postnews) {echo ' <a href="index.php?start='.($start + $config_postnews).'&amp;'.SID.'">Далее-&gt;</a>';}else{echo'Далее-&gt;';}

$ba=ceil($total/$config_postnews);
$ba2=$ba*$config_postnews-$config_postnews;

if($total>0){
echo'<br><hr>Страницы:';
$asd=$start-($config_postnews*3);
$asd2=$start+($config_postnews*4);

if($asd<$total && $asd>0){echo ' <a href="index.php?start=0&amp;'.SID.'">1</a> ... ';}

for($i=$asd; $i<$asd2;)
{
if($i<$total && $i>=0){
$ii=floor(1+$i/$config_postnews);

if ($start==$i) {
echo ' <b>'.$ii.'</b>';
               }
                else {
echo ' <a href="index.php?start='.$i.'&amp;'.SID.'">'.$ii.'</a>';
                     }}


$i=$i+$config_postnews;}
if($asd2<$total){echo ' ... <a href="index.php?start='.$ba2.'&amp;'.SID.'">'.$ba.'</a>';}
}

echo'<br><br><img src="../images/img/rss.gif" alt=""> <a href="rss_news.php?'.SID.'">RSS подписка</a><br>'; 
echo'<img src="../images/img/homepage.gif" alt=""> <a href="../index.php?'.SID.'">На главную</a>'; 
include_once"../themes/$config_themes/foot.php";
?>