From 2372c30785a15381786ae2c7f4851f15f5ea85e8 Mon Sep 17 00:00:00 2001
From: Nils Adermann <naderman@naderman.de>
Date: Tue, 28 Mar 2006 18:07:38 +0000
Subject: - did I mention I don't like mcp_sorting()? ;-)

git-svn-id: file:///svn/phpbb/trunk@5750 89ea8834-ac86-4346-8a33-228a782c2dd0
---
 phpBB/mcp.php | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'phpBB/mcp.php')

diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index 0ef50378c9..45b04c4d9a 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -394,6 +394,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
 			break;
 
 		case 'reports':
+		case 'reports_closed':
 			$type = 'reports';
 			$default_key = 't';
 			$default_dir = 'd';
@@ -409,8 +410,18 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
 			}
 			else
 			{
-				$where_sql .= ' p.forum_id IN (' . implode(', ', get_forum_list('m_')) . ')';
+				$where_sql .= ' p.forum_id IN (' . implode(', ', get_forum_list('m_report')) . ')';
 			}
+
+			if ($mode == 'reports')
+			{
+				$where_sql .= 'AND r.report_closed = 0';
+			}
+			else
+			{
+				$where_sql .= 'AND r.report_closed = 1';
+			}
+
 			$sql = 'SELECT COUNT(r.report_id) AS total
 				FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . " p
 				$where_sql
-- 
cgit v1.2.1