<?php
#-----------------------------------------------------#
#          ********* Бизнес Сайты *********           #
#             Made by   :  BIZON                      #
#               E-mail  :  blin.alex@bk.ru            #
#                 Site  :  http://f913218p.bget.ru    #
#  Вы не имеете право вносить изменения в код скрипта #
#      это может повлечь неработоспособность сайта    #
#-----------------------------------------------------#
////////////////////////////////////////////////////////////// Навигация
if(isset($st)){
echo'<div class="wrapper">';
echo'<div id="breadcrumb">';
echo'<ul>';
echo'<li><a href="'.$link.SID.'" title="Назад">Разделы</a></li>';
echo'<li>&#187;</li>';
if($st==5)echo'<li class="first">Мои Темы</li>';
if($st==4 or $st==6 or $st==7 or $st==8){
echo'<li><a href="'.$link.'st=1&amp;raz='.$db_f['razdel'].'&amp;'.SID.'"" title="Назад">'.inf_db(s_forum_razdel,id,$db_f['razdel'],name).'</a></li>';
echo'<li>&#187;</li>';
echo'<li><a href="'.$link.'st=2&amp;praz='.$db_f['podrazdel'].'&amp;'.SID.'"" title="Назад">'.inf_db(s_forum_podraz,id,$db_f['podrazdel'],name).'</a></li>';
echo'<li>&#187;</li>';
}
if($st==2 or $st==3){
echo'<li><a href="'.$link.'st=1&amp;raz='.$db_f['razdel'].'&amp;'.SID.'"" title="Назад">'.inf_db(s_forum_razdel,id,$db_f['razdel'],name).'</a></li>';
echo'<li>&#187;</li>';}
if($st==3){echo'<li><a href="'.$link.'st=2&amp;praz='.$db_f['id'].'&amp;'.SID.'"" title="Назад">'.$db_f['name'].'</a></li>';
echo'<li>&#187;</li>';
echo'<li class="first">Новая Тема</li>';}
if($st!=3 && $st<=4)echo'<li class="first">'.$db_f['name'].'</li>';
if($st>=6){echo'<li><a href="'.$link.'st=4&amp;tema='.$db_f['id'].'&amp;'.SID.'">'.$db_f['name'].'</a></li>';
echo'<li>&#187;</li>';
}
if($st==6)echo'<li class="first">Изменить тему</li>';
if($st==7)echo'<li class="first">Закрыть/Открыть</li>';
if($st==8)echo'<li class="first">Удалить тему</li>';
echo'</ul>';
echo'</div></div>';
}
///////////////////////////////////////////////////////////// Середина
echo'<div class="wrapper">';
echo'<div class="container">';
/////////////////////////////////

switch($st)
{
case 1: /////////////////////////// Разделы
if($db_f['status']!=0){
echo'<div class="warning">Данны раздел закрыт Администрацией сайта</div>';
}else{
$total=all_dbnamewatstatus(s_forum_podraz,razdel,$db_f['id'],status,0);
echo'<table width="100%"  class="forumline">';
echo'<tr class="thf">';
echo'<th width="62%" colspan="2" class="thCornerL" height="25"> Раздел</th>';
echo'<th width="7%" class="thTop">Тем</th>';
echo'<th width="7%" class="thCornerR">Ответов</th>';
echo'<th width="28%" class="thCornerR" nowrap="nowrap">Обновление</th></tr>';
echo'<tr height="28"><td class="catLeft" colspan="2" align="center"><b>'.$db_f['name'].'</b></td>';
echo'<td class="rowpic" colspan="4" align="right">&nbsp;</td></tr>';
if($total==0){
echo'<tr align="center" valign="middle" height="50">';
echo'<td width="3%" class="row1"><img src="images/folder.gif" alt="" border="0"></td>';
echo'<td width="60%" class="row1" align="left"><b>В нанном разделе нет неодного подраздела.</b></td>';
echo'<td class="row2"></td>';
echo'<td class="row2"></td>';
echo'<td class="row2" align=left></td></tr>';
}else{
if ($start < 0 || $start > $total){$start = 0;}
$dbrazd="SELECT * FROM s_forum_podraz WHERE `razdel`='".$db_f['id']."' and `status`= '0' ORDER BY name LIMIT $start,8";
$dbpv=mysql_query($dbrazd);
while($pvv=mysql_fetch_array($dbpv)){
echo'<tr align="center" valign="middle" height="50">';
echo'<td width="3%" class="row1"><img src="images/folder.gif" alt="" border="0"></td>';
echo'<td width="60%" class="row1" align="left">';
echo'<span class="forumlink"><a href="'.$link.'st=2&amp;praz='.$pvv['id'].'&amp;'.SID.'">'.$pvv['name'].'</a>
<br/></span><small>'.$pvv['opis'].'</small></td>';
echo'<td class="row2"><small>'.small_dbnamewatstatus(s_forum_tema,razdel,$db_f['id'],podrazdel,$pvv['id'],status,0).'</small></td>';
echo'<td class="row2"><small>'.small_dbnamewatstatus(s_forum_mgs,razdel,$db_f['id'],podrazdel,$pvv['id'],status,0).'</small></td>';
echo'<td class="row2" align=left>';
if(small_dbnamewatstatus(s_forum_tema,razdel,$db_f['id'],podrazdel,$pvv['id'],status,0)!=0){
$dbgf="SELECT * FROM s_forum_tema WHERE `podrazdel`='".$pvv['id']."' and `status`='0' ORDER BY time LIMIT 1";
$dbfg=mysql_query($dbgf);
while($pgg=mysql_fetch_array($dbfg)){
echo'<span>тема: <a href="'.$link.'st=4&amp;tema='.$pgg['id'].'&amp;'.SID.'">'.str($pgg['name']).'</a>
<br /><a href=/?p=profil&amp;id='.$pgg['user'].'&amp;'.SID.'"><b>'.prof_dan(login,$pgg['user']).'</b></a>'.prof_onli($pgg['user'],2).'<br />дата: '.date("d.m.y - h:i",$pgg['time']).'</span>';
}}
echo'</td></tr>';
}}
echo'</table>';
if($total>8)page_strnavigation($link."st=$st&amp;raz=".$db_f['id']."&amp;", 8, $start, $total);
}
break;
////////////////////////////////////
case 2: /////////////////////////// Подразделы
if($db_f['status']!=0){
echo'<div class="warning">Данны подраздел закрыт Администрацией сайта</div>';
}else{
if($numaz != 0)echo'<p><a href="'.$link.'st=3&amp;praz='.$db_f['id'].'&amp;'.SID.'"><img src="images/newthread.gif" border="0"></a></p>';

$total=all_dbnamewatstatus(s_forum_tema,podrazdel,$db_f['id'],status,0);
echo'<table width="100%"  class="forumline">';
echo'<tr class="thf">';
echo'<th width="62%" colspan="2" class="thCornerL" height="25"> Подраздел</th>';
echo'<th width="7%" class="thTop">Ответов</th>';
echo'<th width="7%" class="thCornerR">Автор</th>';
echo'<th width="28%" class="thCornerR" nowrap="nowrap">Обновление</th></tr>';
echo'<tr height="28"><td class="catLeft" colspan="2" align="center"><b>'.$db_f['name'].'</b></td>';
echo'<td class="rowpic" colspan="4" align="right">&nbsp;</td></tr>';
if($total==0){
echo'<tr align="center" valign="middle" height="50">';
echo'<td width="3%" class="row1"><img src="images/folder.gif" alt="" border="0"></td>';
echo'<td width="60%" class="row1" align="left"><b>В нанном подраздели нет тем.</b></td>';
echo'<td class="row2"></td>';
echo'<td class="row2"></td>';
echo'<td class="row2" align=left></td></tr>';
}else{
$dbrazd="SELECT * FROM s_forum_tema WHERE `podrazdel`='".$db_f['id']."' and `status`='0' ORDER BY time LIMIT $start,8";
$dbpv=mysql_query($dbrazd);
while($pvv=mysql_fetch_array($dbpv)){
echo'<tr align="center" valign="middle" height="50">';
echo'<td width="3%" class="row1"><img src="images/tem.gif" alt="" border="0"></td>';
echo'<td width="60%" class="row1" align="left">';
echo'<span class="forumlink"><a href="'.$link.'st=4&amp;tema='.$pvv['id'].'&amp;'.SID.'">'.$pvv['name'].'</a>
<br/></span><small>'.$pvv['opis'].'</small></td>';
echo'<td class="row2"><small>'.all_dbnamewatstatus(s_forum_mgs,tema,$pvv['id'],status,0).'</small></td>';
echo'<td class="row2"><small>'.prof_dan(login,$pvv['user']).'</small></td>';
echo'<td class="row2" align=left>';
if(all_dbnamewatstatus(s_forum_mgs,tema,$pvv['id'],status,0)!=0){
$dbgf="SELECT * FROM s_forum_mgs WHERE `tema`='".$pvv['id']."' and `status`='0' ORDER BY time LIMIT 1";
$dbfg=mysql_query($dbgf);
while($pgg=mysql_fetch_array($dbfg)){
echo'<span>Последний ответ
<br /><a href=/?p=profil&amp;id='.$pgg['user'].'&amp;'.SID.'"><b>'.prof_dan(login,$pgg['user']).'</b></a>'.prof_onli($pgg['user'],2).'<br />дата: '.date("d.m.y - h:i",$pgg['time']).'</span>';
}}
echo'</td></tr>';
}}
echo'</table>';
if($total>8)page_strnavigation($link."st=$st&amp;praz=".$db_f['id']."&amp;", 8, $start, $total);
}
break;
////////////////////////////////////
case 3: /////////////////////////// Добавить тему
if($numaz==0){
echo'<div class="warning">Пройдите регистрацию </div>';
}else{
if($db_f['status']!=0){
echo'<div class="warning">Данны подраздел закрыт Администрацией сайта</div>';
}else{
if(!empty($error))echo'<div class="error">'.$error.'</div>';
echo'<form method="post" action="'.$link.'st='.$st.'&amp;praz='.$praz.'&amp;'.SID.'" id="form">';
echo'<div class="field"><label>Название:</label><div class="input"><input type="text" name="nazvan"  maxlength="150"></div></div>';
echo'<div class="field"><label>';
bb_codimg();
echo'</label><div class="input"><textarea id="textarea" type="text" name="text"  maxlength="3000" ></textarea></div></div>';
echo'<input type="hidden" name="add" value="go"><div class="submit"><button type="submit">Добавить тему</button></div>';
echo'</form>';
include_once("includes/bbcod.php");
}}
break;
///////////////////////////////////
case 4: /////////////////////////// Темы

if($db_f['user']==$usert or $admin>0){
echo'<div class="content">';
if($db_f['stat']==1) $rkf="Открыть"; else $rkf="Закрыть";
}

if($db_f['user']==$usert or $admin>0 or $status!=0){

echo'<h2>'.$db_f['name'].'</h2>';
echo'<table class="forumline" width="100%" cellspacing="1" cellpadding="3">';
echo'<tr>';
echo'<th class="thLeft" width="160" height="16" nowrap="nowrap">Автор</th>';
echo'<th class="thRight">Дата сообщения: <b>'.date("d.m.y h:i:s",$db_f['time']).'</b></th></tr>';
echo'<tr height="150">';
echo'<td class="row2" valign="top">';
echo'<span class="name"><br />';
echo'<center>
<a href="/?p=profil&amp;id='.$db_f['user'].'&amp;'.SID.'"><img src="images/avatar/'.prof_dan(avatar,$db_f['user']).'" width="100" height="100" alt="user" class="userpic" /></a>
<br /><b><a href=/?p=profil&amp;id='.$db_f['user'].'&amp;'.SID.'">'.prof_dan(login,$db_f['user']).'</a></b><br />'.prof_onli($db_f['user'],1).'<br />
<b>'.status_us(prof_dan(admin,$db_f['user'])).'</b>';
if(all_dbnamewatstatus(s_forum_mgs,user,$db_f['user'],status,0)!=0)echo'<br />Ответов: <b>'.all_dbnamewatstatus(s_forum_mgs,user,$db_f['user'],status,0).'</b>';
echo'</center></td>';
echo'<td class="row2" width="100%" height="28" valign="top">';
echo'<span class="postbody">'.bb_code($db_f['mgs']).'</span>';
echo'</td></tr>';


$total = all_dbnamewatstatus(s_forum_mgs,tema,$db_f['id'],status,0);
if($total!=0){
if ($start < 0 || $start > $total){$start = 0;}
$dbrazd="SELECT * FROM s_forum_mgs WHERE `tema`='".$db_f['id']."' and `status`= '0' ORDER BY time LIMIT $start,3";
$dbpv=mysql_query($dbrazd);
while($pvv=mysql_fetch_array($dbpv)){
echo'<tr>';
echo'<th class="thLeft" width="160" height="14" nowrap="nowrap"></th>';
echo'<th class="thRight" height="14">Ответ: '.date("d.m.y h:i:s",$pvv['time']).'</th></tr>';
echo'<tr>';
echo'<td class=row3 valign=middle><span class="name"><br />
<center><a href="/?p=profil&amp;id='.$pvv['user'].'&amp;'.SID.'"><img src="images/avatar/'.prof_dan(avatar,$pvv['user']).'" width="100" height="100" alt="user" class="userpic" /></a>
<br /><b><a href=/?p=profil&amp;id='.$pvv['user'].'&amp;'.SID.'">'.prof_dan(login,$pvv['user']).'</a></b><br />'.prof_onli($pvv['user'],1).'<br />
<b>'.status_us(prof_dan(admin,$pvv['user'])).'</b>';
if(all_dbnamewatstatus(s_forum_mgs,user,$pvv['user'],status,0)!=0)echo'<br />Ответов: <b>'.all_dbnamewatstatus(s_forum_mgs,user,$pvv['user'],status,0).'</b>';
echo'</center></td>';
echo'<td class="row3" width="100%" valign="top"><span class="postbody">'.bb_code($pvv['mgs']).'</span></td>';
echo'</tr>';
}}
echo'</table><br />';
if($total>3)page_strnavigation($link."st=$st&amp;tema=$tema&amp;", 3, $start, $total);

if($numaz==0){
echo'<div class="warning">Для того чтобы ответить на тему вам необходимо пройти регистрацию или авторизироваться, если вы зарегистрированы на сайте.</div>';
}else{
if($db_f['stat']==1){
echo'<div class="warning">Данная тема закрыта автором или Администратором сайта</div>';
}else{
if($db_f['status']==0){
if(!empty($error))echo'<div class="error">'.$error.'</div>';
echo'<div align="center"><form method="post" action="'.$link.'st='.$st.'&amp;tema='.$tema.'&amp;'.SID.'" id="form">';
echo'<div class="field"><label align="left">';
bb_codimg();
echo'</label><div class="input" align="left"><textarea id="textarea" type="text" name="text"  maxlength="3000" ></textarea></div></div>';
echo'<input type="hidden" name="add" value="go"><div class="submit"><button type="submit">Добавить ответ</button></div>';
echo'</form></div>';
include_once("includes/bbcod.php");
}}}
if($db_f['user']==$usert or $admin>0){
/////////////////////////////////////// Навигация
echo'</div><div class="column">';
echo'<div class="subnav">';
echo'<h2>Функции</h2>';
echo'<ul>';
echo'<li><a href="'.$link.'st=5&amp;'.SID.'">Мои Темы ('.all_dbnamewat(s_forum_tema,user,s_userdan(id)).')</a></li>';
echo'<li><a href="'.$link.'st=6&amp;tema='.$db_f['id'].'&amp;'.SID.'">Изменить</a></li>';
echo'<li><a href="'.$link.'st=7&amp;tema='.$db_f['id'].'&amp;'.SID.'">'.$rkf.'</a></li>';
echo'<li><a href="'.$link.'st=8&amp;tema='.$db_f['id'].'&amp;'.SID.'">Удалить</a></li>';
echo'</ul>';
echo'</div>';
echo'</div>';
///////////////////////////////////// низ
}}else{
echo'<div class="warning">Данная тема закрыта Администратором сайта</div>';
}
break;
///////////////////////////////////
case 5: /////////////////////////// мои темы
if($numaz==0){
echo'<div class="warning">Для в хода в данную категорию необходима авторизация</div>';
}else{
$total=all_dbnamewat(s_forum_tema,user,s_userdan(id));
echo'<table width="100%"  class="forumline">';
echo'<tr class="thf">';
echo'<th width="62%" colspan="2" class="thCornerL" height="25"> Мои темы</th>';
echo'<th width="7%" class="thTop">Ответов</th>';
echo'<th width="7%" class="thCornerR">Изменить</th>';
echo'<th width="28%" class="thCornerR" nowrap="nowrap">Подраздел</th></tr>';
echo'<tr height="28"><td class="catLeft" colspan="2" align="center"></td>';
echo'<td class="rowpic" colspan="4" align="right">&nbsp;</td></tr>';
if($total==0){
echo'<tr align="center" valign="middle" height="50">';
echo'<td width="3%" class="row1"><img src="images/tem.gif" alt="" border="0"></td>';
echo'<td width="60%" class="row1" align="left"><b>Вы несоздали не одной темы.</b></td>';
echo'<td class="row2"></td>';
echo'<td class="row2"></td>';
echo'<td class="row2" align=left></td></tr>';
}else{
$dbrazd="SELECT * FROM s_forum_tema WHERE `user`='".s_userdan(id)."' ORDER BY time LIMIT $start,10";
$dbpv=mysql_query($dbrazd);
while($pvv=mysql_fetch_array($dbpv)){
echo'<tr align="center" valign="middle" height="50">';
echo'<td width="3%" class="row1"><img src="images/tem.gif" alt="" border="0"></td>';
echo'<td width="60%" class="row1" align="left">';
echo'<span class="forumlink"><a href="'.$link.'st=4&amp;tema='.$pvv['id'].'&amp;'.SID.'">'.$pvv['name'].'</a>
<br/></span><small>'.$pvv['opis'].'</small></td>';
echo'<td class="row2"><small>'.all_dbnamewat(s_forum_mgs,tema,$pvv['id']).'</small></td>';
echo'<td class="row2"><small>
<form action="'.$link.'st=6&amp;tema='.$pvv['id'].'&amp;'.SID.'" method="post">
<input type=image src="images/edit.gif" name="sub">
</form></small></td>';
echo'<td class="row2" align=left>';
if($pvv['status']==1) $rkf="<span class='price'>На проверке</span>"; else $rkf="<span class='reduce'>Проверено</span>";
echo'<span>'.$rkf.'</span>';
echo'</td></tr>';
}}
echo'</table>';
if($total>10)page_strnavigation($link."st=$st&amp;", 10, $start, $total);
}
break;
case 6: /////////////////////////// Изменить тему
if(all_dbnamewatstatus(s_forum_tema,id,$tema,user,s_userdan(id))!=0 or $admin>0){
if(!empty($error))echo'<div class="error">'.$error.'</div>';
echo'<form method="post" action="'.$link.'st='.$st.'&amp;tema='.$tema.'&amp;'.SID.'" id="form">';
echo'<div class="field"><label>Название:</label><div class="input"><input type="text" name="nazvan"  maxlength="150" value="'.$db_f['name'].'"></div></div>';
echo'<div class="field"><label>';
bb_codimg();
echo'</label><div class="input"><textarea id="textarea" type="text" name="text"  maxlength="3000" >'.$db_f['mgs'].'</textarea></div></div>';
echo'<input type="hidden" name="add" value="go"><div class="submit"><button type="submit">Изменить тему</button></div>';
echo'</form>';
include_once("includes/bbcod.php");
}
break;
/////////////////////////////////////////////////////
case 7: /////////////////////////// Закрыть тему
if(all_dbnamewatstatus(s_forum_tema,id,$tema,user,s_userdan(id))!=0 or $admin>0){
if($db_f['stat']==0){
$knop="Закрыть Тему";
echo'<div class="warning">После того как вы закроете данную тему, никто не сможет больше написать ответ!</div>';
}else{
$knop="Открыть Тему";
echo'<div class="warning">После того как вы откроете данную тему, все смогут написать ответ!</div>';
}
echo'<form method="post" action="'.$link.'st='.$st.'&amp;tema='.$tema.'&amp;'.SID.'" id="form">';
echo'<input type="hidden" name="zak" value="go"><div class="submit"><button type="submit">'.$knop.'</button></div>';
echo'</form>';
echo'</div></div>';
}
break;
//////////////////////////////////
case 8: /////////////////////////// Удалить тему
if(all_dbnamewatstatus(s_forum_tema,id,$tema,user,s_userdan(id))!=0 or $admin>0){
echo'<div class="warning">Вы действительно хотите удалить тему?</div>';
echo'<form method="post" action="'.$link.'st='.$st.'&amp;tema='.$tema.'&amp;'.SID.'" id="form">';
echo'<input type="hidden" name="zak" value="del"><div class="submit"><button type="submit">Да удалить</button></div>';
echo'</form>';
}
break;
//////////////////////////////////
default:
$total=all_dbnamewat(s_forum_razdel,status,0);
if ($total>0){
echo'<table width="100%"  class="forumline">';
echo'<tr class="thf">';
echo'<th width="62%" colspan="2" class="thCornerL" height="25"> Форумы</th>';
echo'<th width="7%" class="thTop">Тем</th>';
echo'<th width="7%" class="thCornerR">Ответов</th>';
echo'<th width="28%" class="thCornerR" nowrap="nowrap">Обновление</th></tr>';
$strdb="SELECT * FROM s_forum_razdel WHERE `status`= '0' ORDER BY name ";
$rdd=mysql_query($strdb);
while($ron=mysql_fetch_array($rdd)){
echo'<tr height="28"><td class="catLeft" colspan="2" align="center"><b><a class="con" href="'.$link.'st=1&amp;raz='.$ron['id'].'&amp;'.SID.'">'.$ron['name'].' ('.all_dbnamewatstatus(s_forum_podraz,razdel,$ron['id'],status,0).')</a></b></td>';
echo'<td class="rowpic" colspan="4" align="right">&nbsp;</td></tr>';
if(all_dbnamewatstatus(s_forum_podraz,razdel,$ron['id'],status,0)==0){
echo'<tr align="center" valign="middle" height="50">';
echo'<td width="3%" class="row1"><img src="images/folder.gif" alt="" border="0"></td>';
echo'<td width="60%" class="row1" align="left"><b>В нанном разделе нет неодного подраздела.</b></td>';
echo'<td class="row2"></td>';
echo'<td class="row2"></td>';
echo'<td class="row2" align=left></td></tr>';
}else{
$dbrazd="SELECT * FROM s_forum_podraz WHERE `razdel`='".$ron['id']."' and `status`= '0' ORDER BY name LIMIT 4";
$dbpv=mysql_query($dbrazd);
while($pvv=mysql_fetch_array($dbpv)){
echo'<tr align="center" valign="middle" height="50">';
echo'<td width="3%" class="row1"><img src="images/folder.gif" alt="" border="0"></td>';
echo'<td width="60%" class="row1" align="left">';
echo'<span class="forumlink"><a href="'.$link.'st=2&amp;praz='.$pvv['id'].'&amp;'.SID.'">'.$pvv['name'].'</a>
<br/></span><small>'.$pvv['opis'].'</small></td>';
echo'<td class="row2"><small>'.all_dbnamewatstatus(s_forum_tema,podrazdel,$pvv['id'],status,0).'</small></td>';
echo'<td class="row2"><small>'.all_dbnamewatstatus(s_forum_mgs,podrazdel,$pvv['id'],status,0).'</small></td>';
echo'<td class="row2" align=left>';
if(all_dbnamewatstatus(s_forum_tema,podrazdel,$pvv['id'],status,0)!=0){
$dbgf="SELECT * FROM s_forum_tema WHERE `podrazdel`='".$pvv['id']."' and `status`='0' ORDER BY time LIMIT 1";
$dbfg=mysql_query($dbgf);
while($pgg=mysql_fetch_array($dbfg)){
$str = rtrim( mb_substr( strip_tags( $pgg['name'] ), 0, 250 ), "!,.-" );
$str = substr( $str , 0, strrpos( $str , ' ' ) );
echo'<span>тема: <a href="'.$link.'st=4&amp;tema='.$pgg['id'].'&amp;'.SID.'">'.$str.'</a>
<br /><a href=/?p=profil&amp;id='.$pgg['user'].'&amp;'.SID.'"><b>'.prof_dan(login,$pgg['user']).'</b></a>'.prof_onli($pgg['user'],2).'<br />дата: '.date("d.m.y - h:i",$pgg['time']).'</span>';
}}
echo'</td></tr>';
}}
}
echo'</table>';

echo'<br /><table width="100%" cellpadding="3" cellspacing="1" class="forumline">
<tr><td class="catHead" colspan="2" height="28"><span class="cattitle">Статистика</span></td></tr><tr>';
echo'<td class="row1" align="center" valign="middle" rowspan="2"><img src="images/whosonline.gif"></td> ';
echo'<td class="row1" align="left" width="95%"><span class="gensmall">';
echo'Подразделов: <b>'.all_dbname(s_forum_podraz).'</b><br>Всего тем: <b>'.all_dbname(s_forum_tema).'</b><br>Сообщений: <b>'.all_dbname(s_forum_mgs).'</b>';
$dbtem="SELECT * FROM s_forum_tema WHERE `status`= '0' ORDER BY time DESC LIMIT 1";
$dbtema=mysql_query($dbtem);
$dbt=mysql_fetch_array($dbtema);
echo'<br>Последняя тема: <a href="'.$link.'st=4&amp;tema='.$dbt['id'].'&amp;'.SID.'">'.$dbt['name'].'</a>';
if($nfor['tema']==0) $iter1="Не проверяются";  else  $iter1="Проверяются";
if($nfor['mgs']==0) $iter2="Не проверяются";  else  $iter2="Проверяются";
echo'<br>Новые темы: <b>'.$iter1.'</b>';
echo'<br>Новые ответы: <b>'.$iter2.'</b>';
echo'</span></td></tr></table>';
}else{
echo'<div class="warning">Форум не имеет ни одного раздела для обсуждения!</div>';
}
}
echo'<br class="clear" />';
echo'</div>';
echo'</div>';
?>