Вход Регистрация
Файл: vsime.com/comm/inc/act_comm_join.php
Строк: 118
<?
    
if(mysqli_num_rows(mysqli_query($dbi"SELECT * FROM `comm` WHERE `id` = '".intval($_GET['id'])."'"))!=0)
    {
        
$comm=mysqli_query($dbi"SELECT * FROM `comm` WHERE `id` = '".intval($_GET['id'])."'");
        
$comm=mysqli_fetch_array($comm);

        
$cat=mysqli_query($dbi"SELECT * FROM `comm_cat` WHERE `id` = '$comm[id_cat]'");
        
$cat=mysqli_fetch_array($cat);
        if (
mysqli_num_rows(mysqli_query($dbi"SELECT * FROM `comm_users` WHERE `id_comm` = '$comm[id]' AND `activate` = '1' AND `invite` = '0'"))==0)$comm['id_user']=0;
        
$ank=profile($comm['id_user']); // sozdak
        
$title .= ' - '.htmlspecialchars($comm['name']).' - Доступность'// Заголовок страницы
        
ex_head();
        if(
$ank['id']==$user['id'] && isset($user))
        {
            if(isset(
$_POST['submited']))
            {
                if (
hsc(@$_POST['mdp'])==$mdp)
                {
                    if(isset(
$_POST['adult']) && $_POST['adult']==1)$comm['adult']=1;else $comm['adult']=0;
                    
mysqli_query($dbi"UPDATE `comm` SET `adult` = '$comm[adult]' WHERE `id` = '$comm[id]'");
                    if(isset(
$_POST['chat']) && $_POST['chat']==1)$comm['chat']=1;else $comm['chat']=0;
                    
mysqli_query($dbi"UPDATE `comm` SET `chat` = '$comm[chat]' WHERE `id` = '$comm[id]'");
                    if(isset(
$_POST['forum']) && $_POST['forum']==1)$comm['forum']=1;else $comm['forum']=0;
                    
mysqli_query($dbi"UPDATE `comm` SET `forum` = '$comm[forum]' WHERE `id` = '$comm[id]'");
                    if(isset(
$_POST['files']) && $_POST['files']==1)$comm['files']=1;else $comm['files']=0;
                    
mysqli_query($dbi"UPDATE `comm` SET `files` = '$comm[files]' WHERE `id` = '$comm[id]'");
                    if(
$_POST['join_rule']==1)$comm['join_rule']=1;elseif($_POST['join_rule']==2)$comm['join_rule']=2;else $comm['join_rule']=3;
                    
mysqli_query($dbi"UPDATE `comm` SET `join_rule` = '$comm[join_rule]' WHERE `id` = '$comm[id]'");
                    if(
$_POST['read_rule']==1)$comm['read_rule']=1;else $comm['read_rule']=2;
                    
mysqli_query($dbi"UPDATE `comm` SET `read_rule` = '$comm[read_rule]' WHERE `id` = '$comm[id]'");
                    if(
$_POST['write_rule']==1)$comm['write_rule']=1;else $comm['write_rule']=2;
                    
mysqli_query($dbi"UPDATE `comm` SET `write_rule` = '$comm[write_rule]' WHERE `id` = '$comm[id]'");
                    if(
$_POST['chat_rule']==1)$comm['chat_rule']=1;else $comm['chat_rule']=2;
                    
mysqli_query($dbi"UPDATE `comm` SET `chat_rule` = '$comm[chat_rule]' WHERE `id` = '$comm[id]'");
                    if(!isset(
$error))
                    {
                        
msg("Изменения сохранены");
                    }
                } else 
hacked_by_Killer();
            }
            
show_errors();
            echo 
"<form method='post' action='' class='multi'>";
                echo 
"<div class='list'>n";
                    echo 
"<input type='checkbox' name='adult' value='1'".($comm['adult']==1?" checked='checked'":null)."> Только для взрослых <span class='spared'>(18+)</span><br/>n";
                echo 
"</div>n";
                echo 
"<div class='list'>n";
                    echo 
"<b class='none'>Разделы сообщества</b><br/>n";
                    echo 
"<input type='checkbox' name='chat' value='1'".($comm['chat']==1?" checked='checked'":null)."> Чат<br/>n";
                    echo 
"<input type='checkbox' name='forum' value='1'".($comm['forum']==1?" checked='checked'":null)."> Форум<br/>n";
                    echo 
"<input type='checkbox' name='files' value='1'".($comm['files']==1?" checked='checked'":null)."> Файлы<br/>n";
                echo 
"</div>n";
                echo 
"<div class='list'>n";
                    echo 
"<b class='none'>Членство</b><br/>n";
                    echo 
"<input type='radio' name='join_rule' value='1'".($comm['join_rule']==1?" checked='checked'":null).">Свободное<br/>n";
                    echo 
"<input type='radio' name='join_rule' value='2'".($comm['join_rule']==2?" checked='checked'":null).">Через модератора<br/>n";
                    echo 
"<input type='radio' name='join_rule' value='3'".($comm['join_rule']==3?" checked='checked'":null).">По приглашениям<br/>";
                echo 
"</div>n";
                echo 
"<div class='list'>n";
                    echo 
"<b class='none'>Настройки форума</b><br/>n";
                    echo 
"<span>Читатели:</span><br/>n";
                    echo 
"<input type='radio' name='read_rule' value='1'".($comm['read_rule']==1?" checked='checked'":null).">Свободное<br/>n";
                    echo 
"<input type='radio' name='read_rule' value='2'".($comm['read_rule']==2?" checked='checked'":null).">Только участники<br/>n";
                    echo 
"<span>Писатели:</span><br/>n";
                    echo 
"<input type='radio' name='write_rule' value='1'".($comm['write_rule']==1?" checked='checked'":null).">Свободное<br/>n";
                    echo 
"<input type='radio' name='write_rule' value='2'".($comm['write_rule']==2?" checked='checked'":null).">Только участники<br/>n";
                echo 
"</div>n";
                echo 
"<div class='list'>n";
                    echo 
"<b class='none'>Настройки чата</b><br/>n";
                    echo 
"<input type='radio' name='chat_rule' value='1'".($comm['chat_rule']==1?" checked='checked'":null).">Открыт для всех<br/>n";
                    echo 
"<input type='radio' name='chat_rule' value='2'".($comm['chat_rule']==2?" checked='checked'":null).">Только участники<br/>n";
                echo 
"</div>n";
                echo 
"<div class='list'>n";
                echo 
"<input type='hidden' name='mdp' value='$mdp'>n";
                echo 
"<input name='submited' type='submit' value='Сохранить'> <a href='?act=comm_settings&id=$comm[id]'>Назад</a>n";
                echo 
"</div>n";
            echo 
"</form>";
            echo 
"<div class='foot'>n";
                echo 
image_back()." <a href='?act=comm&id=$comm[id]'>В сообщество</a>n";
            echo 
"</div>";
            }
        else{
header("Location:/comm");exit;}
    }
    else{
header("Location:/comm");exit;}
?>
Онлайн: 0
Реклама