Gazelle/sections/top10/lastfm.php

59 lines
1.4 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;
2013-10-24 08:01:05 +00:00
$Category = isset($_GET['category']) ? $_GET['category'] : 'weekly';
2013-09-09 08:00:52 +00:00
$Category = in_array($Category, array('all_time', 'weekly', 'hyped')) ? $Category : 'weekly';
2013-10-24 08:01:05 +00:00
$View = isset($_GET['view']) ? $_GET['view'] : 'tiles';
2013-09-09 08:00:52 +00:00
$View = in_array($View, array('tiles', 'list')) ? $View : 'tiles';
switch ($Category) {
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;
}
2014-01-24 08:00:47 +00:00
View::show_header("Last.fm", "jquery.imagesloaded,jquery.wookmark,top10", "tiles");
2013-09-09 08:00:52 +00:00
?>
<div class="thin">
<div class="header">
2014-01-24 08:00:47 +00:00
<h2>Last.fm</h2>
2013-10-10 08:01:46 +00:00
<? Top10View::render_linkbox("lastfm"); ?>
2013-09-09 08:00:52 +00:00
</div>
2013-10-10 08:01:46 +00:00
<? Top10View::render_artist_links($Category, $View); ?>
<? Top10View::render_artist_controls($Category, $View); ?>
2013-09-09 08:00:52 +00:00
<? if ($View == 'tiles') { ?>
<div class="tiles_container">
<ul class="tiles">
2013-10-10 08:01:46 +00:00
<?
2013-10-24 08:01:05 +00:00
foreach ($Artists as $Artist) {
Top10View::render_artist_tile($Artist, $Category);
}
?>
2013-09-09 08:00:52 +00:00
</ul>
</div>
<? } else { ?>
<div class="list_container">
<ul class="top_artist_list">
2013-10-10 08:01:46 +00:00
<?
2013-10-24 08:01:05 +00:00
foreach ($Artists as $Artist) {
Top10View::render_artist_list($Artist, $Category);
}
?>
2013-09-09 08:00:52 +00:00
</ul>
</div>
<? } ?>
</div>
<?
View::show_footer();
2013-09-20 08:00:56 +00:00
?>