예제 #1
0
         $valid = false;
     }
 }
 if (isset($_POST['interest']) && is_numeric($_POST['interest'])) {
     $thread_data['INTEREST'] = $_POST['interest'];
     if (!thread_set_interest($tid, $thread_data['INTEREST'])) {
         $error_msg_array[] = gettext("Failed to update thread interest");
         $valid = false;
     }
 }
 // Admin Options
 if (session::check_perm(USER_PERM_FOLDER_MODERATE, $fid) || $thread_data['BY_UID'] == $uid && $thread_data['ADMIN_LOCK'] != THREAD_ADMIN_LOCK_ENABLED && forum_get_setting('allow_post_editing', 'Y') && (intval(forum_get_setting('post_edit_time', null, 0)) == 0 || time() - $thread_data['CREATED'] < intval(forum_get_setting('post_edit_time', null, 0) * MINUTE_IN_SECONDS))) {
     if (isset($_POST['rename']) && strlen(trim($_POST['rename'])) > 0) {
         $t_rename = trim($_POST['rename']);
         if ($t_rename !== trim($thread_data['TITLE'])) {
             if (thread_change_title($tid, $t_rename)) {
                 post_add_edit_text($tid, 1);
                 if (session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
                     admin_add_log_entry(RENAME_THREAD, array($tid, $thread_data['TITLE'], $t_rename));
                 }
             } else {
                 $error_msg_array[] = gettext("Failed to rename thread");
                 $valid = false;
             }
         }
     }
     if (isset($_POST['move']) && is_numeric($_POST['move'])) {
         $t_move = $_POST['move'];
         if (folder_is_valid($t_move) && $t_move !== $thread_data['FID']) {
             if ((session::check_perm(USER_PERM_FOLDER_MODERATE, $t_move) || session::check_perm(USER_PERM_THREAD_MOVE, $t_move) && $thread_data['BY_UID'] == $uid && $thread_data['ADMIN_LOCK'] != THREAD_ADMIN_LOCK_ENABLED && forum_get_setting('allow_post_editing', 'Y') && (intval(forum_get_setting('post_edit_time', null, 0)) == 0 || time() - $thread_data['CREATED'] < intval(forum_get_setting('post_edit_time', null, 0) * MINUTE_IN_SECONDS))) && thread_change_folder($tid, $t_move)) {
                 $new_folder_title = folder_get_title($t_move);
예제 #2
0
                $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";
echo "<form accept-charset=\"utf-8\" name=\"f_poll\" action=\"edit_poll.php\" method=\"post\" target=\"_self\">\n";