[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1070] Move stats into the user profiles area.
From: |
Toby Inkster |
Subject: |
[Librefm-commits] [1070] Move stats into the user profiles area. |
Date: |
Thu, 30 Apr 2009 17:27:47 +0000 |
Revision: 1070
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1070
Author: tobyink
Date: 2009-04-30 17:27:46 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
Move stats into the user profiles area.
Modified Paths:
--------------
trunk/nixtape/.htaccess
trunk/nixtape/themes/librefm/templates/maxiprofile.tpl
Added Paths:
-----------
trunk/nixtape/themes/librefm/templates/user-stats.tpl
trunk/nixtape/user-stats.php
Removed Paths:
-------------
trunk/nixtape/stats.php
trunk/nixtape/themes/librefm/templates/stats.tpl
Modified: trunk/nixtape/.htaccess
===================================================================
--- trunk/nixtape/.htaccess 2009-04-30 17:02:05 UTC (rev 1069)
+++ trunk/nixtape/.htaccess 2009-04-30 17:27:46 UTC (rev 1070)
@@ -5,6 +5,7 @@
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]
Deleted: trunk/nixtape/stats.php
===================================================================
--- trunk/nixtape/stats.php 2009-04-30 17:02:05 UTC (rev 1069)
+++ trunk/nixtape/stats.php 2009-04-30 17:27:46 UTC (rev 1070)
@@ -1,80 +0,0 @@
-<?php
-
-/* Libre.fm -- a free network service for sharing your music listening habits
-
- Copyright (C) 2009 Libre.fm Project
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-require_once('database.php');
-require_once('templating.php');
-require_once('data/User.php');
-require_once('data/TagCloud.php');
-require_once('data/Statistic.php');
-
-if(!isset($_GET['user']) && $logged_in == false) {
- $smarty->assign('error', 'Error!');
- $smarty->assign('details', 'User not set! You shouldn\'t be here!');
- $smarty->display('error.tpl');
- die();
-}
-
-$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);
- }
- $smarty->assign('userlevel', $user->userlevel);
- $smarty->assign('avatar', $user->getAvatar());
- $aUserNowPlaying = $user->getNowPlaying(10);
- if (!PEAR::isError ($aUserNowPlaying)) {
- $smarty->assign('nowplaying', $aUserNowPlaying);
- }
- $aUserTagCloud = TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40,
$user->name);
- if (!PEAR::isError ($aUserTagCloud)) {
- $smarty->assign('user_tagcloud',$aUserTagCloud);
- }
-
- $smarty->assign('stat_barwidth', 320);
- $aUserPlayStat = Statistic::GeneratePlayStats('Scrobbles', 'artist',
40, $user->name, 300);
- if (!PEAR::isError ($aUserPlayStat)) {
- $smarty->assign('user_playstats',$aUserPlayStat);
- }
-
- $aUserDayStat = Statistic::generatePlayByDays('Scrobbles', 40,
$user->name, 300);
- if (!PEAR::isError ($aUserDayStat)) {
- $smarty->assign('user_daystats',$aUserDayStat);
- }
-
- $smarty->assign('isme', ($_SESSION['user']->name == $user->name));
-
- $smarty->assign('stats', true);
- $smarty->display('stats.tpl');
-} else {
- $smarty->assign('error', 'User not found');
- $smarty->assign('details', 'Shall I call in a missing persons report?');
- $smarty->display('error.tpl');
-}
-
-?>
Modified: trunk/nixtape/themes/librefm/templates/maxiprofile.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/maxiprofile.tpl 2009-04-30
17:02:05 UTC (rev 1069)
+++ trunk/nixtape/themes/librefm/templates/maxiprofile.tpl 2009-04-30
17:27:46 UTC (rev 1070)
@@ -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>
+ · <a{if $this_page_absolute != $me->getURL('stats')}
rel="rdfs:seeAlso"
href="{$me->getURL('stats')|escape:'html':'UTF-8'}"{/if}>stats</a>
· <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} · <a{if $this_page_absolute !=
$me->getURL('journal')} rel="rdfs:seeAlso"
href="{$me->getURL('journal')|escape:'html':'UTF-8'}"{/if}>journal</a>{/if}
</div>
Deleted: trunk/nixtape/themes/librefm/templates/stats.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/stats.tpl 2009-04-30 17:02:05 UTC
(rev 1069)
+++ trunk/nixtape/themes/librefm/templates/stats.tpl 2009-04-30 17:27:46 UTC
(rev 1070)
@@ -1,62 +0,0 @@
-{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>
-
-<h3 id="stats_by_artist">{$user}'s most played artists</h3>
-<table class="stats_artists" about="{$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 ==
- 'large'}foaf:interest
{/if}tag">{$user_playstats[i].artist|escape:"html":"UTF-8"}</a></td></tr>
- {/section}
-</table>
-
-<h3 id="stats_by_day">{$user}'s 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>
- {/section}
-</table>
-
-<!-- Column break -->
-</div></div><div class="yui-u" id="sidebar"><div style="padding: 10px;">
-
-<h3>{$user}'s 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>
-</ul>
-<p><strong>More coming soon</strong></p>
-
-{include file='footer.tpl'}
Copied: trunk/nixtape/themes/librefm/templates/user-stats.tpl (from rev 1061,
trunk/nixtape/themes/librefm/templates/stats.tpl)
===================================================================
--- trunk/nixtape/themes/librefm/templates/user-stats.tpl
(rev 0)
+++ trunk/nixtape/themes/librefm/templates/user-stats.tpl 2009-04-30
17:27:46 UTC (rev 1070)
@@ -0,0 +1,33 @@
+{include file='header.tpl'}
+
+<h2 property="dc:title">{$user|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}">
+ {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 ==
+ 'large'}foaf:interest
{/if}tag">{$user_playstats[i].artist|escape:"html":"UTF-8"}</a></td></tr>
+ {/section}
+</table>
+
+<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>
+ {/section}
+</table>
+
+<!-- Column break -->
+</div></div><div class="yui-u" id="sidebar"><div style="padding: 10px;">
+
+<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>
+</ul>
+<p><strong>More coming soon</strong></p>
+
+{include file='footer.tpl'}
Copied: trunk/nixtape/user-stats.php (from rev 1061, trunk/nixtape/stats.php)
===================================================================
--- trunk/nixtape/user-stats.php (rev 0)
+++ trunk/nixtape/user-stats.php 2009-04-30 17:27:46 UTC (rev 1070)
@@ -0,0 +1,81 @@
+<?php
+
+/* Libre.fm -- a free network service for sharing your music listening habits
+
+ Copyright (C) 2009 Libre.fm Project
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+require_once('database.php');
+require_once('templating.php');
+require_once('data/User.php');
+require_once('data/TagCloud.php');
+require_once('data/Statistic.php');
+
+if(!isset($_GET['user']) && $logged_in == false) {
+ $smarty->assign('error', 'Error!');
+ $smarty->assign('details', 'User not set! You shouldn\'t be here!');
+ $smarty->display('error.tpl');
+ die();
+}
+
+$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);
+ }
+ $smarty->assign('userlevel', $user->userlevel);
+ $smarty->assign('avatar', $user->getAvatar());
+ $aUserNowPlaying = $user->getNowPlaying(10);
+ if (!PEAR::isError ($aUserNowPlaying)) {
+ $smarty->assign('nowplaying', $aUserNowPlaying);
+ }
+ $aUserTagCloud = TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40,
$user->name);
+ if (!PEAR::isError ($aUserTagCloud)) {
+ $smarty->assign('user_tagcloud',$aUserTagCloud);
+ }
+
+ $smarty->assign('stat_barwidth', 320);
+ $aUserPlayStat = Statistic::GeneratePlayStats('Scrobbles', 'artist',
40, $user->name, 300);
+ if (!PEAR::isError ($aUserPlayStat)) {
+ $smarty->assign('user_playstats',$aUserPlayStat);
+ }
+
+ $aUserDayStat = Statistic::generatePlayByDays('Scrobbles', 40,
$user->name, 300);
+ 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('user-stats.tpl');
+} else {
+ $smarty->assign('error', 'User not found');
+ $smarty->assign('details', 'Shall I call in a missing persons report?');
+ $smarty->display('error.tpl');
+}
+
+?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1070] Move stats into the user profiles area.,
Toby Inkster <=