Gazelle/sections/better/single.php

74 lines
2.4 KiB
PHP
Raw Normal View History

<?
if(($GroupIDs = $Cache->get_value('better_single_groupids')) === false) {
$DB->query("SELECT t.ID AS TorrentID,
t.GroupID AS GroupID
FROM xbt_files_users AS x
JOIN torrents AS t ON t.ID=x.fid
WHERE t.Format='FLAC'
GROUP BY x.fid
HAVING COUNT(x.uid) = 1
ORDER BY t.LogScore DESC, t.Time ASC LIMIT 30");
$GroupIDs = $DB->to_array('GroupID');
$Cache->cache_value('better_single_groupids', $GroupIDs, 30*60);
}
2012-10-11 08:00:15 +00:00
$Results = Torrents::get_groups(array_keys($GroupIDs));
2012-10-11 08:00:15 +00:00
View::show_header('Single seeder FLACs');
?>
<div class="thin">
2012-09-01 08:00:24 +00:00
<table width="100%" class="torrent_table">
<tr class="colhead">
<td>Torrent</td>
</tr>
<?
$Results = $Results['matches'];
foreach ($Results as $GroupID=>$Group) {
2012-12-06 08:00:17 +00:00
list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TorrentTags, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists, $ExtendedArtists, $GroupFlags) = array_values($Group);
if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
unset($ExtendedArtists[2]);
unset($ExtendedArtists[3]);
$DisplayName = Artists::display_artists($ExtendedArtists);
} else {
$DisplayName = '';
}
2012-12-06 08:00:17 +00:00
$FlacID = $GroupIDs[$GroupID]['TorrentID'];
$DisplayName.='<a href="torrents.php?id='.$GroupID.'&amp;torrentid='.$FlacID.'" title="View Torrent">'.$GroupName.'</a>';
if($GroupYear>0) { $DisplayName.=" [".$GroupYear."]"; }
2012-02-09 08:00:20 +00:00
if($ReleaseType>0) { $DisplayName.=" [".$ReleaseTypes[$ReleaseType]."]"; }
2013-02-13 08:00:35 +00:00
2012-12-06 08:00:17 +00:00
$ExtraInfo = Torrents::torrent_info($Torrents[$FlacID]);
if($ExtraInfo) {
$DisplayName.=' - '.$ExtraInfo;
}
2012-02-05 08:00:20 +00:00
$TagList=array();
if($TorrentTags!='') {
$TorrentTags=explode(' ',$TorrentTags);
foreach ($TorrentTags as $TagKey => $TagName) {
$TagName = str_replace('_','.',$TagName);
2013-02-11 08:00:34 +00:00
$TagList[]='<a href="torrents.php?taglist='.$TagName.'">'.$TagName.'</a>';
2012-02-05 08:00:20 +00:00
}
$PrimaryTag = $TorrentTags[0];
$TagList = implode(', ', $TagList);
$TorrentTags='<br /><div class="tags">'.$TagList.'</div>';
}
?>
2013-02-13 08:00:35 +00:00
<tr class="torrent torrent_row<?=$Torrents[$FlacID]['IsSnatched'] ? ' snatched_torrent' : ''?>">
<td>
2012-12-06 08:00:17 +00:00
<span class="torrent_links_block">
2013-02-13 08:00:35 +00:00
<a href="torrents.php?action=download&amp;id=<?=$FlacID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" class="brackets">DL</a>
2012-12-06 08:00:17 +00:00
</span>
<?=$DisplayName?>
2012-02-05 08:00:20 +00:00
<?=$TorrentTags?>
</td>
</tr>
<? } ?>
</table>
</div>
<?
2012-10-11 08:00:15 +00:00
View::show_footer();
?>