Gazelle/sections/top10/artists.php

56 lines
1.5 KiB
PHP
Raw Normal View History

2013-09-09 08:00:52 +00:00
<?
2013-09-29 08:00:52 +00:00
define('LIMIT', 100);
2013-09-09 08:00:52 +00:00
//$Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 100;
//$Limit = in_array($Limit, array(100, 250, 500)) ? $Limit : 100;
$Category = isset($_GET['category']) ? ($_GET['category']) : 'weekly';
$Category = in_array($Category, array('all_time', 'weekly', 'hyped')) ? $Category : 'weekly';
$View = isset($_GET['view']) ? ($_GET['view']) : 'tiles';
$View = in_array($View, array('tiles', 'list')) ? $View : 'tiles';
switch ($Category) {
2013-09-13 08:00:53 +00:00
2013-09-09 08:00:52 +00:00
case 'weekly':
2013-09-29 08:00:52 +00:00
$Artists = json_decode(LastFM::get_weekly_artists(LIMIT), true)['artists']['artist'];
2013-09-09 08:00:52 +00:00
break;
case 'hyped':
2013-09-29 08:00:52 +00:00
$Artists = json_decode(LastFM::get_hyped_artists(LIMIT), true)['artists']['artist'];
2013-09-09 08:00:52 +00:00
break;
default:
break;
}
View::show_header("Top Artists", "jquery.imagesloaded,jquery.wookmark,top10", "tiles");
?>
<div class="thin">
<div class="header">
2013-09-29 08:00:52 +00:00
<h2>Top <?=LIMIT?> Artists</h2>
2013-09-09 08:00:52 +00:00
<? Top10View::render_linkbox("artists"); ?>
</div>
<? Top10View::render_artist_links($Category, $View); ?>
<? Top10View::render_artist_controls($Category, $View); ?>
<? if ($View == 'tiles') { ?>
<div class="tiles_container">
<ul class="tiles">
2013-09-20 08:00:56 +00:00
<? foreach ($Artists as $Artist) {
2013-09-09 08:00:52 +00:00
Top10View::render_artist_tile($Artist, $Category);
} ?>
</ul>
</div>
<? } else { ?>
<div class="list_container">
<ul class="top_artist_list">
2013-09-20 08:00:56 +00:00
<? foreach ($Artists as $Artist) {
2013-09-09 08:00:52 +00:00
Top10View::render_artist_list($Artist, $Category);
} ?>
</ul>
</div>
<? } ?>
</div>
<?
View::show_footer();
2013-09-20 08:00:56 +00:00
?>