diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index d9b88eca67..44e1808f1c 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -441,7 +441,7 @@ class mcp_main extends mcp 'S_SELECT_TOPIC' => ($mode == 'merge_select' && $row['topic_id'] != $this->topic_id) ? TRUE : FALSE, 'U_SELECT_TOPIC' => $this->url . '&mode=merge&to_topic_id=' . $row['topic_id'] . $this->selected_ids, - 'U_MCP_QUEUE' => $this->url . '&mode=approve&t=' . $row['topic_id'], + 'U_MCP_QUEUE' => $this->url . '&i=queue&mode=approve&t=' . $row['topic_id'], 'U_MCP_REPORT' => $this->url . '&mode=reports&t=' . $row['topic_id'], 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_attach', sprintf($user->lang['TOTAL_ATTACHMENTS'], $row['topic_attachment'])) : '', @@ -860,7 +860,7 @@ class mcp_main extends mcp 'S_POST_UNAPPROVED' => ($row['post_approved']) ? FALSE : TRUE, 'U_POST_DETAILS' => "mcp.$phpEx$SID&f=" . $row['forum_id'] . '&t=' . $row['topic_id'] . '&p=' . $row['post_id'] . '&mode=post_details', - 'U_APPROVE' => "mcp.$phpEx$SID&mode=approve&p=" . $row['post_id'] + 'U_APPROVE' => "mcp.$phpEx$SID&i=queue&mode=approve&p=" . $row['post_id'] )); unset($rowset[$i]); diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index dc647d5896..a8a4579ae1 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -132,7 +132,8 @@ class mcp_queue extends mcp $db->sql_query($sql); // Now resync everything - sync('topic', 'topic_id', $topic_id_list, TRUE, TRUE); + sync('topic', 'topic_id', $topic_id_list, true, true); + sync('forum', 'forum_id', $this->forum_id, true, true); // Back to... whatever if ($this->quickmod) @@ -178,26 +179,33 @@ class mcp_queue extends mcp $row_num[$row['post_id']] = $i++; } - $sql = 'SELECT f.forum_id, f.forum_name, t.topic_id, t.topic_title, p.post_id, p.post_username, p.poster_id, p.post_time, u.username - FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . " u - WHERE p.post_id IN (" . implode(', ', $post_ids) . ") - AND t.topic_id = p.topic_id - AND f.forum_id = p.forum_id - AND u.user_id = p.poster_id"; - - $result = $db->sql_query($sql); - $post_data = $rowset = array(); - while ($row = $db->sql_fetchrow($result)) + if (sizeof($post_ids)) { - $post_data[$row['post_id']] = $row; - } - $db->sql_freeresult($result); + $sql = 'SELECT f.forum_id, f.forum_name, t.topic_id, t.topic_title, p.post_id, p.post_username, p.poster_id, p.post_time, u.username + FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . " u + WHERE p.post_id IN (" . implode(', ', $post_ids) . ") + AND t.topic_id = p.topic_id + AND f.forum_id = p.forum_id + AND u.user_id = p.poster_id"; - foreach ($post_ids as $post_id) - { - $rowset[] = $post_data[$post_id]; + $result = $db->sql_query($sql); + $post_data = $rowset = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_data[$row['post_id']] = $row; + } + $db->sql_freeresult($result); + + foreach ($post_ids as $post_id) + { + $rowset[] = $post_data[$post_id]; + } + unset($post_data, $post_ids); + } + else + { + $rowset = array(); } - unset($post_data, $post_ids); } else {