<?

require'../config.php';
$tyu='left';
$title='Форум';
head();
require_once'check.php';
echo '<a name="up"></a>';

echo $div1.'<b>Форум</b>'.$div9;
//if(!$autorize)header('Location: '.H2.'noavt.php?wap=2');

function forum_who($rm=0,$room = NULL)
{
global $row, $time, $set, $ip, $soft;
if ($room=='') $room = 'forum';
mysql_query("DELETE FROM `forum_who` WHERE `user` = '".$row['id']."'");
mysql_query("DELETE FROM `forum_who` WHERE `time` < '".(time()-300)."'");
mysql_query("INSERT INTO `forum_who` (user,time,room,rm) values('$row[id]', '".time()."', '$room', '$rm')");
}

$mod = check($_GET['mod']);
$id  = check(intval($_GET['id']));

forum_who($id,$mod);
//mysql_query ("Update users set for='".$id."', sfor='0', tema='1' where id ='".$myid."'");


$asnumspr = mysql_affected_rows();
@$kolf = $kolf + $asnumspr;


if ($mod=='') require_once'inc/index.php';
else  require_once'inc/'.$mod.'.php';

/*switch ($mod)
{
default :
require_once'inc/index.php';
break;
case subfs :
require_once'inc/subfs.php';
break;
case temes :
require_once'inc/temes.php';// Вывод тем
break;
case addtem :
require_once'inc/addtem.php';//Создаем тему
break;
case tema :
require_once'inc/tema.php';//Тема
break;
case addpost :
require_once'inc/addpost.php';//Пишем сообщение
break;
case read :
require_once'inc/read.php';
break;
case delpost :
require_once'inc/delpost.php';
break;
case zakr :
require_once'inc/zakr.php';
break;
case editp :
require_once'inc/editp.php';
break;
case cit :
require_once'inc/cit.php';
break;
case files :
require_once'inc/files.php';
break;
case down :
require_once'inc/down.php';
break;
case bookmarks :
require_once'inc/bookmarks.php';
break;
case who :
require_once'inc/who.php';
break;
}*/
echo $fs1;
if ($mod=='') $mod = 'forum';
if ($mod!='tema')echo '<br /><dl><dt></dt></dl>';
$who = mysql_num_rows(mysql_query("SELECT * FROM `forum_who` WHERE `room` = '$mod' and `rm` = '$id'"));
echo '<a href="'.F.'who_'.$mod.'_'.$id.'">Кто тут?('.$who.')</a> | ';
echo '<a href="'.F.'nastroiki.php">Настройки</a> | <b><a href="'.F.'pravila.php">Правила</a></b> | <a href="'.F.'bbcode.php">BBcode</a> | <a href="'.H2.'smiles/">Смайлы</a> | <a href="'.F.'search.php">Поиск</a>';


echo '<br /><dl><dt></dt></dl>';
echo $div1.'<img src="'.H2.'img/naz.gif" alt="*"/> <a href="'.H2.'enter.php">На Главную</a>'.$div9;

foot ();
exit;
?>
