Файл: forum/index.php
Строк: 46
<?
include_once('../apahe/ini.php');
$urlup='/forum/index';
$inc['title'] = 'Форум';
include_once('../apahe/top.php');
if (!isset($apache)){
header ('location: /input.dll');
exit;
}
$forum_on = mysql_result(mysql_query("SELECT COUNT(*) FROM `on` WHERE `url` = '/forum/index'"), 0);
$forum_s = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum-s` WHERE `id` = '1'"));
echo '<div class="main-text">';
echo '<a href="new.dll" title="Новые">Новые</a> | ';
echo '<a href="top-20.dll" title="Популярные">Топ 20</a></br>';
echo '<a href="apa-topic.dll" title="Мои темы">Мои темы</a> | ';
echo '<a href="apa-post.dll" title="Мои сообщения">Мои сооб.</a> | ';
echo '<a href="on-who.dll" title="В форуме '.$forum_on.' чел">В форуме: '.$forum_on.' чел</a>';
echo '</div>';
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum`"), 0);
nav_start($total, $forum_s[tf]);
if ($total!=0){
$forum_c = mysql_query("SELECT * FROM `forum` ORDER BY `id` LIMIT $start, $forum_s[tf]");
while ($forum = mysql_fetch_assoc($forum_c)){
$f_u = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-u` WHERE `id-forum` = '".int($forum['id'])."'"), 0);
$f_u_n = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-u` WHERE `id-forum` = '".int($forum['id'])."' and `date` > '".(time()-86400)."'"), 0);
$f_m = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-m` WHERE `id-forum` = '".int($forum['id'])."'"), 0);
$f_m_n = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum-m` WHERE `id-forum` = '".int($forum['id'])."' and `date` > '".(time()-86400)."'"), 0);
echo '<div class="main-href">';
echo '<table width="100%" cellspacing="0" cellpadding="0">';
echo '<tr><td class="apa-l">';
echo '<a href="forum-'.int($forum['id']).'.dll" title="'.$forum['name'].'">';
icons('folder');
echo ''.$forum['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>';
echo ''.out($forum['message']).'';
echo '</div>';
}}else{
error('Разделы не добавлены');
}
view_nav('/forum/index.dll?');
include_once('../apahe/bottom.php');
?>