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

Размер файла: 4.39Kb
<?php
#-----------------------------------------------------#
#             ******   Сообщества    ******           #
#                    Site   :  http://cobwap.net      #
#                   E-mail  :  [email protected]          #
#                 Для связи :  8(909)651-0-222        #
#                      ICQ  :  384181109              #
#            Автор скрипта  :  LAS                    #
#-----------------------------------------------------#
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";
if ($provlog==$_SESSION['log'] && $provpar==md5($_SESSION['par']) && $_SESSION['log']!="" && md5($_SESSION['par'])!=""){
echo '<br><div class=b><img src="../images/img/partners.gif" alt=""> <b>Новости</b><br></div> ';
$them = check($_GET['them']);
$soo = check($_GET['soo']);
$themes = check($_POST['themes']);
$msg = check($_POST['msg']);


if($them!="" && !eregi("[^0-9-]",$them)){
$text = file(BASEDIR."local/comm/$them.soo"); 
if ($text!=""){
$uzdata = explode(":||:",$text[0]);

$file = file(BASEDIR."local/commnews/$them.dat");
$file = array_reverse($file);
$total = count($file);  
if($total<1){echo '<br><img src="../images/img/reload.gif" alt=""> <b>Новостей еще нет!</b><br>';}



$page = (int)$_GET['page'];
if($page < 0 || $page > $total){$page = 0;}
if ($total < $page + 7){ $end = $total; }
else {$end = $page + 7; }
for ($i = $page; $i < $end; $i++){

$data = explode("|",$file[$i]);
$data[1]=bb_code($data[1]);

echo '<div class=b><img src="../images/img/files.gif" alt=""> ';
echo '<b>'.$data[0].'</b><small> ('.date_fixed($data[3]).')</small></div>';
echo '<div class=lol>'.$data[1].'<br>';
echo 'Разместил: '.$data[4].' </a><br>';
echo '</div><br>';
}

echo'<br><div class=b>';
if ($page != 0) {echo '<a href="news.php?soo='.$soo.'&them='.$them.'&page='.($page - 7).'&amp;'.SID.'"><< </a>';}else{echo'<< ';}
$ba=ceil($total/7);$ba2=$ba*7-7;echo '[ Стр:';
if($total>0){$asd=$page-(7*3);$asd2=$page+(7*4);
if($asd<$total && $asd>0){echo ' <a href="news.php?soo='.$soo.'&them='.$them.'&page=0&amp;'.SID.'">1</a> ... ';}
for($i=$asd; $i<$asd2;){
if($i<$total && $i>=0){
$ii=floor(1+$i/7);
if ($page==$i) {echo ' <b>'.$ii.'</b>';}else {echo ' <a href="news.php?soo='.$soo.'&them='.$them.'&page='.$i.'&amp;'.SID.'">'.$ii.'</a>';}}
$i=$i+7;}
if($asd2<$total){echo ' ... <a href="news.php?soo='.$soo.'&them='.$them.'&page='.$ba2.'&amp;'.SID.'">'.$ba.'</a>';}}echo' ] '; 
if ($total > $page + 7) {echo ' <a href="news.php?soo='.$soo.'&them='.$them.'&&page='.($page + 7).'&amp;'.SID.'"> >></a>';}else{echo' >>';}echo'</div>'; 


$text = file(BASEDIR."local/comm/$them.soo");
$uzdata = explode(":||:",$text[0]);
if ($dostup==101 || $dostup==102 || $log==$uzdata[0]){
echo ' <form action="addnews.php?soo='.$soo.'&them='.$them.'&'.SID.'" method="post">';
echo '<b>Заголовок новости: </b><br>';
echo '<input type="text" name="themes" maxlength="50"><br>';
echo '<b>Новость: </b><br>';
echo '<input type="text" name="msg" maxlength="350"><br>';
echo 'Транслитерация: <input name="trans" type="checkbox" value="y"><br>';
echo '<input type="submit" value="Добавить"></form>';
}








} else {echo '<img src="../images/img/error.gif" alt=""> Сообщество не существует!<br>';}
} else {echo '<img src="../images/img/error.gif" alt=""> Произошла ошибка. Сообщество не существует!<br>';}
}else{echo '<br>Вы не выполнили <a href="../pages/vhod.php?'.SID.'">вход</a></b> или в начале вам нужно <b> <a href="../pages/registration.php?'.SID.'">зарегистрироваться</a></b><br> ';}
echo'<br><br><img src="../images/img/back.gif" alt=""> <a href="view.php?soo='.$soo.'&them='.$them.'&'.SID.'">Назад</a>';
echo'<br><img src="../images/img/back.gif" alt=""> <a href="index.php?'.SID.'">Сообщества</a>';
echo'<br><img src="../images/img/homepage.gif" alt=""> <a href="../index.php?'.SID.'">На главную</a>';
include_once"../themes/$config_themes/foot.php";               
?>