/************************************************************************ ************************************************************************/ if(!check_perms('admin_reports') && !check_perms('project_team') && !check_perms('site_moderate_forums')) { error(404); } // Number of reports per page define('REPORTS_PER_PAGE', '10'); include(SERVER_ROOT.'/classes/class_text.php'); $Text = NEW TEXT; list($Page,$Limit) = page_limit(REPORTS_PER_PAGE); include(SERVER_ROOT.'/sections/reports/array.php'); // Header show_header('Reports','bbcode'); if($_GET['id'] && is_number($_GET['id'])) { $View = "Single report"; $Where = "r.ID = ".$_GET['id']; } else if(empty($_GET['view'])) { $View = "New"; $Where = "Status='New'"; } else { $View = $_GET['view']; switch($_GET['view']) { case 'old' : $Where = "Status='Resolved'"; break; default : error(404); break; } } if(!check_perms('admin_reports')) { if(check_perms('project_team')) { $Where .= " AND Type = 'request_update'"; } if(check_perms('site_moderate_forums')) { $Where .= " AND Type IN('collages_comment', 'Post', 'requests_comment', 'thread', 'torrents_comment')"; } } $Reports = $DB->query("SELECT SQL_CALC_FOUND_ROWS r.ID, r.UserID, um.Username, r.ThingID, r.Type, r.ReportedTime, r.Reason, r.Status FROM reports AS r JOIN users_main AS um ON r.UserID=um.ID WHERE ".$Where." ORDER BY ReportedTime DESC LIMIT ".$Limit); // Number of results (for pagination) $DB->query('SELECT FOUND_ROWS()'); list($Results) = $DB->next_record(); // Done with the number of results. Move $DB back to the result set for the reports $DB->set_query_id($Reports); // Start printing stuff ?>