Commit 9de8f34b authored by tobyink's avatar tobyink

Moving top track to stats page (or at least attempting to)

parent 895118ff
......@@ -54,13 +54,6 @@
{/section}
</ul>
<h3>{$me->name}'s Top Tracks</h3>
<ul>
{section name=i loop=$toptracks}
<li style="width:{$toptracks[i].width}" class="toptrack"><a href="{$toptracks[i].artisturl}">{$toptracks[i].artist}</a> - <a href="{$toptracks[i].trackurl}">{$toptracks[i].track}<a></li>
{/section}
</ul>
<!-- Column break -->
</div></div><div class="yui-u" id="sidebar"><div style="padding: 10px;">
......
{include file='header.tpl'}
<h2 property="dc:title">{$user|escape:'html':'UTF-8'}'s statistics</h2>
<h2 property="dc:title">{$me->name|escape:'html':'UTF-8'}'s statistics</h2>
{include file='maxiprofile.tpl'}
<h3 id="stats_by_artist">{$user}'s most played artists</h3>
<table class="stats_artists" about="{$id}">
<h3 id="stats_by_artist">{$me->name|escape:'html':'UTF-8'}'s most played artists</h3>
<table class="stats_artists" about="{$me->id}">
{section name=i loop=$user_playstats}
<tr><td class="counts">{$user_playstats[i].count}</td><td class="bar" style="width: {$stat_barwidth}px"><div style="width:{$user_playstats[i].size}px" class="artist"></div></td><td><a
href="{$user_playstats[i].pageurl|escape:'html':'UTF-8'}" rel="{if $user_playstats[i].size|substr:-5 ==
......@@ -13,8 +13,26 @@
{/section}
</table>
<h3 id="stats_by_day">{$user}'s scrobbles by day</h3>
<table class="stats_artists" about="{$id}">
<h3 id="stats_by_track">{$me->name|escape:'html':'UTF-8'}'s Top Tracks</h3>
<table class="stats_artists" about="{$me->id}">
{section name=i loop=$toptracks}
<tr>
<td class="counts">{$toptracks[i].c}</td>
<td class="bar" style="width: {$toptracks[i].width}px">
<div style="width:{$toptracks[i].width}px" class="track"></div>
</td>
<td>
<a href="{$toptracks[i].artisturl|escape:'html':'UTF-8'}">{$toptracks[i].artist|escape:'html':'UTF-8'}</a>
</td>
<td>
<a href="{$toptracks[i].trackurl|escape:'html':'UTF-8'}">{$toptracks[i].track|escape:'html':'UTF-8'}</a>
</td>
</tr>
{/section}
</table>
<h3 id="stats_by_day">{$me->name|escape:'html':'UTF-8'}'s scrobbles by day</h3>
<table class="stats_artists" about="{$me->id}">
{section name=i loop=$user_daystats}
<tr><td class="counts">{$user_daystats[i].count}</td><td class="bar" style="width: {$stat_barwidth}px"><div style="width:{$user_daystats[i].size}px" class="artist"></div></td><td class="date">{$user_daystats[i].date}</td></tr>
{/section}
......
......@@ -76,8 +76,6 @@ if(isset($user->name)) {
)
));
$smarty->assign('toptracks', $user->getTopTracks());
$smarty->display('user-profile.tpl');
} else {
$smarty->assign('error', 'User not found');
......
......@@ -35,12 +35,7 @@ if(!isset($_GET['user']) && $logged_in == false) {
$user = new User($_GET['user']);
if(isset($user->name)) {
$smarty->assign("id", $user->id);
$smarty->assign("acctid", $user->acctid);
$smarty->assign('user', $user->name);
$smarty->assign('homepage', $user->homepage);
$smarty->assign('location', $user->location);
$smarty->assign('location_uri', $user->location_uri);
$aUserScrobbles = $user->getScrobbles(20);
if (!PEAR::isError ($aUserScrobbles)) {
$smarty->assign('scrobbles', $aUserScrobbles);
......@@ -67,6 +62,8 @@ if(isset($user->name)) {
$smarty->assign('user_daystats',$aUserDayStat);
}
$smarty->assign('toptracks', $user->getTopTracks());
$smarty->assign('me', $user);
$smarty->assign('isme', ($_SESSION['user']->name == $user->name));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment