query("
SELECT Username
FROM users_main
WHERE ID = '$UserID'");
list($Username) = $DB->next_record();
} else {
$UserID = $LoggedUser['ID'];
}
$Sneaky = $UserID !== $LoggedUser['ID'];
$Title = $Sneaky ? "$Username's bookmarked torrent groups" : 'Your bookmarked torrent groups';
// Loop through the result set, building up $Collage and $TorrentTable
// Then we print them.
$Collage = array();
$TorrentTable = '';
$NumGroups = 0;
$ArtistCount = array();
list($GroupIDs, $CollageDataList, $TorrentList) = Users::get_bookmarks($UserID);
foreach ($GroupIDs as $GroupID) {
if (!isset($TorrentList[$GroupID])) {
continue;
}
$Group = $TorrentList[$GroupID];
extract(Torrents::array_group($Group));
list(, $Sort, $AddedTime) = array_values($CollageDataList[$GroupID]);
// Handle stats and stuff
$NumGroups++;
if ($Artists) {
foreach ($Artists as $Artist) {
if (!isset($ArtistCount[$Artist['id']])) {
$ArtistCount[$Artist['id']] = array('name' => $Artist['name'], 'count' => 1);
} else {
$ArtistCount[$Artist['id']]['count']++;
}
}
}
$TorrentTags = new Tags($TagList);
/*if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
unset($ExtendedArtists[2]);
unset($ExtendedArtists[3]);
$DisplayName = Artists::display_artists($ExtendedArtists);
} elseif (count($Artists) > 0) {
$DisplayName = Artists::display_artists(array('1' => $Artists));
} else {
$DisplayName = '';
}*/
$DisplayName = Artists::display_artists($Artists);
$GroupName = empty($GroupName) ? (empty($GroupNameRJ) ? $GroupNameJP : $GroupNameRJ) : $GroupName;
$DisplayName .= ''.$GroupName.'';
if ($GroupYear > 0) {
$DisplayName = "$DisplayName [$GroupYear]";
}
/*
if ($GroupVanityHouse) {
$DisplayName .= ' [VH]';
}
*/
$SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
// Start an output buffer, so we can store this output in $TorrentTable
ob_start();
if (count($Torrents) > 1) {
// Grouped torrents
$ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] === 1);
?>
[ DL
if (Torrents::can_use_token($Torrent)) { ?>
| FL
} ?>
| RP ]
» =Torrents::torrent_info($Torrent)?>
|
=Format::get_size($Torrent['Size'])?> |
=number_format($Torrent['Snatched'])?> |
=number_format($Torrent['Seeders'])?> |
=number_format($Torrent['Leechers'])?> |
}
} else {
// Viewing a type that does not require grouping
list($TorrentID, $Torrent) = each($Torrents);
$DisplayName = Artists::display_artists(Artists::get_artist($GroupID));
$DisplayName .= '
|
|
[ DL
if (Torrents::can_use_token($Torrent)) { ?>
| FL
} ?>
| RP ]
=time_diff($AddedTime);?>
if (!$Sneaky) { ?>
Remove bookmark
} ?>
=$DisplayName?>
=$TorrentTags->format()?>
|
=Format::get_size($Torrent['Size'])?> |
=number_format($Torrent['Snatched'])?> |
=number_format($Torrent['Seeders'])?> |
=number_format($Torrent['Leechers'])?> |
}
$TorrentTable .= ob_get_clean();
// Album art
ob_start();
$DisplayName = '';
/*if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5])|| !empty($ExtendedArtists[6])) {
unset($ExtendedArtists[2]);
unset($ExtendedArtists[3]);
$DisplayName .= Artists::display_artists($ExtendedArtists, false);
} elseif (count($Artists) > 0) {
$DisplayName .= Artists::display_artists(array('1' => $Artists), false);
}*/
$DisplayName .= Artists::display_artists($Artists, false);
$DisplayName .= $GroupName;
if ($GroupYear > 0) {
$DisplayName = "$DisplayName [$GroupYear]";
}
$Tags = display_str($TorrentTags->format());
$PlainTags = implode(', ', $TorrentTags->get_tags());
?>
/* ?>
if ($CollageCovers !== 0) { ?>
Cover art
$Page1 = array_slice($Collage, 0, $CollageCovers);
foreach ($Page1 as $Group) {
echo $Group;
}
?>
if ($NumGroups > $CollageCovers) { ?>
}
}
?>
|
|
Torrents |
Size |
 |
|
|
=$TorrentTable?>
View::show_footer();