".$lang_reports['text_reports'].""); print("\n"); print(""); print(""); $reportres = sql_query("SELECT * FROM reports ORDER BY dealtwith ASC, id DESC $limit"); while ($row = mysql_fetch_array($reportres)) { if ($row['dealtwith']) $dealtwith = "".$lang_reports['text_yes']." - " . get_username($row['dealtby']); else $dealtwith = "".$lang_reports['text_no'].""; switch ($row['type']) { case "torrent": { $type = $lang_reports['text_torrent']; $res = sql_query("SELECT id, name FROM torrents WHERE id=".sqlesc($row['reportid'])); if (mysql_num_rows($res) == 0) $reporting = $lang_reports['text_torrent_does_not_exist']; else { $arr = mysql_fetch_array($res); $reporting = "".htmlspecialchars($arr['name']).""; } break; } case "user": { $type = $lang_reports['text_user']; $res = sql_query("SELECT id FROM users WHERE id=".sqlesc($row['reportid'])); if (mysql_num_rows($res) == 0) $reporting = $lang_reports['text_user_does_not_exist']; else { $arr = mysql_fetch_array($res); $reporting = get_username($arr['id']); } break; } case "offer": { $type = $lang_reports['text_offer']; $res = sql_query("SELECT id, name FROM offers WHERE id=".sqlesc($row['reportid'])); if (mysql_num_rows($res) == 0) $reporting = $lang_reports['text_offer_does_not_exist']; else { $arr = mysql_fetch_array($res); $reporting = "".htmlspecialchars($arr['name']).""; } break; } /* case "request": { $type = "Request"; $res = sql_query("SELECT id, request FROM requests WHERE id=".sqlesc($row['reportid'])); if (mysql_num_rows($res) == 0) $reporting = "Request doesn't exist or is deleted."; else { $arr = mysql_fetch_array($res); $reporting = "".htmlspecialchars($arr['request']).""; } break; } */ case "post": { $type = $lang_reports['text_forum_post']; $res = sql_query("SELECT topics.id AS topicid, topics.subject AS subject, posts.userid AS postuserid FROM topics LEFT JOIN posts ON posts.topicid = topics.id WHERE posts.id=".sqlesc($row['reportid'])); if (mysql_num_rows($res) == 0) $reporting = $lang_reports['text_post_does_not_exist']; else { $arr = mysql_fetch_array($res); $reporting = $lang_reports['text_post_id'].$row['reportid'].$lang_reports['text_of_topic']."".htmlspecialchars($arr['subject'])."".$lang_reports['text_by'].get_username($arr['postuserid']); } break; } case "comment": { $type = $lang_reports['text_comment']; $res = sql_query("SELECT id, user, torrent, offer FROM comments WHERE id=".sqlesc($row['reportid'])); if (mysql_num_rows($res) == 0) $reporting = $lang_reports['text_comment_does_not_exist']; else { $arr = mysql_fetch_array($res); if ($arr['torrent']) { $name = get_single_value("torrents","name","WHERE id=".sqlesc($arr['torrent'])); $url = "details.php?id=".$arr['torrent']."#cid".$row['reportid']; $of = $lang_reports['text_of_torrent']; } elseif ($arr['offer']) { $name = get_single_value("offers","name","WHERE id=".sqlesc($arr['offer'])); $url = "offers.php?id=".$arr['offer']."&off_details=1#cid".$row['reportid']; $of = $lang_reports['text_of_offer']; } else //Comment belongs to no one $of = "unknown"; $reporting = $lang_reports['text_comment_id'].$row['reportid'].$of."".htmlspecialchars($name)."".$lang_reports['text_by'].get_username($arr['user']); } break; } case "subtitle": { $type = $lang_reports['text_subtitle']; $res = sql_query("SELECT id, torrent_id, title FROM subs WHERE id=".sqlesc($row['reportid'])); if (mysql_num_rows($res) == 0) $reporting = $lang_reports['text_subtitle_does_not_exist']; else { $arr = mysql_fetch_array($res); $reporting = "".htmlspecialchars($arr['title'])."".$lang_reports['text_for_torrent_id']."".$arr['torrent_id'].""; } break; } default: { break; } } print("\n"); } ?> "); print($pagerbottom); end_main_frame(); stdfoot();
".$lang_reports['col_added']."".$lang_reports['col_reporter']."".$lang_reports['col_reporting']."".$lang_reports['col_type']."".$lang_reports['col_reason']."".$lang_reports['col_dealt_with']."".$lang_reports['col_action']."
".gettime($row['added'])."" . get_username($row['addedby']) . "".$reporting."".$type."".htmlspecialchars($row['reason'])."".$dealtwith."