예제 #1
0
    }
    if ((session::get_value('UID') != $preview_message['FROM_UID'] || session::check_perm(USER_PERM_PILLORIED, 0)) && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
        html_draw_top(sprintf("title=%s", gettext("Error")));
        post_edit_refuse($tid, $pid);
        html_draw_bottom();
        exit;
    }
    if (forum_get_setting('require_post_approval', 'Y') && isset($preview_message['APPROVED']) && $preview_message['APPROVED'] == 0 && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
        html_draw_top(sprintf("title=%s", gettext("Error")));
        post_edit_refuse($tid, $pid);
        html_draw_bottom();
        exit;
    }
}
if (isset($_POST['endpoll'])) {
    if (poll_close($tid)) {
        post_add_edit_text($tid, 1);
        if (session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid) && $preview_message['FROM_UID'] != session::get_value('UID')) {
            admin_add_log_entry(EDIT_POST, array($t_fid, $tid, $pid));
        }
    }
    if ($thread_data['LENGTH'] > 1) {
        header_redirect("discussion.php?webtag={$webtag}&msg={$msg}&edit_success={$msg}");
        exit;
    } else {
        header_redirect("discussion.php?webtag={$webtag}&edit_success={$msg}");
        exit;
    }
}
html_draw_top(sprintf("title=%s", gettext("Close Poll")), "post.js", "resize_width=720", "basetarget=_blank", 'class=window_title');
echo "<h1>", gettext("Close Poll"), " {$tid}.{$pid}</h1>\n";
예제 #2
0
            $poll_votes_array = $_POST['pollvote'];
            if (poll_check_tabular_votes($tid, $poll_votes_array)) {
                poll_vote($tid, $poll_votes_array);
            } 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['pollclose'])) {
        if (isset($_POST['tid']) && is_numeric($_POST['tid'])) {
            $tid = $_POST['tid'];
            if (isset($_POST['confirm_pollclose'])) {
                poll_close($tid);
            } else {
                html_draw_top(sprintf("title=%s", gettext("Error")));
                poll_confirm_close($tid);
                html_draw_bottom();
                exit;
            }
        }
    } else {
        if (isset($_POST['pollchangevote'])) {
            if (isset($_POST['tid']) && is_numeric($_POST['tid'])) {
                $tid = $_POST['tid'];
                $pid = 1;
                poll_delete_vote($tid);
            }
        }