We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 1e1fa213 authored by tobyink's avatar tobyink

Move stats into the user profiles area.

parent e60d2492
......@@ -5,6 +5,7 @@ RewriteRule ^user/([^/]+)/?$ user-profile.php?user=$1 [B,NC]
RewriteRule ^user/([^/]+)/journal/?$ user-journal.php?user=$1 [B,NC]
RewriteRule ^user/([^/]+)/groups/?$ user-groups.php?user=$1 [B,NC]
RewriteRule ^user/([^/]+)/recent-tracks/?$ user-recent-tracks.php?user=$1 [B,NC]
RewriteRule ^user/([^/]+)/stats/?$ user-stats.php?user=$1 [B,NC]
RewriteRule ^artist/([^/]+)/track/([^/]+)/?$ track.php?artist=$1&track=$2 [B,NC]
RewriteRule ^artist/([^/]+)/album/([^/]+)/track/([^/]+)/?$ track.php?artist=$1&album=$2&track=$3 [B,NC]
RewriteRule ^artist/([^/]+)/album/([^/]+)/?$ album.php?artist=$1&album=$2 [B,NC]
......
......@@ -54,6 +54,7 @@
<div style="text-align:right;clear:right;font-size:80%">
<a{if $this_page_absolute != $me->getURL()} rel="rdfs:seeAlso" href="{$me->getURL()|escape:'html':'UTF-8'}"{/if}>profile</a>
&middot; <a{if $this_page_absolute != $me->getURL('stats')} rel="rdfs:seeAlso" href="{$me->getURL('stats')|escape:'html':'UTF-8'}"{/if}>stats</a>
&middot; <a{if $this_page_absolute != $me->getURL('recent-tracks')} rel="rdfs:seeAlso" href="{$me->getURL('recent-tracks')|escape:'html':'UTF-8'}"{/if}>recent tracks</a>
{if $me->journal_rss} &middot; <a{if $this_page_absolute != $me->getURL('journal')} rel="rdfs:seeAlso" href="{$me->getURL('journal')|escape:'html':'UTF-8'}"{/if}>journal</a>{/if}
</div>
......
{include file='header.tpl'}
<h2 property="dc:title">{$user|escape:'html':'UTF-8'}'s statistics</h2>
<div about="{$id|escape:'html':'UTF-8'}" typeof="foaf:Agent" class="user vcard">
<div class="avatar" rel="foaf:depiction">
<!-- Avatar placeholder -->
<img src="{$avatar|escape:'html':'UTF-8'}" alt="avatar" class="photo" />
</div>
{if $isme}
<a class="edit" href="{$base_url}/edit_profile.php">[edit]</a>
{/if}
<dl>
<dt>
<span class="fn" property="foaf:name">{$fullname|escape:'html':'UTF-8'}</span>
<span rel="foaf:holdsAccount" rev="sioc:account_of">
<span about="{$acctid|escape:'html':'UTF-8'}" typeof="sioc:User">
(<span class="nickname" property="foaf:accountName">{$user|escape:'html':'UTF-8'}</span>)
<span rel="foaf:accountServiceHomepage" resource="{$base_url}"></span>
<span rel="foaf:accountProfilePage" rev="foaf:topic" resource=""></span>
</span>
</span>
</dt>
{if $homepage}
<dd>
<a href="{$homepage|escape:'html':'UTF-8'}" rel="me foaf:homepage" class="url">{$homepage|escape:'html':'UTF-8'}</a>
</dd>
{/if}
</dl>
<hr style="border: 1px solid transparent; clear: both;" rel="foaf:page" rev="foaf:primaryTopic" resource="" />
</div>
{include file='maxiprofile.tpl'}
<h3 id="stats_by_artist">{$user}'s most played artists</h3>
<table class="stats_artists" about="{$id}">
......@@ -42,7 +13,7 @@
{/section}
</table>
<h3 id="stats_by_day">{$user}'s scrobbles by day</h3>
<h3 id="stats_by_day">{$user}'s{/if} scrobbles by day</h3>
<table class="stats_artists" about="{$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>
......@@ -52,7 +23,7 @@
<!-- Column break -->
</div></div><div class="yui-u" id="sidebar"><div style="padding: 10px;">
<h3>{$user}'s statistics</h3>
<h3>{$user}'s{/if} statistics</h3>
<ul>
<li><a href="#stats_by_artist">Most played artists</a></li>
<li><a href="#stats_by_day">Scrobbles by day</a></li>
......
......@@ -66,11 +66,12 @@ if(isset($user->name)) {
if (!PEAR::isError ($aUserDayStat)) {
$smarty->assign('user_daystats',$aUserDayStat);
}
$smarty->assign('me', $user);
$smarty->assign('isme', ($_SESSION['user']->name == $user->name));
$smarty->assign('stats', true);
$smarty->display('stats.tpl');
$smarty->display('user-stats.tpl');
} else {
$smarty->assign('error', 'User not found');
$smarty->assign('details', 'Shall I call in a missing persons report?');
......
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