<?
echo $fs1;
if(forum_new()>0)$forum_new = '<span style="color:red">'.forum_new().'</span>';
else $forum_new = ''.forum_new().'';
echo '<dl><dt></dt></dl>Новые <a href="'.F.'new_t.php">Темы</a> | <a href="'.F.'new_p.php">Сообщения</a><br />Мои <a href="'.F.'my_t.php">Темы</a> | <a href="'.F.'my_p.php">Сообщения</a> | <a href="'.F.'bookmarks/0">Закладки</a>
<br /><a href="'.F.'new.php"><b>Непрочитанное ('.$forum_new.')</b></a><br /><dl><dt></dt></dl>';

echo '<b>Форумы:</b>';

$que = @mysql_query("select * from  `forum_sections` order by pos" );
while ($dtm = @mysql_fetch_array($que))
{

$f = $dtm['id'];
$f_name = $dtm['name'];

$q3 = mysql_query("select * from `forum_message` WHERE section = '$f';");
$num = mysql_num_rows($q3);
$qw = @mysql_query("select * from  `forum_topic` WHERE section = '$f';");
$kol = mysql_num_rows($qw);
$q = @mysql_query("select * from  `forum_topic` WHERE section = '$f' order by time desc limit 1;");
$q = @mysql_query("select * from  `forum_topic` WHERE section = '$f' order by time desc limit 1;");
$tem = @mysql_fetch_array($q);
echo '<br />';


echo $div2;
if ($row['level']>=7) {
echo '<a href="'.F.'admin/f3/'.$f.'"><img src="'.H2.'img/p2.png" alt="*"/></a> <b><a href="'.F.'subfs/'.$f.'">'.$f_name.'</a></b> ('.$kol.'/'.$num.') <a href="'.F.'subfs/'.$f.'/end">&gt;&gt;</a>';
} else{
echo '<img src="'.H2.'img/p2.png" alt="*"/> <b><a href="'.F.'subfs/'.$f.'">'.$f_name.'</a></b> ('.$kol.'/'.$num.') <a href="'.F.'subfs/'.$f.'/end">&gt;&gt;</a>';
}
echo $div9;
if ($row['razd']==1){
$q1 = mysql_query('SELECT * from `forum_subfor` WHERE section = "'.$f.'" order by pos limit 10;');
$k = mysql_num_rows($q1);
if ( $k == 0 )
{
echo 'Здесь разделов пока нет :)<br /> ';
}
while ($dtm = @mysql_fetch_array($q1))
{
echo '<img src="'.H2.'img/004.png" alt="*"/> <a href="'.F.'temes/'.$dtm['id'].'">'.$dtm['name'].'</a> ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_topic` WHERE `section` = '$f' AND `subfor` = '".$dtm['id']."'"),0).'/'.mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_message` WHERE `section` = '$f' AND `subfor` = '".$dtm['id']."'"),0).')<br />';
}
}
$k = @mysql_fetch_array(mysql_query('SELECT * from `forum_subfor` WHERE id = "'.$tem['subfor'].'";'));
echo 'Раздел: <a href="'.F.'temes/'.$tem['subfor'].'">'.$k['name'].'</a><br />Тема: <a href="'.F.'tema/'.$tem['id'].'/end">'.$tem['name'].'</a><br />';
$time = $tem['time'];
$post = @mysql_fetch_array(mysql_query("select * from  `forum_message` WHERE topic = '".$tem['id']."' order by time desc limit 1;"));
$sect4 = @mysql_fetch_array(mysql_query( @"select * from  `users` WHERE id = '$post[login]' ;" ));
if($autorize) {
echo 'Сообщение: <a href="'.H2.''.$sect4['id'].'">'.$sect4['user'].'</a>';
}else{
echo 'Сообщение: <b>'.$login1.'</b>';
}
print date("(d.m в H:i", $time).')';
}


if ($row['level']>=7) {echo '<br /><br /><dl><dt></dt></dl>';echo '<img src="'.H2.'img/add.png" alt="[ADD]"/> <a href="'.F.'admin/f1"><b>Создать</b></a><br/>';
echo '<dl><dt></dt></dl>';
}
echo $fs2;

?>