<?PHP include('header.php'); 
echo '<link rel="stylesheet" href="/css/forum.css" type="text/css" />';
?>
<span class='top-bl-s-verh'>Форум проекта WM Rush</span>
<div class='menucenter-top1'>
<table class='profile' width='100%' border='0' cellpadding='0' cellspacing='0' style='margin-bottom: 0;'>
<tr><td class='value1'>
Уважаемый пользователь! Просьба не спамить и соблюдать правила проекта, за нарушения правил предусмотренны наказания.
</td></tr>
</table>
<?PHP
include('forum_last_post.php');
?>
<table class='profile10' width='100%' border='0' cellpadding='0' cellspacing='0' style='margin-bottom: 10px;'>
<tr>
<td><center>
<? require 'inc/rotator.php'; ?>
</center>
</td>
</tr>
</table>
<table class="profile"  cellspacing="0" cellpadding="0" border="0" width="100%">


<?PHP
$sql = mysql_query("SELECT `id`, `sections` FROM `b_forum_sect` ORDER BY `sort` ASC") or die(mysql_error());
while($row = mysql_fetch_assoc($sql)){
?>
<thead>
<th class="f-section" colspan="5"><center><?=$row["sections"]?></center></td>
</thead><tbody>
<?PHP
$sql_s = mysql_query("SELECT `id`, `title`, `description` FROM `b_forum_sub_sect` WHERE `id_sect`='".$row["id"]."' ORDER BY `sort` ASC") or die(mysql_error());
while($row_s = mysql_fetch_assoc($sql_s)){
$sql_t = mysql_query("SELECT `id_user`, `topic`, `time` FROM `b_forum_topic` WHERE `id_sub`='".$row_s["id"]."' ORDER BY `id` DESC") or die(mysql_error());
$f_count = mysql_num_rows($sql_t);
if($f_count > 0){
$row_t = mysql_fetch_assoc($sql_t);
$f_topic = $row_t["topic"];
$f_user = ucfirst(get_us_name($row_t["id_user"]));
if($row_t["time"] > (time()-24*3600)){
$f_date = "<span class='f-time-now'>".date("d-m-y H:i", $row_t["time"])."</span>";
}else{
$f_date = "<span class='f-time-old'>".date("d-m-y H:i", $row_t["time"])."</span>";
}
}else{
$f_topic = "Нет созданых тем";
$f_user = NULL;
$f_date = NULL;
}
?>
<tr>
<td class="f-subsection">
<a style="text-decoration:none;" href="/forum_topic.php?id=<?=$row_s["id"]?>"><?=$row_s["title"]?></a>
<span class="f-subsection"><?=$row_s["description"]?></span>
</td><td>
<?=$f_count;?>
</td><td align="center">
<?
echo "<center><b>".$f_topic."</b><br />";
echo "<span class='f-us-autor'>".$f_user."</span></center>";
?>
</td>
</tr>
<?
}
}
?>
</tbody>
</table>
</div>
<?PHP include('footer.php');?>