Gazelle/classes/lastfmview.class.php

39 lines
1.3 KiB
PHP
Raw Normal View History

2013-09-14 08:00:52 +00:00
<?
class LastFMView {
2013-10-13 08:01:01 +00:00
/* Renders the sidebar shown on user profiles
*
* @param $LastFMUsername
* @param $UserID
* @param $OwnProfile
*/
2013-09-14 08:00:52 +00:00
public static function render_sidebar($LastFMUsername, $UserID, $OwnProfile) {
2013-10-13 08:01:01 +00:00
$LastFMInfo = LastFM::get_user_info($LastFMUsername);
?>
<div class="box box_info box_lastfm">
<div class="head colhead_dark">Last.fm</div>
<ul class="stats nobullet">
<li>
2013-11-05 08:01:12 +00:00
Username: <a id="lastfm_username" href="<?=$LastFMInfo['user']['url']?>" target="_blank" class="tooltip" title="<?=$LastFMInfo['user']['name']?> on Last.fm: <?=number_format($LastFMInfo['user']['playcount'])?> plays, <?=number_format($LastFMInfo['user']['playlists'])?> playlist<?=$LastFMInfo['user']['playlists'] != 1 ? 's' : ''?>."><?=$LastFMUsername?></a>
2013-10-13 08:01:01 +00:00
</li>
<div id="lastfm_stats"<?=$OwnProfile ? ' data-uid="1"' : ''?>>
</div>
<li>
<a href="#" id="lastfm_expand" onclick="return false;" class="brackets">Show more info</a>
<?
//Append the reload stats button only if allowed on the current user page.
$Response = G::$Cache->get_value("lastfm_clear_cache_$UserID");
if (empty($Response)) {
?>
<span id="lastfm_reload_container">
<a href="#" id="lastfm_reload" onclick="return false;" class="brackets">Reload stats</a>
</span>
<? } ?>
</li>
</ul>
</div>
<?
2013-09-14 08:00:52 +00:00
}
2013-10-13 08:01:01 +00:00
}