Пример #1
0
            $db->sql_query("UPDATE " . $prefix . "_stories SET score=score+{$score}, ratings=ratings+1 WHERE sid={$sid}");
            $info = base64_encode(implode(':', $rcookie));
            setcookie('ratecookie', $info, time() + 3600, $MAIN_CFG['cookie']['path']);
        }
        cpg_error($rated, _ARTICLERATING, URL::index('News&file=article&sid=' . $sid));
    } else {
        cpg_error(_DIDNTRATE, _ARTICLERATING);
    }
}
$sid = isset($_POST['sid']) ? intval($_POST['sid']) : (isset($_GET['sid']) ? intval($_GET['sid']) : 0);
if ((isset($_POST['postreply']) || isset($_POST['preview']) || isset($_GET['reply']) || isset($_GET['comment'])) && (!$MAIN_CFG['global']['articlecomm'] || $db->sql_count($prefix . '_stories', "sid={$sid} AND acomm=0"))) {
    URL::redirect(URL::index('&file=article&sid=' . $sid));
}
require_once "modules/{$module_name}/comments.php";
if (isset($_POST['postreply'])) {
    replyPost($sid);
    // store the reply
} else {
    if (isset($_GET['reply'])) {
        reply($sid);
        // reply to comment
    } elseif (isset($_POST['preview'])) {
        replyPreview($sid);
        // Preview the reply before storage
    } else {
        if (isset($_GET['comment'])) {
            // Show comment X
            if (!isset($_GET['pid'])) {
                singlecomment(intval($_GET['comment']), $sid);
            } else {
                DisplayComments($sid, '', intval($_GET['pid']), intval($_GET['comment']));
Пример #2
0
    // 86400 is one day
    $db->sql_query('DELETE FROM ' . $prefix . "_poll_check WHERE time < {$past}");
    if (!pollVoted($poll_id)) {
        $ctime = time();
        $db->sql_query('INSERT INTO ' . $prefix . "_poll_check (user_id, ip, time, poll_id) VALUES ('" . $userinfo['user_id'] . "', " . $userinfo['user_ip'] . ", '{$ctime}', '{$poll_id}')");
        $db->sql_query('UPDATE ' . $prefix . "_poll_data SET option_count=option_count+1 WHERE poll_id='{$poll_id}' AND vote_id=" . intval($_POST['vote_id']));
        $db->sql_query('UPDATE ' . $prefix . "_poll_desc SET voters=voters+1 WHERE poll_id='{$poll_id}'");
    }
    $forwarder = isset($_POST['forwarder']) ? $_POST['forwarder'] : 0;
    if (strlen($forwarder < 5)) {
        $forwarder = URL::index('&op=results&pollid=' . $poll_id);
    }
    URL::redirect($forwarder);
} elseif (isset($_POST['postreply'])) {
    // store the reply
    replyPost($poll_id);
}
require_once 'header.php';
OpenTable();
if (isset($_GET['reply'])) {
    // reply to comment
    reply($poll_id);
} elseif (isset($_POST['preview'])) {
    // Preview the reply before storage
    replyPreview($poll_id);
} else {
    if (isset($_GET['comment'])) {
        // Show comment X
        if (!isset($_GET['pid'])) {
            singlecomment(intval($_GET['comment']), $poll_id);
        } else {