Gazelle/sections/better/single.php

76 lines
2.1 KiB
PHP
Raw Permalink Normal View History

<?
2014-05-15 08:00:27 +00:00
if (($Results = $Cache->get_value('better_single_groupids')) === false) {
2013-06-18 08:00:48 +00:00
$DB->query("
SELECT
t.ID AS TorrentID,
t.GroupID AS GroupID
2014-05-15 08:00:27 +00:00
FROM xbt_files_users AS x
2013-06-18 08:00:48 +00:00
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");
2014-05-15 08:00:27 +00:00
$Results = $DB->to_pair('GroupID', 'TorrentID', false);
$Cache->cache_value('better_single_groupids', $Results, 30 * 60);
}
2014-05-15 08:00:27 +00:00
$Groups = Torrents::get_groups(array_keys($Results));
2012-10-11 08:00:15 +00:00
View::show_header('Single seeder FLACs');
?>
2013-02-23 08:00:22 +00:00
<div class="linkbox">
<a href="better.php" class="brackets">Back to better.php list</a>
</div>
<div class="thin">
2012-09-01 08:00:24 +00:00
<table width="100%" class="torrent_table">
<tr class="colhead">
<td>Torrent</td>
</tr>
<?
2014-05-15 08:00:27 +00:00
foreach ($Results as $GroupID => $FlacID) {
if (!isset($Groups[$GroupID])) {
2014-05-07 08:00:45 +00:00
continue;
}
2014-05-15 08:00:27 +00:00
$Group = $Groups[$GroupID];
2013-02-25 21:16:55 +00:00
extract(Torrents::array_group($Group));
$TorrentTags = new Tags($TagList);
2012-12-06 08:00:17 +00:00
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
2013-10-26 08:00:58 +00:00
$DisplayName .= "<a href=\"torrents.php?id=$GroupID&amp;torrentid=$FlacID\" class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">$GroupName</a>";
2013-04-19 08:00:55 +00:00
if ($GroupYear > 0) {
2013-06-18 08:00:48 +00:00
$DisplayName .= " [$GroupYear]";
2013-04-19 08:00:55 +00:00
}
if ($ReleaseType > 0) {
2013-06-18 08:00:48 +00:00
$DisplayName .= " [".$ReleaseTypes[$ReleaseType]."]";
2013-04-19 08:00:55 +00:00
}
2013-02-13 08:00:35 +00:00
2012-12-06 08:00:17 +00:00
$ExtraInfo = Torrents::torrent_info($Torrents[$FlacID]);
2013-04-19 08:00:55 +00:00
if ($ExtraInfo) {
2013-06-18 08:00:48 +00:00
$DisplayName .= ' - '.$ExtraInfo;
2012-12-06 08:00:17 +00:00
}
?>
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-10-26 08:00:58 +00:00
<a href="torrents.php?action=download&amp;id=<?=$FlacID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download" class="brackets tooltip">DL</a>
2012-12-06 08:00:17 +00:00
</span>
<?=$DisplayName?>
2013-02-25 21:16:55 +00:00
<div class="tags"><?=$TorrentTags->format()?></div>
</td>
</tr>
<? } ?>
</table>
</div>
<?
2012-10-11 08:00:15 +00:00
View::show_footer();
?>