query("SELECT Name, UserID, CategoryID FROM collages WHERE ID='$CollageID'");
list($Name, $UserID, $CategoryID) = $DB->next_record();
if ($CategoryID == 0 && $UserID != $LoggedUser['ID'] && !check_perms('site_collages_delete')) {
error(403);
}
$DB->query("
SELECT
ct.GroupID,
um.ID,
um.Username,
ct.Sort,
tg.CatalogueNumber
FROM collages_torrents AS ct
JOIN torrents_group AS tg ON tg.ID=ct.GroupID
LEFT JOIN users_main AS um ON um.ID=ct.UserID
WHERE ct.CollageID='$CollageID'
ORDER BY ct.Sort");
$GroupIDs = $DB->collect('GroupID');
$CollageDataList = $DB->to_array('GroupID', MYSQLI_ASSOC);
if (count($GroupIDs) > 0) {
$TorrentList = Torrents::get_groups($GroupIDs);
$TorrentList = $TorrentList['matches'];
} else {
$TorrentList = array();
}
View::show_header('Manage collage '.$Name);
?>
View::show_footer(); ?>