View file system/comm_reply.php

File size: 1.46Kb
<?php

if ($u['id']) {
    $comm_r = mysql_query("SELECT `id`, `id_".$type."`, `id_user` FROM `".$type."_comm` WHERE `id` = '$id'");
    $comm = mysql_fetch_assoc($comm_r);
    if ($comm['id_user']) {
        if ($ok) {
            if (TIME > $_SESSION['antispam']) {
                if ($_POST['text']) {
                    $text = check($_POST['text']);
                    mysql_query("INSERT INTO `".$type."_comm` SET `id_".$type."` = '".$comm['id_'.$type]."', `id_user` = '$u[id]', `text` = '$text', `time` = '".TIME."'");
                    $_SESSION['antispam'] = TIME + $config['antispam'];
                    redirect('?act=comm&id='.$comm['id_'.$type]);
                } else {
                    redirect('?act=comm_reply&id='.$id);
                }
            } else {
                error($lang['antispam'].' '.$config['antispam'].' sec.');
                nav('?act=comm&amp;id='.$comm['id_'.$type]);
            }
        } else {
            tp($lang['reply']);
            echo '<form action="?act=comm_reply&amp;id='.$id.'&amp;ok=1" method="post">
            '.$lang['text'].'(max250):<br /><textarea name="text" cols="" rows="3">[b]'.justusername($comm['id_user']).'[/b], </textarea><br />';
            echo '<input name="submit" type="submit" value="Ok" />
            </form>';
            nav('?act=comm&amp;id='.$comm['id_'.$type]);
        }
    } else {
        redirect('?');
    }
} else {
    redirect('login.php');
}


?>