mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 02:46:30 +00:00
36 lines
1.3 KiB
PHP
36 lines
1.3 KiB
PHP
<?
|
|
//Include Last.fm in the user sidebar only if a Last.fm username is specified.
|
|
$DB->query("
|
|
SELECT username
|
|
FROM lastfm_users
|
|
WHERE ID = $UserID");
|
|
if ($DB->has_results()) {
|
|
list($LastFMUsername) = $DB->next_record();
|
|
$LastFMInfo = LastFM::get_user_info($LastFMUsername);
|
|
//Hand everything else over to JS (gets data via the username in an id-d div) to allow faster page loading.
|
|
?>
|
|
<div class="box box_info box_lastfm">
|
|
<div class="head colhead_dark">Last.fm</div>
|
|
<ul class="stats nobullet">
|
|
<li>
|
|
Username: <a id="lastfm_username" href="<?=$LastFMInfo['user']['url']?>" target="_blank" title="<?=$LastFMInfo['user']['name']?> on Last.fm: <?=number_format($LastFMInfo['user']['playcount'])?> plays, <?=number_format($LastFMInfo['user']['playlists'])?> playlists."><?=$LastFMUsername?></a>
|
|
</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 = $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>
|
|
<?
|
|
} ?>
|