Example #1
0
    if ($msg = messages_get_most_recent($uid)) {
        list($tid, $pid) = explode('.', $msg);
    } else {
        light_html_draw_top(sprintf("title=%s", gettext("Error")), "robots=noindex,nofollow");
        light_html_display_error_msg(gettext("No Messages"));
        light_html_draw_bottom();
        exit;
    }
}
// Poll stuff
if (isset($_POST['pollsubmit'])) {
    if (isset($_POST['tid']) && is_numeric($_POST['tid'])) {
        $tid = $_POST['tid'];
        if (isset($_POST['pollvote']) && is_array($_POST['pollvote'])) {
            $poll_votes = $_POST['pollvote'];
            if (poll_check_tabular_votes($tid, $poll_votes)) {
                poll_vote($tid, $poll_votes);
            } else {
                light_html_draw_top(sprintf("title=%s", gettext("Error")));
                light_html_display_error_msg(gettext("You must vote in every group."));
                light_html_draw_bottom();
                exit;
            }
        } else {
            light_html_draw_top(sprintf("title=%s", gettext("Error")));
            light_html_display_error_msg(gettext("You must select an option to vote for!"));
            light_html_draw_bottom();
            exit;
        }
    }
} else {
Example #2
0
    $msg = $_GET['msg'];
} else {
    if (isset($_POST['msg']) && validate_msg($_POST['msg'])) {
        $msg = $_POST['msg'];
    } else {
        if (($msg = messages_get_most_recent($_SESSION['UID'])) === false) {
            html_draw_error(gettext("Invalid Message ID or no Message ID specified."));
        }
    }
}
list($tid, $pid) = explode('.', $msg);
// Poll stuff
if (isset($_POST['poll_submit'])) {
    if (isset($_POST['poll_vote']) && is_array($_POST['poll_vote'])) {
        $poll_votes_array = $_POST['poll_vote'];
        if (poll_check_tabular_votes($tid, $poll_votes_array)) {
            poll_vote($tid, $poll_votes_array);
            header_redirect("messages.php?webtag={$webtag}&msg={$msg}");
        } else {
            html_draw_error(gettext("You must pick and answer for every question"));
        }
    } else {
        html_draw_error(gettext("You must select an answer to vote for"));
    }
} else {
    if (isset($_POST['poll_change_vote'])) {
        poll_delete_vote($tid);
        header_redirect("messages.php?webtag={$webtag}&msg={$msg}");
    } else {
        if (isset($_POST['post_vote_down_x']) || isset($_POST['post_vote_up_x'])) {
            $post_rating = isset($_POST['post_vote_down_x']) ? -1 : 1;