/* * This is the frontend of reporting a torrent, it's what users see when * they visit reportsv2.php?id=xxx */ include(SERVER_ROOT.'/sections/torrents/functions.php'); //If we're not coming from torrents.php, check we're being returned because of an error. if (!isset($_GET['id']) || !is_number($_GET['id'])) { if (!isset($Err)) { error(404); } } else { $TorrentID = $_GET['id']; $DB->query(" SELECT tg.CategoryID, t.GroupID, u.Username FROM torrents_group AS tg LEFT JOIN torrents AS t ON t.GroupID = tg.ID LEFT JOIN users_main AS u ON t.UserID = u.ID WHERE t.ID = " . $_GET['id']); list($CategoryID, $GroupID, $Username) = $DB->next_record(); $Artists = Artists::get_artist($GroupID); $TorrentCache = get_group_info($GroupID, true); $GroupDetails = $TorrentCache[0]; $TorrentList = $TorrentCache[1]; // Resolve the torrentlist to the one specific torrent being reported foreach ($TorrentList as &$Torrent) { // Remove unneeded entries if ($Torrent['ID'] != $TorrentID) unset($TorrentList[$Torrent['ID']]); } // Group details list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupNameJP, $GroupYear, $GroupStudio, $GroupSeries, $GroupCatalogueNumber, $GroupCategoryID, $GroupDLSite, $GroupTime, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs, $TagPositiveVotes, $TagNegativeVotes, $Screenshots, $GroupFlags) = array_values($GroupDetails); $DisplayName = $GroupName; $AltName = $GroupName; // Goes in the alt text of the image $Title = $GroupName; // goes in