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 ?>

Active Reports

next_record()) { $Type = $Types[$Short]; $Reference = "reports.php?id=".$ReportID."#report".$ReportID; ?>
Report was reported by
query("SELECT Username FROM users_main WHERE ID=".$ThingID); if($DB->record_count() < 1) { 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->record_count() < 1) { 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->record_count() < 1) { 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->record_count() < 1) { echo "No 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->record_count() < 1) { echo "No post with the reported ID found"; } else { list($PostID,$Body,$TopicID,$PostNum) = $DB->next_record(); echo "POST"; } break; case "requests_comment" : $DB->query("SELECT rc.RequestID, rc.Body, (SELECT COUNT(ID) FROM requests_comments WHERE ID <= ".$ThingID." AND requests_comments.RequestID = rc.RequestID) AS CommentNum FROM requests_comments AS rc WHERE ID=".$ThingID); if($DB->record_count() < 1) { echo "No comment with the reported ID found"; } else { list($RequestID, $Body, $PostNum) = $DB->next_record(); $PageNum = ceil($PostNum / TORRENT_COMMENTS_PER_PAGE); echo "COMMENT"; } break; case "torrents_comment" : $DB->query("SELECT tc.GroupID, tc.Body, (SELECT COUNT(ID) FROM torrents_comments WHERE ID <= ".$ThingID." AND torrents_comments.GroupID = tc.GroupID) AS CommentNum FROM torrents_comments AS tc WHERE ID=".$ThingID); if($DB->record_count() < 1) { echo "No comment with the reported ID found"; } else { list($GroupID, $Body, $PostNum) = $DB->next_record(); $PageNum = ceil($PostNum / TORRENT_COMMENTS_PER_PAGE); echo "COMMENT"; } break; case "collages_comment" : $DB->query("SELECT cc.CollageID, cc.Body, (SELECT COUNT(ID) FROM collages_comments WHERE ID <= ".$ThingID." AND collages_comments.CollageID = cc.CollageID) AS CommentNum FROM collages_comments AS cc WHERE ID=".$ThingID); if($DB->record_count() < 1) { echo "No comment with the reported ID found"; } else { list($CollageID, $Body, $PostNum) = $DB->next_record(); $PerPage = POSTS_PER_PAGE; $PageNum = ceil($PostNum / $PerPage); echo "COMMENT"; } break; } ?>
full_format($Reason)?>

set_query_id($Reports); } ?>