Файл: forum/forum.php
Строк: 49
<?
include_once('../apahe/ini.php');
$forum = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum` WHERE `id` = '".int($_GET['id'])."'"));
$urlup='/forum/index';
$inc['title'] = ''.$forum['name'].'';
include_once('../apahe/top.php');
if (!isset($apache)){
header ('location: /input.dll');
exit;
}
if (!$forum){
header ('location: /forum/index.dll');
exit;
}
$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 '</div>';
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-r` WHERE `id-forum` = '".int($forum['id'])."'"), 0);
nav_start($total, $forum_s[tf]);
if ($total != 0){
$forum_r_c = mysql_query("SELECT * FROM `forum-r` WHERE `id-forum` = '".int($forum['id'])."' ORDER BY `id` LIMIT $start, $forum_s[tf]");
while ($forum_r = mysql_fetch_assoc($forum_r_c)){
$f_u = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-u` WHERE `id-forum-r` = '".int($forum_r['id'])."'"), 0);
$f_u_n = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-u` WHERE `id-forum-r` = '".int($forum_r['id'])."' and `date` > '".(time()-86400)."'"), 0);
$f_m = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-m` WHERE `id-forum-r` = '".int($forum_r['id'])."'"), 0);
$f_m_n = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-m` WHERE `id-forum-r` = '".int($forum_r['id'])."' and `date` > '".(time()-86400)."'"), 0);
$f_u_t = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum-u` WHERE `id-forum-r` = '".int($forum_r['id'])."' ORDER BY `id` DESC LIMIT 1"));
echo '<div class="main-href">';
echo '<table width="100%" cellspacing="0" cellpadding="0">';
echo '<tr><td class="apa-l">';
echo '<a href="forum-r-'.int($forum_r['id']).'.dll" title="'.$forum_r['name'].'">';
icons('folder');
echo ''.$forum_r['name'].'';
echo '</td>';
echo '<td class="apa-r">';
echo '<time>'.$f_u.'';
if ($f_u_n!=0)echo '<new>+'.$f_u_n.'</new>';
echo '/'.$f_m.'';
if ($f_m_n!=0)echo '<new>+'.$f_m_n.'</new>';
echo '</time>';
echo '</td></tr>';
echo '</table>';
if ($f_m_n!=0){
echo 'Последняя: '.$f_u_t['name'].'';
}else{
echo 'В этом разделе нету тем.';
}
echo '</div>';
}}else{
error('Подразделы не добавлены.');
}
view_nav('/forum/forum-'.int($forum['id']).'.dll?');
include_once('../apahe/bottom.php');
?>