diff options
Diffstat (limited to 'phpBB/modules/mcp')
-rw-r--r-- | phpBB/modules/mcp/mcp_main.php | 9 | ||||
-rw-r--r-- | phpBB/modules/mcp/mcp_notes.php | 7 | ||||
-rw-r--r-- | phpBB/modules/mcp/mcp_queue.php | 19 | ||||
-rw-r--r-- | phpBB/modules/mcp/mcp_topic.php | 2 | ||||
-rw-r--r-- | phpBB/modules/mcp/mcp_warn.php | 7 |
5 files changed, 33 insertions, 11 deletions
diff --git a/phpBB/modules/mcp/mcp_main.php b/phpBB/modules/mcp/mcp_main.php index 8a9a930678..b2b71722e2 100644 --- a/phpBB/modules/mcp/mcp_main.php +++ b/phpBB/modules/mcp/mcp_main.php @@ -909,6 +909,11 @@ function mcp_delete_post($post_ids) } else { + if ($affected_topics != 1 || $deleted_topics || !$topic_id) + { + $redirect = append_sid('mcp', "f=$forum_id&i=main&mode=forum_view", false); + } + meta_refresh(3, $redirect); trigger_error($success_msg . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . '<br /><br />' . implode('<br /><br />', $return_link)); } @@ -1160,8 +1165,8 @@ function mcp_fork_topic($topic_ids) } sync('forum', 'forum_id', $to_forum_id); - set_config('num_topics', phpbb::$config['num_topics'] + sizeof($new_topic_id_list), true); - set_config('num_posts', phpbb::$config['num_posts'] + $total_posts, true); + set_config_count('num_topics', sizeof($new_topic_id_list), true); + set_config_count('num_posts', $total_posts, true); foreach ($new_topic_id_list as $topic_id => $new_topic_id) { diff --git a/phpBB/modules/mcp/mcp_notes.php b/phpBB/modules/mcp/mcp_notes.php index b39f10428c..ed0bf373bf 100644 --- a/phpBB/modules/mcp/mcp_notes.php +++ b/phpBB/modules/mcp/mcp_notes.php @@ -220,13 +220,16 @@ class mcp_notes 'PAGINATION' => generate_pagination($this->u_action . "&st=$st&sk=$sk&sd=$sd", $log_count, phpbb::$config['posts_per_page'], $start), 'TOTAL_REPORTS' => ($log_count == 1) ? phpbb::$user->lang['LIST_REPORT'] : sprintf(phpbb::$user->lang['LIST_REPORTS'], $log_count), - 'USERNAME' => $userrow['username'], - 'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '', 'RANK_TITLE' => $rank_title, 'JOINED' => phpbb::$user->format_date($userrow['user_regdate']), 'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0, 'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0, + 'USERNAME_FULL' => get_username_string('full', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), + 'USERNAME_COLOUR' => get_username_string('colour', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), + 'USERNAME' => get_username_string('username', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), + 'U_PROFILE' => get_username_string('profile', $userrow['user_id'], $userrow['username'], $userrow['user_colour']), + 'AVATAR_IMG' => $avatar_img, 'RANK_IMG' => $rank_img, )); diff --git a/phpBB/modules/mcp/mcp_queue.php b/phpBB/modules/mcp/mcp_queue.php index 147a63cf59..ff4698b117 100644 --- a/phpBB/modules/mcp/mcp_queue.php +++ b/phpBB/modules/mcp/mcp_queue.php @@ -488,12 +488,18 @@ function approve_post($post_id_list, $id, $mode) $total_topics = $total_posts = 0; $forum_topics_posts = $topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = $forum_id_list = $approve_log = array(); - $user_posts_sql = array(); + $user_posts_sql = $post_approved_list = array(); $update_forum_information = false; foreach ($post_info as $post_id => $post_data) { + if ($post_data['post_approved']) + { + $post_approved_list[] = $post_id; + continue; + } + $topic_id_list[$post_data['topic_id']] = 1; if ($post_data['forum_id']) @@ -579,6 +585,11 @@ function approve_post($post_id_list, $id, $mode) $update_forum_information = true; } } + $post_id_list = array_values(array_diff($post_id_list, $post_approved_list)); + for ($i = 0, $size = sizeof($post_approved_list); $i < $size; $i++) + { + unset($post_info[$post_approved_list[$i]]); + } if (sizeof($topic_approve_sql)) { @@ -648,12 +659,12 @@ function approve_post($post_id_list, $id, $mode) if ($total_topics) { - set_config('num_topics', phpbb::$config['num_topics'] + $total_topics, true); + set_config_count('num_topics', $total_topics, true); } if ($total_posts) { - set_config('num_posts', phpbb::$config['num_posts'] + $total_posts, true); + set_config_count('num_posts', $total_posts, true); } unset($topic_approve_sql, $topic_replies_sql, $post_approve_sql); @@ -729,7 +740,7 @@ function approve_post($post_id_list, $id, $mode) } else { - $success_msg = (sizeof($post_id_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS'; + $success_msg = (sizeof($post_id_list) + sizeof($post_approved_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS'; } } else diff --git a/phpBB/modules/mcp/mcp_topic.php b/phpBB/modules/mcp/mcp_topic.php index c5a8a3fa88..91579b1059 100644 --- a/phpBB/modules/mcp/mcp_topic.php +++ b/phpBB/modules/mcp/mcp_topic.php @@ -496,7 +496,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $success_msg = 'TOPIC_SPLIT_SUCCESS'; // Update forum statistics - set_config('num_topics', phpbb::$config['num_topics'] + 1, true); + set_config_count('num_topics', 1, true); // Link back to both topics $return_link = sprintf(phpbb::$user->lang['RETURN_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid('viewtopic', 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); diff --git a/phpBB/modules/mcp/mcp_warn.php b/phpBB/modules/mcp/mcp_warn.php index 6b3f896ae4..734a61b8f2 100644 --- a/phpBB/modules/mcp/mcp_warn.php +++ b/phpBB/modules/mcp/mcp_warn.php @@ -407,13 +407,16 @@ class mcp_warn phpbb::$template->assign_vars(array( 'U_POST_ACTION' => $this->u_action, - 'USERNAME' => $user_row['username'], - 'USER_COLOR' => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '', 'RANK_TITLE' => $rank_title, 'JOINED' => phpbb::$user->format_date($user_row['user_regdate']), 'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0, 'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0, + 'USERNAME_FULL' => get_username_string('full', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), + 'USERNAME_COLOUR' => get_username_string('colour', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), + 'USERNAME' => get_username_string('username', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), + 'U_PROFILE' => get_username_string('profile', $user_row['user_id'], $user_row['username'], $user_row['user_colour']), + 'AVATAR_IMG' => $avatar_img, 'RANK_IMG' => $rank_img, |