Файл: forum/forum-r.php
Строк: 47
<?
include_once('../apahe/ini.php');
$forum_r = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum-r` WHERE `id` = '".int($_GET['id'])."'"));
$urlup='/forum/index';
$inc['title'] = 'Форум - '.$forum_r['name'].'';
include_once('../apahe/top.php');
if (!isset($apache)){
header ('location: /input.dll');
exit;
}
if (!$forum_r){
header ('location: /forum/index.dll');
exit;
}
$forum = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id` = '".int($forum_r['id-forum'])."'"));
$forum_s = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum-s` WHERE `id` = '1'"));
echo '<div class="main-text">';
echo '<a href="index.dll" title="Форум">Форум</a> | ';
echo '<a href="forum-'.int($forum['id']).'.dll" title="'.$forum['name'].'">'.$forum['name'].'</a> | ';
echo '<a href="new-topic-'.int($forum_r['id']).'.dll" title="Создать тему">Создать тему</a>';
echo '</div>';
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-u` WHERE `id-forum-r` = '".int($forum_r['id'])."'"), 0);
nav_start($total, $forum_s[tf]);
if ($total != 0){
$forum_u_c = mysql_query("SELECT * FROM `forum-u` WHERE `id-forum-r` = '".int($forum_r['id'])."' ORDER BY `last` DESC LIMIT $start, $forum_s[tf]");
while ($forum_u = mysql_fetch_assoc($forum_u_c)){
$f_m = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-m` WHERE `id-forum-u` = '".int($forum_u['id'])."'"), 0);
$f_m_n = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-m` WHERE `id-forum-u` = '".int($forum_u['id'])."' and `date` > '".(time()-86400)."'"), 0);
$f_m_t = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum-m` WHERE `id-forum-u` = '".int($forum_u['id'])."' ORDER BY `id` DESC LIMIT 1"));
$l_p = ceil($f_m/$forum_s[tm]);
echo '<div class="main-href">';
echo '<table width="100%" cellspacing="0" cellpadding="0">';
echo '<tr><td class="apa-l">';
echo '<a href="topic-'.int($forum_u['id']).'.dll?page='.$l_p.'" title="'.$forum_u['name'].'">';
icons('topic-'.int($forum_u['act']).'');
echo ''.$forum_u['name'].'';
echo '</td>';
echo '<td class="apa-r">';
echo '<time>'.$f_m.'';
if ($f_m_n!=0)echo '<new>+'.$f_m_n.'</new>';
echo '</time>';
echo '</td></tr>';
echo '</table>';
echo 'Последний: '.name($f_m_t['id-apache']).'</br>';
echo '</div>';
}}else{
error('В этом подразделе тем нету.');
}
view_nav('/forum/forum-r-'.int($forum['id']).'.dll?');
include_once('../apahe/bottom.php');
?>