aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php3
-rwxr-xr-xphpBB/includes/mcp/mcp_reports.php15
2 files changed, 13 insertions, 5 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 0e8976c5d0..2fc97d423a 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -274,7 +274,8 @@ class mcp_queue
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u
WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . '
AND t.topic_id = p.topic_id
- AND u.user_id = p.poster_id';
+ AND u.user_id = p.poster_id
+ ORDER BY ' . $sort_order_sql;
$result = $db->sql_query($sql);
$post_data = $rowset = array();
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 5a50190848..06d5ffd03d 100755
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -66,10 +66,11 @@ class mcp_reports
$sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour
FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u
- WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id AND r.report_closed = 0") . '
+ WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . '
AND rr.reason_id = r.reason_id
- AND r.user_id = u.user_id';
- $result = $db->sql_query($sql);
+ AND r.user_id = u.user_id
+ ORDER BY report_closed ASC';
+ $result = $db->sql_query_limit($sql, 1);
$report = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -78,6 +79,11 @@ class mcp_reports
trigger_error('NO_REPORT');
}
+ if (!$report_id && $report['report_closed'])
+ {
+ trigger_error('REPORT_CLOSED');
+ }
+
$post_id = $report['post_id'];
$report_id = $report['report_id'];
@@ -303,7 +309,8 @@ class mcp_reports
AND t.topic_id = p.topic_id
AND r.post_id = p.post_id
AND u.user_id = p.poster_id
- AND ru.user_id = r.user_id';
+ AND ru.user_id = r.user_id
+ ORDER BY ' . $sort_order_sql;
$result = $db->sql_query($sql);
$report_data = $rowset = array();