get_value('collage_'.$CollageID); if($Data) { $Data = unserialize($Data); list($K, list($Name, $Description, $CollageDataList, $TorrentList, $CommentList, $Deleted, $CollageCategoryID, $CreatorID)) = each($Data); } else { $DB->query("SELECT Name, Description, UserID, Deleted, CategoryID, Locked, MaxGroups, MaxGroupsPerUser FROM collages WHERE ID='$CollageID'"); if($DB->record_count() > 0) { list($Name, $Description, $CreatorID, $Deleted, $CollageCategoryID, $Locked, $MaxGroups, $MaxGroupsPerUser) = $DB->next_record(); $TorrentList=''; $CollageList=''; } else { $Deleted = '1'; } } if($Deleted == '1') { header('Location: log.php?search=Collage+'.$CollageID); die(); } if($CollageCategoryID == 0 && !check_perms('site_collages_delete')) { if(!check_perms('site_collages_personal') || $CreatorID!=$LoggedUser['ID']) { $Locked = true; } } show_header($Name,'browse,collage,bbcode'); // Build the data for the collage and the torrent list if(!is_array($TorrentList)) { $DB->query("SELECT ct.GroupID, tg.WikiImage, tg.CategoryID, um.ID, um.Username 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 = get_groups($GroupIDs); $TorrentList = $TorrentList['matches']; } else { $TorrentList = array(); } } // Loop through the result set, building up $Collage and $TorrentTable // Then we print them. $Collage = array(); $TorrentTable = ''; $NumGroups = 0; $NumGroupsByUser = 0; $Artists = array(); $Tags = array(); $Users = array(); $Number = 0; foreach ($TorrentList as $GroupID=>$Group) { list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $Torrents, $GroupArtists) = array_values($Group); list($GroupID2, $Image, $GroupCategoryID, $UserID, $Username) = array_values($CollageDataList[$GroupID]); // Handle stats and stuff $Number++; $NumGroups++; if($UserID == $LoggedUser['ID']) { $NumGroupsByUser++; } if($GroupArtists) { foreach($GroupArtists as $Artist) { if(!isset($Artists[$Artist['id']])) { $Artists[$Artist['id']] = array('name'=>$Artist['name'], 'count'=>1); } else { $Artists[$Artist['id']]['count']++; } } } if($Username) { if(!isset($Users[$UserID])) { $Users[$UserID] = array('name'=>$Username, 'count'=>1); } else { $Users[$UserID]['count']++; } } $TagList = explode(' ',str_replace('_','.',$TagList)); $TorrentTags = array(); foreach($TagList as $Tag) { if(!isset($Tags[$Tag])) { $Tags[$Tag] = array('name'=>$Tag, 'count'=>1); } else { $Tags[$Tag]['count']++; } $TorrentTags[]=''.$Tag.''; } $PrimaryTag = $TagList[0]; $TorrentTags = implode(', ', $TorrentTags); $TorrentTags='
'.$TorrentTags.'
'; $DisplayName = $Number.' - '; if(count($GroupArtists)>0) { $DisplayName .= display_artists(array('1'=>$GroupArtists)); } $DisplayName .= ''.$GroupName.''; if($GroupYear>0) { $DisplayName = $DisplayName. ' ['. $GroupYear .']';} // Start an output buffer, so we can store this output in $TorrentTable ob_start(); if(count($Torrents)>1 || $GroupCategoryID==1) { // Grouped torrents $ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1); ?>
$Torrent) { if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear || $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber) { if($Torrent['RemasterTitle'] || $Torrent['RemasterYear'] || $Torrent['RemasterRecordLabel'] || $Torrent['RemasterCatalogueNumber']) { $RemasterName = $Torrent['RemasterYear']; $AddExtra = " - "; if($Torrent['RemasterRecordLabel']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterRecordLabel']); $AddExtra=' / '; } if($Torrent['RemasterCatalogueNumber']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterCatalogueNumber']); $AddExtra=' / '; } if($Torrent['RemasterTitle']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterTitle']); $AddExtra=' / '; } ?> [DL]   »  > '.$GroupName.''; if(!empty($Torrent['FreeTorrent'])) { $DisplayName .=' Freeleech!'; } ?>
[DL | RP] > $GroupArtists), false); } $DisplayName .= $GroupName; if($GroupYear>0) { $DisplayName = $DisplayName. ' ['. $GroupYear .']';} ?> <?=$DisplayName?>
0 && $NumGroups>=$MaxGroups) || ($MaxGroupsPerUser>0 && $NumGroupsByUser>=$MaxGroupsPerUser)) { $Locked = true; } ?>

Torrents Size Snatches Seeders Leechers
cache_value('collage_'.$CollageID, serialize(array(array($Name, $Description, $CollageDataList, $TorrentList, $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser))), 3600); ?>