<?
require("../config.php");
require("../func.php");
head();
aut();
ban();
$theme = num($_GET['theme']);
$theme_info = mysql_fetch_assoc(mysql_query("SELECT * FROM `room` WHERE `id` = '".$room."'"));

$razdel = $theme_info['razdel_id'];
$podforim = $theme_info['pod_forum'];

if ( $config['status_forum'] == 0) {
    echo "<div class=\"head\">Форум</div><div class=\"main\">";
    echo link1 . 'Форум отключен' . div;
    navig();
    foot();
    exit();
}

echo "<div class=\"head\">Чат: <b>Меню</b></div><div class=\"main\">";

if ( $_GET['mod'] == 'pchat' ) {
    echo '<form action="menu.php?mod=save&room='.$room.'" method="post" name="form">';
    echo 'Постов на стр.:<br/><input name="pchat" type="text" maxlength="20" value = "'.$max_msg_chat_session.'"/><br/>';
    echo '<input name="submit" type="submit" class="button" value="Сохранить" /></form><br/>';
}


if ( $_GET['mod'] == 'save' ) {
    if ( $_POST['pchat'] ) {
        $result = num($_POST['pchat']);
         mysql_query("UPDATE `profile` SET `max` = '".$result."' WHERE `id` = '".$id_session."'");
        header('Location: menu.php?room='.$room.'');
    }
    
}

if ( $_GET['mod'] == 'vvod' ) {
    if ( $vvod_session == NULL) {
        $result = 1;
    } else {
        $result = 0;
    }
    mysql_query("UPDATE `profile` SET `vvod_forum` = '".$result."' WHERE `id` = '".$id_session."'");
    header('Location: menu.php?room='.$room.'');
}



echo 'Постов на стр.: <a href="menu.php?mod=pchat&room='.$room.'"><b>'.$max_msg_chat_session.'</b></a><br/>';

if ($vvod_session == NULL)
echo '<b>Поле ввода:</b> <a href="menu.php?mod=vvod&room='.$room.'"><b>Вкл</b></a><br/>';
else
echo '<b>Поле ввода:</b> <a href="menu.php?mod=vvod&room='.$room.'"><b>Выкл</b></a><br/>';
navig();
foot();
?>