summaryrefslogtreecommitdiffstats
path: root/stats.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-10-13 07:13:51 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-10-13 07:13:51 +0000
commitf011ec33913765de57e7e24ec479f2c9f42d3da0 (patch)
treea11973287135e3b1430a71426912f92035ca8e58 /stats.php
parent1a83ac5ab345473e7c0707745f1ca6b3d8c84e53 (diff)
downloadampache-f011ec33913765de57e7e24ec479f2c9f42d3da0.tar.gz
ampache-f011ec33913765de57e7e24ec479f2c9f42d3da0.tar.bz2
ampache-f011ec33913765de57e7e24ec479f2c9f42d3da0.zip
added ability to view other users stats as a full admin
Diffstat (limited to 'stats.php')
-rw-r--r--stats.php25
1 files changed, 15 insertions, 10 deletions
diff --git a/stats.php b/stats.php
index 78c68903..637c5cc6 100644
--- a/stats.php
+++ b/stats.php
@@ -24,15 +24,20 @@
*/
require_once("modules/init.php");
-//FIXME: Remove references
-$uid = $GLOBALS['user']->username;
+/* If we are a full admin then we can see other peoples stats! */
+if ($GLOBALS['user']->has_access(100) AND isset($_REQUEST['user_id'])) {
+ $working_user = new User($_REQUEST['user_id']);
+}
+else {
+ $working_user = $GLOBALS['user'];
+}
show_template('header');
show_menu_items('Stats');
show_clear();
?>
-<div class="header1"><?php echo $user->fullname; ; ?>'s Favorites:</div>
+<div class="header1"><?php echo $working_user->fullname; ; ?>'s Favorites:</div>
<p> Below is a list of what you have been listening to the most. You can clear these statistics
by <a href="<?php echo conf('web_path'); ?>/user.php?action=show_edit_profile">editing your profile.</a></p>
@@ -41,8 +46,8 @@ by <a href="<?php echo conf('web_path'); ?>/user.php?action=show_edit_profile">e
<tr>
<td valign="top">
<?php
- if ( $items = $user->get_favorites('artist') ) {
- $items = $user->format_favorites($items);
+ if ( $items = $working_user->get_favorites('artist') ) {
+ $items = $working_user->format_favorites($items);
show_info_box('Your Favorite Artists', 'artist', $items);
}
else {
@@ -53,8 +58,8 @@ by <a href="<?php echo conf('web_path'); ?>/user.php?action=show_edit_profile">e
<td valign="top">
<?php
- if ( $items = $user->get_favorites('song') ) {
- $items = $user->format_favorites($items);
+ if ( $items = $working_user->get_favorites('song') ) {
+ $items = $working_user->format_favorites($items);
show_info_box('Your Favorite Songs', 'your_song', $items);
}
else {
@@ -65,8 +70,8 @@ by <a href="<?php echo conf('web_path'); ?>/user.php?action=show_edit_profile">e
<td valign="top">
<?php
- if ( $items = $user->get_favorites('album') ) {
- $items = $user->format_favorites($items);
+ if ( $items = $working_user->get_favorites('album') ) {
+ $items = $working_user->format_favorites($items);
show_info_box('Your Favorite Albums', 'album', $items);
}
else {
@@ -78,4 +83,4 @@ by <a href="<?php echo conf('web_path'); ?>/user.php?action=show_edit_profile">e
</table>
<br />
-<?php show_page_footer ('Stats', '',$user->prefs['display_menu']);?>
+<?php show_page_footer ('Stats', '',$working_user->prefs['display_menu']);?>