if ($mode == 'dl_delete' && $topic_id) { if (!IS_ADMIN) { $sql = "SELECT forum_id FROM " . BB_TOPICS . " WHERE topic_id = {$topic_id} LIMIT 1"; if (!($row = DB()->sql_fetchrow(DB()->sql_query($sql)))) { bb_die('Could not obtain forum_id for this topic'); } $is_auth = auth(AUTH_ALL, $row['forum_id'], $userdata); if (!$is_auth['auth_mod']) { bb_die($lang['NOT_MODERATOR']); } } if (!$confirmed) { $hidden_fields = array('t' => $topic_id, 'mode' => 'dl_delete'); print_confirmation(array('QUESTION' => $lang['DL_LIST_DEL_CONFIRM'], 'FORM_ACTION' => 'dl_list.php', 'HIDDEN_FIELDS' => build_hidden_fields($hidden_fields))); } clear_dl_list($topic_id); redirect("{$redirect_type}?{$redirect}"); } // Update DL status $req_topics_ary = $topics_ary = array(); // Get topics selected by user if ($mode == 'set_topics_dl_status') { if (!isset($_POST['dl_topics_id_list']) || !is_array($_POST['dl_topics_id_list'])) { bb_die($lang['NONE_SELECTED']); } foreach ($_POST['dl_topics_id_list'] as $topic_id) { $req_topics_ary[] = (int) $topic_id; } } elseif ($mode == 'set_dl_status') { $req_topics_ary[] = (int) $topic_id; }
$type = $lock ? 'mod_topic_lock' : 'mod_topic_unlock'; foreach ($log_topics as $topic_id => $topic_title) { $log_action->mod($type, array('forum_id' => $forum_id, 'topic_id' => $topic_id, 'topic_title' => $topic_title)); } $msg = $lock ? $lang['TOPICS_LOCKED'] : $lang['TOPICS_UNLOCKED']; bb_die(return_msg_mcp($msg)); break; // Set or unset topics DL-type // Set or unset topics DL-type case 'set_download': case 'unset_download': $set_download = $mode == 'set_download'; $new_dl_type = $set_download ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL; DB()->query("\n\t\t\tUPDATE " . BB_TOPICS . " SET\n\t\t\t\ttopic_dl_type = {$new_dl_type}\n\t\t\tWHERE topic_id IN({$topic_csv})\n\t\t\t\tAND forum_id = {$forum_id}\n\t\t\t\tAND topic_moved_id = 0\n\t\t"); if ($mode == 'unset_download') { clear_dl_list($topic_csv); } $msg = $set_download ? $lang['TOPICS_DOWN_SETS'] : $lang['TOPICS_DOWN_UNSETS']; bb_die(return_msg_mcp($msg)); break; case 'split': //mpd $delete_posts = isset($_POST['delete_posts']); $split = isset($_POST['split_type_all']) || isset($_POST['split_type_beyond']); $posts = isset($_POST['post_id_list']) ? $_POST['post_id_list'] : array(); $start = 0; $topic_first_post_id = isset($topic_row['topic_first_post_id']) ? $topic_row['topic_first_post_id'] : ''; $post_id_sql = $req_post_id_sql = array(); if (($split || $delete_posts) && ($posts && $topic_id && $forum_id && $topic_first_post_id) && $confirmed) { foreach ($posts as $post_id) { if ($pid = intval($post_id)) {