View file forum/topnew.php

File size: 3.88Kb
<?php
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"setforum.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";
include_once"dop.php";

echo'<img src="../images/img/menu.gif" alt=""> <b>Топ новых тем '.$config_title.'</b><br><hr>';

$suf = @file(BASEDIR."local/dataforumset/dataforumuser/$log.dat");
if ($suf!=""){
$lsf = explode(":||:",$suf[0]);}

if($config_forum_off=="1"){

if ($provlog==$_SESSION['log'] && $provpar==md5($_SESSION['par']) && $_SESSION['log']!="" && md5($_SESSION['par'])!=""){

if($config_top_newthem=="1"){
if(!empty($lsf[4]) || $config_usnastr==0){

$text = @file("../local/profil/$log.prof"); 
if ($text!=""){
$udata = explode(":||:",$text[0]);
$provlog=trim($udata[0]);
$provpar=trim($udata[1]);
$dostup=trim($udata[7]);
$graf=trim($udata[42]);
$privat=trim($udata[10]);
if ($udata[91]!==""){
$post_last=$udata[91];}}
$post=$config_forumpost;

$dir = opendir ("../local/dataforum"); 
while ($file = readdir ($dir)) 
{if (ereg (".dat$", $file) && !ereg (".sex$", $file) && !ereg("^top", $file)&& !ereg("^main", $file)) 
{$a[]=$file;}} 
closedir ($dir); 		
$total = count($a); 

$a=str_replace(".dat","",$a);		
for ($i = 0; $i < $total; $i++){
$tex = file("../local/dataforum/$a[$i].dat");
$lines=array_reverse($tex);
$data=explode("|", $lines[0]);
$last=trim($data[9]);

if ($last=="CLOSED") {
$data1=explode("|", $lines[1]); 
$last=trim($data1[9]);}

$dat_total[]=$last;
$dat_count[]=$a[$i];}

arsort($dat_total);

foreach($dat_total as $k=>$v){
$tex = file("../local/dataforum/$dat_count[$k].dat");
$fs=count($tex)-1;
$data = explode("|",$tex[$fs]);	
	
if(!$dat_count[$k]==""){
$vk++;
$file = @file("../local/dataforum/$dat_count[$k].dat");
$pagg=count($file);
$str=$pagg/$config_forumpost;
$str=(int)$str;
$page=$str*$config_forumpost;
if ($pagg==$page) $page=$page-$config_forumpost;


$dat_ball2[]='<div class="b"><img src="../images/img/files.gif" alt=""> <b>'.$vk.'. <a href="index.php?r='.$data[11].'&amp;fid='.$data[8].'&amp;id='.$dat_count[$k].'&amp;page='.$page.'&amp;'.SID.'">'.$data[3].'</a></b></div>Всего сообщений: '.$pagg.'<br>Посл. сообщение: '.nicknamed($data[0],$number).' ('.$data[5].'/'.$data[6].')<br>';}}

if (empty($start))
{$start = 0;}
$start = intval($start);
if ($start < 0){$start = 0;}
if ($total < $start + $post){ $end = $total; }
else {$end = $start + $post; }

for ($i = $start; $i < $end; $i++){

echo $dat_ball2[$i];
}

print "<center><hr>";
if ($start != 0){print "<a href=topnew.php?action=list&amp;start=".($start - $post).">&lt;-Назад </a>";} else{echo'&lt;-Назад ';}
echo'|'; 
if ($total > $start + $post){print "<a href=topnew.php?action=list&amp;start=".($start + $post)."> Далее-&gt;</a> \n";} else{echo' Далее-&gt;';}
if ($total < $start + $post){ $end = $total; }
else {$end = $start + $post; }
print "</center><hr>";

}else{
echo'<center><font color="red">Топ новых тем на форуме отключен вами в личных настройках!!!</font></center>';}}

if($config_top_newthem=="0"){
echo'<center><font color="red">Топ новых тем на форуме отключен!!!</font></center>';}

}else{
echo'Вы не авторизованы для просмотра';}
}

if($config_forum_off=="0"){
echo'<center><font color="red">Форум сайта отключен!</font></center>';}

echo'<img src="../images/img/back.gif" alt=""> <a href="index.php?'.SID.'">Форум</a><br>';
echo '<img src="../images/img/homepage.gif" alt=""> <a href="../index.php?'.SID.'">На главную</a>';
include_once"../themes/$config_themes/foot.php";
?>