/************************************************************************ ************************************************************************/ 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/text.class.php'); $Text = NEW TEXT; list($Page, $Limit) = Format::page_limit(REPORTS_PER_PAGE); include(SERVER_ROOT . '/sections/reports/array.php'); // Header View::show_header('Reports', 'bbcode,reports'); 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('comment', 'post', 'thread')"; } } $Reports = $DB->query(" SELECT SQL_CALC_FOUND_ROWS r.ID, r.UserID, um.Username, r.ThingID, r.Type, r.ReportedTime, r.Reason, r.Status, r.ClaimerID, r.Notes, r.ResolverID 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 ?>
Report #=$ReportID?> | =$Type['title']?> was reported by =$SnitchName?> =time_diff($ReportedTime)?> Contact |
switch ($Short) { case 'user': $DB->query(" SELECT Username FROM users_main WHERE ID = $ThingID"); if (!$DB->has_results()) { echo 'No user with the reported ID found'; } else { list($Username) = $DB->next_record(); echo "" . display_str($Username) . ''; } break; case 'request': case 'request_update': $DB->query(" SELECT Title FROM requests WHERE ID = $ThingID"); if (!$DB->has_results()) { echo 'No request with the reported ID found'; } else { list($Name) = $DB->next_record(); echo "" . display_str($Name) . ''; } break; case 'collage': $DB->query(" SELECT Name FROM collages WHERE ID = $ThingID"); if (!$DB->has_results()) { echo 'No collage with the reported ID found'; } else { list($Name) = $DB->next_record(); echo "" . display_str($Name) . ''; } break; case 'thread': $DB->query(" SELECT Title FROM forums_topics WHERE ID = $ThingID"); if (!$DB->has_results()) { echo 'No forum thread with the reported ID found'; } else { list($Title) = $DB->next_record(); echo "" . display_str($Title) . ''; } break; case 'post': if (isset($LoggedUser['PostsPerPage'])) { $PerPage = $LoggedUser['PostsPerPage']; } else { $PerPage = POSTS_PER_PAGE; } $DB->query(" SELECT p.ID, p.Body, p.TopicID, ( SELECT COUNT(ID) FROM forums_posts WHERE forums_posts.TopicID = p.TopicID AND forums_posts.ID <= p.ID ) AS PostNum FROM forums_posts AS p WHERE ID = $ThingID"); if (!$DB->has_results()) { echo 'No forum post with the reported ID found'; } else { list($PostID, $Body, $TopicID, $PostNum) = $DB->next_record(); echo "FORUM POST"; } break; case 'comment': $DB->query(" SELECT 1 FROM comments AS c WHERE ID = $ThingID"); if (!$DB->has_results()) { echo 'No comment with the reported ID found'; } else { echo "COMMENT"; } break; } ?> | |
=$Text->full_format($Reason)?> | |
if ($ClaimerID == $LoggedUser['ID']) { ?>
Claimed by =Users::format_username($ClaimerID, false, false, false, false)?> Unclaim
} else if ($ClaimerID) { ?>
Claimed by =Users::format_username($ClaimerID, false, false, false, false)?>
} else { ?>
Claim
} ?>
Toggle notes
|
|
Resolved by =$ResolverInfo['Username']?> |