aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_queue.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/mcp/mcp_queue.php')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php65
1 files changed, 22 insertions, 43 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 4f90c4f024..bd132c9ce8 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -216,6 +216,7 @@ class mcp_queue
'POST_IP' => $post_info['poster_ip'],
'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
'POST_ID' => $post_info['post_id'],
+ 'S_FIRST_POST' => ($post_info['topic_first_post_id'] == $post_id),
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id . '&lookup=' . $post_info['poster_ip']) . '#ip' : '',
));
@@ -268,13 +269,11 @@ class mcp_queue
trigger_error('NOT_MODERATOR');
}
- $global_id = $forum_list[0];
-
$forum_list = implode(', ', $forum_list);
$sql = 'SELECT SUM(forum_topics) as sum_forum_topics
- FROM ' . FORUMS_TABLE . "
- WHERE forum_id IN (0, $forum_list)";
+ FROM ' . FORUMS_TABLE . '
+ WHERE ' . $db->sql_in_set('forum_id', $forum_list);
$result = $db->sql_query($sql);
$forum_info['forum_topics'] = (int) $db->sql_fetchfield('sum_forum_topics');
$db->sql_freeresult($result);
@@ -290,7 +289,6 @@ class mcp_queue
$forum_info = $forum_info[$forum_id];
$forum_list = $forum_id;
- $global_id = $forum_id;
}
$forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
@@ -312,10 +310,10 @@ class mcp_queue
if ($mode == 'unapproved_posts')
{
$sql = 'SELECT p.post_id
- FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . "
- WHERE p.forum_id IN (0, $forum_list)
+ FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . '
+ WHERE ' . $db->sql_in_set('p.forum_id', $forum_list) . '
AND p.post_approved = 0
- " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
+ ' . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "
AND t.topic_id = p.topic_id
AND t.topic_first_post_id <> p.post_id
@@ -345,10 +343,7 @@ class mcp_queue
$post_data = $rowset = array();
while ($row = $db->sql_fetchrow($result))
{
- if ($row['forum_id'])
- {
- $forum_names[] = $row['forum_id'];
- }
+ $forum_names[] = $row['forum_id'];
$post_data[$row['post_id']] = $row;
}
$db->sql_freeresult($result);
@@ -368,7 +363,7 @@ class mcp_queue
{
$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_attachment AS post_attachment, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour
FROM ' . TOPICS_TABLE . " t
- WHERE forum_id IN (0, $forum_list)
+ WHERE " . $db->sql_in_set('forum_id', $forum_list) . "
AND topic_approved = 0
$limit_time_sql
ORDER BY $sort_order_sql";
@@ -377,10 +372,7 @@ class mcp_queue
$rowset = array();
while ($row = $db->sql_fetchrow($result))
{
- if ($row['forum_id'])
- {
- $forum_names[] = $row['forum_id'];
- }
+ $forum_names[] = $row['forum_id'];
$rowset[] = $row;
}
$db->sql_freeresult($result);
@@ -404,12 +396,6 @@ class mcp_queue
foreach ($rowset as $row)
{
- $global_topic = ($row['forum_id']) ? false : true;
- if ($global_topic)
- {
- $row['forum_id'] = $global_id;
- }
-
if (empty($row['post_username']))
{
$row['post_username'] = $user->lang['GUEST'];
@@ -417,7 +403,7 @@ class mcp_queue
$template->assign_block_vars('postrow', array(
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
- 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
+ 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']),
'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;start=$start&amp;mode=approve_details&amp;f={$row['forum_id']}&amp;p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&amp;t={$row['topic_id']}" : '')),
@@ -427,7 +413,7 @@ class mcp_queue
'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_ID' => $row['post_id'],
- 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
+ 'FORUM_NAME' => $forum_names[$row['forum_id']],
'POST_SUBJECT' => ($row['post_subject'] != '') ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
'TOPIC_TITLE' => $row['topic_title'],
'POST_TIME' => $user->format_date($row['post_time']),
@@ -505,11 +491,7 @@ function approve_post($post_id_list, $id, $mode)
}
$topic_id_list[$post_data['topic_id']] = 1;
-
- if ($post_data['forum_id'])
- {
- $forum_id_list[$post_data['forum_id']] = 1;
- }
+ $forum_id_list[$post_data['forum_id']] = 1;
// User post update (we do not care about topic or post, since user posts are strictly connected to posts)
// But we care about forums where post counts get not increased. ;)
@@ -521,10 +503,7 @@ function approve_post($post_id_list, $id, $mode)
// Topic or Post. ;)
if ($post_data['topic_first_post_id'] == $post_id)
{
- if ($post_data['forum_id'])
- {
- $total_topics++;
- }
+ $total_topics++;
$topic_approve_sql[] = $post_data['topic_id'];
$approve_log[] = array(
@@ -544,16 +523,13 @@ function approve_post($post_id_list, $id, $mode)
);
}
- if ($post_data['forum_id'])
- {
- $total_posts++;
+ $total_posts++;
- // Increment by topic_replies if we approve a topic...
- // This works because we do not adjust the topic_replies when re-approving a topic after an edit.
- if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_replies'])
- {
- $total_posts += $post_data['topic_replies'];
- }
+ // Increment by topic_replies if we approve a topic...
+ // This works because we do not adjust the topic_replies when re-approving a topic after an edit.
+ if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_replies'])
+ {
+ $total_posts += $post_data['topic_replies'];
}
$post_approve_sql[] = $post_id;
@@ -780,7 +756,10 @@ function disapprove_post($post_id_list, $id, $mode)
if (!$row || (!$reason && strtolower($row['reason_title']) == 'other'))
{
$additional_msg = $user->lang['NO_REASON_DISAPPROVAL'];
+
$request->overwrite('confirm', null, phpbb_request_interface::POST);
+ $request->overwrite('confirm_key', null, phpbb_request_interface::POST);
+ $request->overwrite('confirm_key', null, phpbb_request_interface::REQUEST);
}
else
{