Файл: forum/forums.php
Строк: 31
<?php
require_once '../ini/sys.php';
require_once 'ini.php';
$title = 'Форум / '.$razdel['name'].' / '.$fo['name'].'';
require_once(HOME .'/ini/head.php');
if(!mysql_num_rows($q3)){
echo '<div class="err">Данного форума не существует.</div>';
require_once '../ini/end.php';
}
if(isset($user)){echo '<div class="main"><img src="'.URL.'/forum/img/newthem.png"></img> <a href="../'.$razdel['id'].'/'.$fo['id'].'/new">Новая тема</a></div>';}
$ct = mysql_result(mysql_query("SELECT COUNT(id) FROM forumt WHERE forums = '$id'"),0);
if($ct == 0)echo '<div class="err">Нет тем в данном форуме.</div>';
if(isset($user)){$str = ''.$user['str'].'';}
else{$str="5";}
$k_page = k_page($ct,$str);
$page = page($k_page);
$start = $str*$page-$str;
$q4 = mysql_query("SELECT * FROM forumt WHERE forums = '$fo[id]' ORDER BY up DESC, timenew DESC LIMIT $start, $str");
while($tema = mysql_fetch_assoc($q4)){
$pst = mysql_result(mysql_query("SELECT COUNT(*) FROM forump WHERE tema = '$tema[id]'"),0);
echo '<div class="main">';
if($tema['close'] == 1)echo '<img src="'.URL.'/forum/img/close.png"></img> ';
else
echo'<img src="'.URL.'/forum/img/them.png"></img> ';
echo '<a href="/forum/'.$razdel['id'].'/'.$fo['id'].'/'.$tema['id'].'">'.$tema['name'].'</a> ('.$pst.') <a href="/forum/'.$razdel['id'].'/'.$fo['id'].'/'.$tema['id'].'/page=end">»</a> ';
if($tema['up'] == 1)echo ' <img src="'.URL.'/forum/img/up.png"></img>';
echo '<div class="cit">';
$post = mysql_fetch_assoc(mysql_query("SELECT user, time FROM forump WHERE tema = '".$tema['id']."' ORDER BY time DESC LIMIT 1"));
ank($tema['user']);
echo ' / ';
ank($post['user']);
echo ' ('.vtime($post['time']).')</div></div>';
}
if($k_page>1)str("/forum/$razdel[id]/$fo[id]/",$k_page,$page);
echo '<div class="aut"><a href="../">Форум</a> / <a href="../'.$razdel['id'].'">'.$razdel['name'].'</a> / '.$fo['name'].'</div>';
require_once(HOME .'/ini/end.php');
?>