Gazelle/sections/torrents/vote_ranks.php

40 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2012-11-07 08:00:18 +00:00
<?
2013-05-14 08:00:34 +00:00
// Show the "This album is number x overall", etc. box for the "Music" category only
2012-11-07 08:00:18 +00:00
if ($GroupCategoryID == 1) {
$Rankings = Votes::get_ranking($GroupID, $GroupYear);
$LIs = '';
// Display information for the return categories of get_ranking()
2013-04-17 08:00:58 +00:00
$GroupDecade = $GroupYear - ($GroupYear % 10);
2013-01-05 08:00:47 +00:00
$names = array('overall'=>'<a href="top10.php?type=votes">overall</a>',
2013-05-14 08:00:34 +00:00
'decade'=>check_perms('site_advanced_top10') ? 'for the <a href="top10.php?advanced=1&amp;type=votes&amp;year1='.$GroupDecade.'&amp;year2='.($GroupDecade+9).'">'.$GroupDecade.'s</a>' : 'for the '.$GroupDecade.'s',
'year'=>check_perms('site_advanced_top10') ? 'for <a href="top10.php?advanced=1&amp;type=votes&amp;year1='.$GroupYear.'&amp;year2=">'.$GroupYear.'</a>' : "for $GroupYear");
2013-02-22 08:00:24 +00:00
2012-11-07 08:00:18 +00:00
foreach ($names as $key => $text) {
if ($Rank = $Rankings[$key]) {
if ($Rank <= 10) {
2013-04-17 08:00:58 +00:00
$Class = 'vr_top_10';
2012-11-07 08:00:18 +00:00
} elseif ($Rank <= 25) {
2013-04-17 08:00:58 +00:00
$Class = 'vr_top_25';
2012-11-07 08:00:18 +00:00
} elseif ($Rank <= 50) {
2013-04-17 08:00:58 +00:00
$Class = 'vr_top_50';
2012-11-07 08:00:18 +00:00
}
2013-02-22 08:00:24 +00:00
2013-05-14 08:00:34 +00:00
$LIs .= "<li id=\"vote_rank_$key\" class=\"$Class\">No. $Rank $text</li>";
2012-11-07 08:00:18 +00:00
}
}
2013-02-22 08:00:24 +00:00
2012-11-07 08:00:18 +00:00
if ($LIs != '') {
?>
<div class="box" id="votes_ranks">
<div class="head"><strong><?=SITE_NAME?> Favorites</strong></div>
<div class="vote_charts body">
<ul class="stats nobullet" id="vote_rankings">
<?=$LIs?>
</ul>
</div>
</div>
<?
}
}
2013-01-05 08:00:47 +00:00
?>