コード例 #1
0
    } else {
        return false;
    }
}
if (!isset($poll_id) || !is_valid_poll_id($poll_id)) {
    $redirect = "index.php?session={$auth['session']}&uid={$auth['uid']}";
    header("Location: {$redirect}");
    exit;
}
if (!isset($action)) {
    $action = '';
}
no_cache_header();
switch ($action) {
    case "save":
        $message = save($poll_id);
        $message = $lang[$message];
        poll_edit($poll_id, "{$message}");
        break;
    case "extend":
        poll_extend($poll_id);
        break;
    case "add":
        $message = add_options($poll_id, $last_id);
        $message = $lang[$message];
        poll_edit($poll_id, "{$message}");
        break;
    default:
        $message = $lang["EditText"];
        poll_edit($poll_id, "{$message}");
}
コード例 #2
0
ファイル: edit_poll.php プロジェクト: richstokoe/BeehiveForum
            if ($close_poll == POLL_CLOSE_THREE_DAYS) {
                $poll_closes = time() + DAY_IN_SECONDS * 3;
            } else {
                if ($close_poll == POLL_CLOSE_SEVEN_DAYS) {
                    $poll_closes = time() + DAY_IN_SECONDS * 7;
                } else {
                    if ($close_poll == POLL_CLOSE_THIRTY_DAYS) {
                        $poll_closes = time() + DAY_IN_SECONDS * 30;
                    } else {
                        $poll_closes = false;
                    }
                }
            }
        }
        $poll_delete_votes = poll_edit_check_questions($tid, $poll_questions_array) || $poll_data['POLLTYPE'] != $poll_type || $poll_data['VOTETYPE'] != $poll_vote_type;
        poll_edit($tid, $poll_questions_array, $poll_closes, $change_vote, $poll_type, $show_results, $poll_vote_type, $option_type, $allow_guests, $poll_delete_votes);
        thread_change_title($tid, $thread_title);
        post_add_edit_text($tid, 1);
        post_save_attachment_id($tid, $pid, $aid);
    }
    header_redirect("discussion.php?webtag={$webtag}&msg={$tid}.1&edit_success={$tid}.1");
}
if (!($folder_dropdown = folder_draw_dropdown($fid, "fid", "", FOLDER_ALLOW_POLL_THREAD, USER_PERM_POST_EDIT, "", "post_folder_dropdown"))) {
    html_draw_error(gettext("You cannot create new threads."));
}
html_draw_top(sprintf("title=%s", gettext("Edit Poll")), "basetarget=_blank", "resize_width=785", "post.js", "poll.js", "attachments.js", "dictionary.js", "emoticons.js", 'class=window_title');
echo "<h1>", gettext("Edit Poll"), "</h1>\n";
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    html_display_error_array(array_unique($error_msg_array), '785', 'left');
}
echo "<br />\n";