Gazelle/sections/top10/votes.php

399 lines
17 KiB
PHP
Raw Normal View History

2012-10-27 08:00:09 +00:00
<?
// We need these to do our rankification
include(SERVER_ROOT.'/sections/torrents/ranking_funcs.php');
2013-03-29 08:00:08 +00:00
2012-10-27 08:00:09 +00:00
2012-11-02 08:00:18 +00:00
$UserVotes = Votes::get_user_votes($LoggedUser['ID']);
2013-04-17 08:00:58 +00:00
if (!empty($_GET['advanced']) && check_perms('site_advanced_top10')) {
2012-10-27 08:00:09 +00:00
$Details = 'all';
2012-10-29 08:00:20 +00:00
$Limit = 25;
2012-10-28 08:00:19 +00:00
2013-11-01 08:01:02 +00:00
if (!empty($_GET['tags'])) {
$TagsAny = isset($_GET['anyall']) && $_GET['anyall'] === 'any';
2013-07-17 08:00:52 +00:00
$Tags = explode(',', str_replace('.', '_', trim($_GET['tags'])));
2012-10-27 08:00:09 +00:00
foreach ($Tags as $Tag) {
$Tag = preg_replace('/[^a-z0-9_]/', '', $Tag);
2013-04-17 08:00:58 +00:00
if ($Tag != '') {
2013-11-01 08:01:02 +00:00
$TagWhere[] = "g.TagList REGEXP '[[:<:]]".db_string($Tag)."[[:>:]]'";
2012-10-27 08:00:09 +00:00
}
}
2013-11-01 08:01:02 +00:00
$Operator = $TagsAny ? ' OR ' : ' AND ';
$Where[] = '('.implode($Operator, $TagWhere).')';
2012-10-27 08:00:09 +00:00
}
$Year1 = (int)$_GET['year1'];
$Year2 = (int)$_GET['year2'];
if ($Year1 > 0 && $Year2 <= 0) {
$Where[] = "g.Year = $Year1";
} elseif ($Year1 > 0 && $Year2 > 0) {
$Where[] = "g.Year BETWEEN $Year1 AND $Year2";
} elseif ($Year2 > 0 && $Year1 <= 0) {
$Where[] = "g.Year <= $Year2";
2012-10-28 08:00:19 +00:00
}
2012-10-27 08:00:09 +00:00
} else {
$Details = 'all';
// defaults to 10 (duh)
2012-10-29 08:00:20 +00:00
$Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 25;
$Limit = in_array($Limit, array(25, 100, 250)) ? $Limit : 25;
2012-10-27 08:00:09 +00:00
}
$Filtered = !empty($Where);
2013-11-01 08:01:02 +00:00
if (!empty($Where)) {
2012-10-28 08:00:19 +00:00
$Where = implode(' AND ', $Where);
}
2012-10-27 08:00:09 +00:00
$WhereSum = (empty($Where)) ? '' : md5($Where);
// Unlike the other top 10s, this query just gets some raw stats
// We'll need to do some fancy-pants stuff to translate it into
// BPCI scores before getting the torrent data
2013-07-17 08:00:52 +00:00
$Query = '
SELECT v.GroupID, v.Ups, v.Total, v.Score
FROM torrents_votes AS v';
2012-10-27 08:00:09 +00:00
if (!empty($Where)) {
2013-07-17 08:00:52 +00:00
$Query .= "
JOIN torrents_group AS g ON g.ID = v.GroupID
WHERE $Where AND ";
2012-10-27 08:00:09 +00:00
} else {
2013-07-17 08:00:52 +00:00
$Query .= '
WHERE ';
2012-10-27 08:00:09 +00:00
}
2013-07-17 08:00:52 +00:00
$Query .= "
Score > 0
ORDER BY Score DESC
LIMIT $Limit";
2012-10-27 08:00:09 +00:00
$TopVotes = $Cache->get_value('top10votes_'.$Limit.$WhereSum);
if ($TopVotes === false) {
2012-10-28 08:00:19 +00:00
if ($Cache->get_query_lock('top10votes')) {
2012-10-27 08:00:09 +00:00
$DB->query($Query);
2013-11-01 08:01:02 +00:00
$Results = $DB->to_array('GroupID', MYSQLI_ASSOC, false);
$Ranks = Votes::calc_ranks($DB->to_pair('GroupID', 'Score', false));
2013-02-12 08:00:08 +00:00
2013-11-01 08:01:02 +00:00
$Groups = Torrents::get_groups(array_keys($Results));
2013-02-25 21:16:55 +00:00
2012-10-27 08:00:09 +00:00
$TopVotes = array();
2013-11-01 08:01:02 +00:00
foreach ($Results as $GroupID => $Votes) {
2013-09-13 08:00:53 +00:00
$TopVotes[$GroupID] = $Groups[$GroupID];
2013-11-01 08:01:02 +00:00
$TopVotes[$GroupID]['Ups'] = $Votes['Ups'];
$TopVotes[$GroupID]['Total'] = $Votes['Total'];
$TopVotes[$GroupID]['Score'] = $Votes['Score'];
$TopVotes[$GroupID]['Rank'] = $Ranks[$GroupID];
2012-10-27 08:00:09 +00:00
}
2012-10-28 08:00:19 +00:00
2013-07-17 08:00:52 +00:00
$Cache->cache_value('top10votes_'.$Limit.$WhereSum, $TopVotes, 60 * 30);
2012-10-27 08:00:09 +00:00
$Cache->clear_query_lock('top10votes');
} else {
$TopVotes = false;
}
}
2013-07-17 08:00:52 +00:00
View::show_header("Top $Limit Voted Groups",'browse,voting');
2012-10-27 08:00:09 +00:00
?>
<div class="thin">
<div class="header">
<h2>Top <?=$Limit?> Voted Groups</h2>
2013-09-09 08:00:52 +00:00
<? Top10View::render_linkbox("votes"); ?>
2012-10-27 08:00:09 +00:00
</div>
<?
2013-04-17 08:00:58 +00:00
if (check_perms('site_advanced_top10')) { ?>
2012-10-27 08:00:09 +00:00
<form class="search_form" name="votes" action="" method="get">
<input type="hidden" name="advanced" value="1" />
<input type="hidden" name="type" value="votes" />
<table cellpadding="6" cellspacing="1" border="0" class="layout border" width="100%">
2012-11-06 08:00:20 +00:00
<tr id="tagfilter">
2012-10-27 08:00:09 +00:00
<td class="label">Tags (comma-separated):</td>
2012-11-06 08:00:20 +00:00
<td class="ft_taglist">
2013-04-17 08:00:58 +00:00
<input type="text" name="tags" size="75" value="<? if (!empty($_GET['tags'])) { echo display_str($_GET['tags']);} ?>" />&nbsp;
2013-11-01 08:01:02 +00:00
<input type="radio" id="rdoAll" name="anyall" value="all"<?=(!isset($TagsAny) ? ' checked="checked"' : '')?> /><label for="rdoAll"> All</label>&nbsp;&nbsp;
<input type="radio" id="rdoAny" name="anyall" value="any"<?=(isset($TagsAny) ? ' checked="checked"' : '')?> /><label for="rdoAny"> Any</label>
2012-10-28 08:00:19 +00:00
</td>
</tr>
2012-11-06 08:00:20 +00:00
<tr id="yearfilter">
2012-10-27 08:00:09 +00:00
<td class="label">Year:</td>
2012-11-06 08:00:20 +00:00
<td class="ft_year">
2013-04-17 08:00:58 +00:00
<input type="text" name="year1" size="4" value="<? if (!empty($_GET['year1'])) { echo display_str($_GET['year1']);} ?>" />
2012-10-27 08:00:09 +00:00
to
2013-04-17 08:00:58 +00:00
<input type="text" name="year2" size="4" value="<? if (!empty($_GET['year2'])) { echo display_str($_GET['year2']);} ?>" />
2012-10-27 08:00:09 +00:00
</td>
</tr>
<tr>
<td colspan="2" class="center">
<input type="submit" value="Filter torrents" />
</td>
</tr>
2012-10-28 08:00:19 +00:00
</table>
2012-10-27 08:00:09 +00:00
</form>
<?
}
2013-03-29 08:00:08 +00:00
$Bookmarks = Bookmarks::all_bookmarks('torrent');
2012-10-27 08:00:09 +00:00
?>
2013-11-01 08:01:02 +00:00
<h3>Top <?=$Limit?>
2012-10-28 08:00:19 +00:00
<?
2013-04-17 08:00:58 +00:00
if (empty($_GET['advanced'])) { ?>
2013-02-12 08:00:08 +00:00
<small class="top10_quantity_links">
2012-10-28 08:00:19 +00:00
<?
2013-05-01 08:00:16 +00:00
switch ($Limit) {
2012-10-27 08:00:09 +00:00
case 100: ?>
2013-02-09 08:01:01 +00:00
- <a href="top10.php?type=votes" class="brackets">Top 25</a>
- <span class="brackets">Top 100</span>
- <a href="top10.php?type=votes&amp;limit=250" class="brackets">Top 250</a>
2013-04-17 08:00:58 +00:00
<? break;
2012-10-27 08:00:09 +00:00
case 250: ?>
2013-02-09 08:01:01 +00:00
- <a href="top10.php?type=votes" class="brackets">Top 25</a>
- <a href="top10.php?type=votes&amp;limit=100" class="brackets">Top 100</a>
- <span class="brackets">Top 250</span>
2013-04-17 08:00:58 +00:00
<? break;
2012-10-27 08:00:09 +00:00
default: ?>
2013-02-09 08:01:01 +00:00
- <span class="brackets">Top 25</span>
- <a href="top10.php?type=votes&amp;limit=100" class="brackets">Top 100</a>
- <a href="top10.php?type=votes&amp;limit=250" class="brackets">Top 250</a>
2012-10-27 08:00:09 +00:00
<? } ?>
</small>
<?
2012-10-28 08:00:19 +00:00
} ?>
2012-10-27 08:00:09 +00:00
</h3>
<?
2012-10-28 08:00:19 +00:00
2012-10-27 08:00:09 +00:00
$Number = 0;
2013-11-01 08:01:02 +00:00
$TorrentTable = '';
2013-02-25 21:16:55 +00:00
foreach ($TopVotes as $GroupID => $Group) {
extract(Torrents::array_group($Group));
2013-10-05 08:01:00 +00:00
$UpVotes = $Group['Ups'];
$TotalVotes = $Group['Total'];
2013-02-25 21:16:55 +00:00
$Score = $Group['Score'];
2013-10-05 08:01:00 +00:00
$DownVotes = $TotalVotes - $UpVotes;
2012-10-28 08:00:19 +00:00
2012-11-04 08:00:20 +00:00
$IsBookmarked = in_array($GroupID, $Bookmarks);
2013-11-01 08:01:02 +00:00
$UserVote = isset($UserVotes[$GroupID]) ? $UserVotes[$GroupID]['Type'] : '';
2012-10-27 08:00:09 +00:00
2013-02-25 21:16:55 +00:00
$TorrentTags = new Tags($TagList);
2013-11-01 08:01:02 +00:00
$DisplayName = "$Group[Rank] - ";
2012-10-28 08:00:19 +00:00
2012-10-27 08:00:09 +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);
2013-11-01 08:01:02 +00:00
} elseif (count($Artists) > 0) {
$DisplayName .= Artists::display_artists(array('1' => $Artists));
2012-10-27 08:00:09 +00:00
}
2012-10-28 08:00:19 +00:00
2013-10-26 08:00:58 +00:00
$DisplayName .= '<a href="torrents.php?id='.$GroupID.'" class="tooltip" title="View torrent group" dir="ltr">'.$GroupName.'</a>';
2013-04-17 08:00:58 +00:00
if ($GroupYear > 0) {
$DisplayName = $DisplayName. " [$GroupYear]";
}
if ($GroupVanityHouse) {
2013-10-26 08:00:58 +00:00
$DisplayName .= ' [<abbr class="tooltip" title="This is a Vanity House release">VH</abbr>]';
2013-04-17 08:00:58 +00:00
}
2012-10-27 08:00:09 +00:00
// Start an output buffer, so we can store this output in $TorrentTable
ob_start();
2013-08-28 23:08:41 +00:00
if (count($Torrents) > 1 || $GroupCategoryID == 1) {
2012-12-06 08:00:17 +00:00
// Grouped torrents
$GroupSnatched = false;
foreach ($Torrents as &$Torrent) {
if (($Torrent['IsSnatched'] = Torrents::has_snatched($Torrent['ID'])) && !$GroupSnatched) {
$GroupSnatched = true;
}
}
2013-02-18 08:00:22 +00:00
unset($Torrent);
2012-12-06 08:00:17 +00:00
$SnatchedGroupClass = $GroupSnatched ? ' snatched_group' : '';
2012-10-27 08:00:09 +00:00
?>
2012-12-06 08:00:17 +00:00
<tr class="group discog<?=$SnatchedGroupClass?>" id="group_<?=$GroupID?>">
2012-10-27 08:00:09 +00:00
<td class="center">
2013-08-28 23:08:41 +00:00
<div id="showimg_<?=$GroupID?>" class="show_torrents">
2015-11-15 08:00:28 +00:00
<a href="#" class="tooltip show_torrents_link" onclick="toggle_group(<?=$GroupID?>, this, event);" title="Expand this group. Hold [Command] <em>(Mac)</em> or [Ctrl] <em>(PC)</em> while clicking to expand all groups on this page."></a>
2012-10-27 08:00:09 +00:00
</div>
</td>
2013-10-05 08:01:00 +00:00
<td class="center cats_col">
2013-10-26 08:00:58 +00:00
<div title="<?=$TorrentTags->title()?>" class="tooltip <?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>"></div>
2012-10-27 08:00:09 +00:00
</td>
2013-02-25 21:16:55 +00:00
<td class="big_info">
2013-08-28 23:08:41 +00:00
<? if ($LoggedUser['CoverArt']) { ?>
2013-02-25 21:16:55 +00:00
<div class="group_image float_left clear">
2013-04-30 18:18:07 +00:00
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
2013-02-25 21:16:55 +00:00
</div>
2013-08-28 23:08:41 +00:00
<? } ?>
2013-02-25 21:16:55 +00:00
<div class="group_info clear">
2013-11-01 08:01:02 +00:00
<strong><?=$DisplayName?></strong> <!--<?Votes::vote_link($GroupID, $UserVote);?>-->
2013-04-17 08:00:58 +00:00
<? if ($IsBookmarked) { ?>
2014-05-29 08:00:27 +00:00
<span class="remove_bookmark float_right">
<a href="#" class="bookmarklink_torrent_<?=$GroupID?> brackets" onclick="Unbookmark('torrent', <?=$GroupID?>, 'Bookmark'); return false;">Remove bookmark</a>
</span>
2013-04-17 08:00:58 +00:00
<? } else { ?>
2014-05-29 08:00:27 +00:00
<span class="add_bookmark float_right">
<a href="#" class="bookmarklink_torrent_<?=$GroupID?> brackets" onclick="Bookmark('torrent', <?=$GroupID?>, 'Remove bookmark'); return false;">Bookmark</a>
</span>
2013-04-17 08:00:58 +00:00
<? } ?>
2013-02-25 21:16:55 +00:00
<div class="tags"><?=$TorrentTags->format()?></div>
</div>
2012-10-27 08:00:09 +00:00
</td>
2013-10-05 08:01:00 +00:00
<td colspan="4" class="votes_info_td">
<span style="white-space: nowrap;">
<span class="favoritecount_small tooltip" title="<?=$UpVotes . ($UpVotes == 1 ? ' upvote' : ' upvotes')?>"><span id="upvotes"><?=number_format($UpVotes)?></span> <span class="vote_album_up">&and;</span></span>
&nbsp; &nbsp;
<span class="favoritecount_small tooltip" title="<?=$DownVotes . ($DownVotes == 1 ? ' downvote' : ' downvotes')?>"><span id="downvotes"><?=number_format($DownVotes)?></span> <span class="vote_album_down">&or;</span></span>
&nbsp;
2013-10-06 08:01:04 +00:00
<span style="float: right;"><span class="favoritecount_small" id="totalvotes"><?=number_format($TotalVotes)?></span> Total</span>
2013-10-05 08:01:00 +00:00
</span>
<br />
2013-10-06 08:01:04 +00:00
<span style="white-space: nowrap;">
<span class="tooltip_interactive" title="&lt;span style=&quot;font-weight: bold;&quot;&gt;Score: <?=number_format($Score * 100, 4)?>&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is the lower bound of the binomial confidence interval &lt;a href=&quot;wiki.php?action=article&amp;id=1037&quot;&gt;described here&lt;/a&gt;, multiplied by 100." data-title-plain="Score: <?=number_format($Score * 100, 4)?>. This is the lower bound of the binomial confidence interval described in the Favorite Album Votes wiki article, multiplied by 100.">Score: <span class="favoritecount_small"><?=number_format($Score * 100, 1)?></span></span>
&nbsp; | &nbsp;
<span class="favoritecount_small"><?=number_format($UpVotes / $TotalVotes * 100, 1)?>%</span> positive
</span>
2013-10-05 08:01:00 +00:00
</td>
2012-10-27 08:00:09 +00:00
</tr>
<?
$LastRemasterYear = '-';
$LastRemasterTitle = '';
$LastRemasterRecordLabel = '';
$LastRemasterCatalogueNumber = '';
$LastMedia = '';
2012-10-28 08:00:19 +00:00
2012-10-27 08:00:09 +00:00
$EditionID = 0;
unset($FirstUnknown);
2012-10-28 08:00:19 +00:00
2013-08-28 23:08:41 +00:00
foreach ($Torrents as $TorrentID => $Torrent) {
2013-04-17 08:00:58 +00:00
//Get report info, use the cache if available, if not, add to it.
$Reported = false;
2013-08-12 08:00:44 +00:00
$Reports = Torrents::get_reports($TorrentID);
2013-04-17 08:00:58 +00:00
if (count($Reports) > 0) {
$Reported = true;
}
2012-10-27 08:00:09 +00:00
if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
$FirstUnknown = !isset($FirstUnknown);
}
2012-12-06 08:00:17 +00:00
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
2012-10-28 08:00:19 +00:00
2013-08-28 23:08:41 +00:00
if ($Torrent['RemasterTitle'] != $LastRemasterTitle
|| $Torrent['RemasterYear'] != $LastRemasterYear
|| $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel
|| $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber
|| $FirstUnknown
|| $Torrent['Media'] != $LastMedia
) {
2012-10-27 08:00:09 +00:00
$EditionID++;
?>
2012-12-06 08:00:17 +00:00
<tr class="group_torrent groupid_<?=$GroupID?> edition<?=$SnatchedGroupClass?> hidden">
2015-11-15 08:00:28 +00:00
<td colspan="7" class="edition_info"><strong><a href="#" onclick="toggle_edition(<?=$GroupID?>, <?=$EditionID?>, this, event);" class="tooltip" title="Collapse this edition. Hold [Command] <em>(Mac)</em> or [Ctrl] <em>(PC)</em> while clicking to collapse all editions in this torrent group.">&minus;</a> <?=Torrents::edition_string($Torrent, $Group)?></strong></td>
2012-10-27 08:00:09 +00:00
</tr>
<?
}
$LastRemasterTitle = $Torrent['RemasterTitle'];
$LastRemasterYear = $Torrent['RemasterYear'];
$LastRemasterRecordLabel = $Torrent['RemasterRecordLabel'];
$LastRemasterCatalogueNumber = $Torrent['RemasterCatalogueNumber'];
$LastMedia = $Torrent['Media'];
?>
2012-12-06 08:00:17 +00:00
<tr class="group_torrent torrent_row groupid_<?=$GroupID?> edition_<?=$EditionID?><?=$SnatchedTorrentClass . $SnatchedGroupClass?> hidden">
2012-10-27 08:00:09 +00:00
<td colspan="3">
<span>
2013-10-26 08:00:58 +00:00
[ <a href="torrents.php?action=download&amp;id=<?=$TorrentID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" class="tooltip" title="Download">DL</a>
2012-10-28 08:00:19 +00:00
<? if (Torrents::can_use_token($Torrent)) { ?>
2013-10-26 08:00:58 +00:00
| <a href="torrents.php?action=download&amp;id=<?=$TorrentID ?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>&amp;usetoken=1" class="tooltip" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
2012-10-27 08:00:09 +00:00
<? } ?>
2013-10-26 08:00:58 +00:00
| <a href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>" class="tooltip" title="Report">RP</a> ]
2012-10-27 08:00:09 +00:00
</span>
2013-08-28 23:08:41 +00:00
&nbsp;&nbsp;&raquo;&nbsp; <a href="torrents.php?id=<?=$GroupID?>&amp;torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Torrent)?><? if ($Reported) { ?> / <strong class="torrent_label tl_reported">Reported</strong><? } ?></a>
2012-10-27 08:00:09 +00:00
</td>
2013-08-28 23:08:41 +00:00
<td class="number_column nobr"><?=Format::get_size($Torrent['Size'])?></td>
<td class="number_column"><?=number_format($Torrent['Snatched'])?></td>
<td class="number_column<?=($Torrent['Seeders'] == 0) ? ' r00' : '' ?>"><?=number_format($Torrent['Seeders'])?></td>
<td class="number_column"><?=number_format($Torrent['Leechers'])?></td>
2012-10-27 08:00:09 +00:00
</tr>
<?
2013-08-28 23:08:41 +00:00
}
} else { //if (count($Torrents) > 1 || $GroupCategoryID == 1)
2012-10-27 08:00:09 +00:00
// Viewing a type that does not require grouping
2012-10-28 08:00:19 +00:00
2012-10-27 08:00:09 +00:00
list($TorrentID, $Torrent) = each($Torrents);
2012-11-04 08:00:20 +00:00
$Torrent['IsSnatched'] = Torrents::has_snatched($TorrentID);
2012-10-28 08:00:19 +00:00
2013-10-26 08:00:58 +00:00
$DisplayName = $Number .' - <a href="torrents.php?id='.$GroupID.'" class="tooltip" title="View torrent group" dir="ltr">'.$GroupName.'</a>';
2013-04-17 08:00:58 +00:00
if ($Torrent['IsSnatched']) {
2013-01-03 08:00:30 +00:00
$DisplayName .= ' ' . Format::torrent_label('Snatched!');
2012-10-28 08:00:19 +00:00
}
if ($Torrent['FreeTorrent'] == '1') {
2013-01-03 08:00:30 +00:00
$DisplayName .= ' ' . Format::torrent_label('Freeleech!');
2012-10-28 08:00:19 +00:00
} elseif ($Torrent['FreeTorrent'] == '2') {
2013-01-03 08:00:30 +00:00
$DisplayName .= ' ' . Format::torrent_label('Neutral leech!');
2012-11-05 08:00:16 +00:00
} elseif (Torrents::has_token($TorrentID)) {
2013-04-17 08:00:58 +00:00
$DisplayName .= ' ' . Format::torrent_label('Personal freeleech!');
2012-10-27 08:00:09 +00:00
}
2012-12-06 08:00:17 +00:00
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
2012-10-27 08:00:09 +00:00
?>
2012-12-06 08:00:17 +00:00
<tr class="torrent torrent_row<?=$SnatchedTorrentClass . $SnatchedGroupClass?>" id="group_<?=$GroupID?>">
2012-10-27 08:00:09 +00:00
<td></td>
2013-10-05 08:01:00 +00:00
<td class="center cats_col">
2013-10-26 08:00:58 +00:00
<div title="<?=$TorrentTags->title()?>" class="tooltip <?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>">
2012-10-27 08:00:09 +00:00
</div>
</td>
2013-02-25 21:16:55 +00:00
<td class="nobr big_info">
2013-08-28 23:08:41 +00:00
<? if ($LoggedUser['CoverArt']) { ?>
2013-02-25 21:16:55 +00:00
<div class="group_image float_left clear">
2013-04-30 18:18:07 +00:00
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
2013-02-25 21:16:55 +00:00
</div>
2013-08-28 23:08:41 +00:00
<? } ?>
2013-02-25 21:16:55 +00:00
<div class="group_info clear">
<span>
2013-10-26 08:00:58 +00:00
[ <a href="torrents.php?action=download&amp;id=<?=$TorrentID?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>" class="tooltip" title="Download">DL</a>
2012-10-28 08:00:19 +00:00
<? if (Torrents::can_use_token($Torrent)) { ?>
2013-10-26 08:00:58 +00:00
| <a href="torrents.php?action=download&amp;id=<?=$TorrentID ?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>&amp;usetoken=1" class="tooltip" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
2012-10-28 08:00:19 +00:00
<? } ?>
2013-10-26 08:00:58 +00:00
| <a href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>" class="tooltip" title="Report">RP</a>
2013-04-17 08:00:58 +00:00
<? if ($IsBookmarked) { ?>
2013-08-28 23:08:41 +00:00
| <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark" onclick="Unbookmark('torrent', <?=$GroupID?>, 'Bookmark'); return false;">Remove bookmark</a>
2012-10-27 08:00:09 +00:00
<? } else { ?>
2013-08-28 23:08:41 +00:00
| <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="add_bookmark" onclick="Bookmark('torrent', <?=$GroupID?>, 'Remove bookmark'); return false;">Bookmark</a>
2012-10-27 08:00:09 +00:00
<? } ?>
2013-02-25 21:16:55 +00:00
]
</span>
2013-11-01 08:01:02 +00:00
<strong><?=$DisplayName?></strong> <!--<?Votes::vote_link($GroupID, $UserVote);?>-->
2013-02-25 21:16:55 +00:00
<div class="tags"><?=$TorrentTags->format()?></div>
</div>
2012-10-27 08:00:09 +00:00
</td>
2013-08-28 23:08:41 +00:00
<td class="number_column nobr"><?=Format::get_size($Torrent['Size'])?></td>
<td class="number_column"><?=number_format($Torrent['Snatched'])?></td>
<td class="number_column<?=($Torrent['Seeders'] == 0) ? ' r00' : '' ?>"><?=number_format($Torrent['Seeders'])?></td>
<td class="number_column"><?=number_format($Torrent['Leechers'])?></td>
2012-10-27 08:00:09 +00:00
</tr>
2013-04-17 08:00:58 +00:00
<?
2013-08-28 23:08:41 +00:00
} //if (count($Torrents) > 1 || $GroupCategoryID == 1)
2013-07-17 08:00:52 +00:00
$TorrentTable .= ob_get_clean();
2012-10-27 08:00:09 +00:00
}
?>
<table class="torrent_table grouping cats" id="discog_table">
<tr class="colhead_dark">
<td><!-- expand/collapse --></td>
2013-10-05 08:01:00 +00:00
<td class="cats_col"><!-- category --></td>
<td width="70%">Torrents</td>
2012-10-27 08:00:09 +00:00
<td>Size</td>
2013-11-01 08:01:02 +00:00
<td class="sign snatches"><img src="static/styles/<?=$LoggedUser['StyleName'] ?>/images/snatched.png" alt="Snatches" title="Snatches" class="tooltip" /></td>
<td class="sign seeders"><img src="static/styles/<?=$LoggedUser['StyleName'] ?>/images/seeders.png" alt="Seeders" title="Seeders" class="tooltip" /></td>
<td class="sign leechers"><img src="static/styles/<?=$LoggedUser['StyleName'] ?>/images/leechers.png" alt="Leechers" title="Leechers" class="tooltip" /></td>
2012-10-27 08:00:09 +00:00
</tr>
<?
2013-11-01 08:01:02 +00:00
if ($TopVotes === false) { ?>
2012-10-27 08:00:09 +00:00
<tr>
<td colspan="7" class="center">Server is busy processing another top list request. Please try again in a minute.</td>
</tr>
<?
2013-07-17 08:00:52 +00:00
} elseif (count($TopVotes) === 0) { ?>
2012-10-27 08:00:09 +00:00
<tr>
<td colspan="7" class="center">No torrents were found that meet your criteria.</td>
</tr>
<?
} else {
echo $TorrentTable;
}
?>
</table>
</div>
<?
View::show_footer();
2012-12-27 08:00:27 +00:00
?>