summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocs/CHANGELOG3
-rw-r--r--stats.php25
-rw-r--r--templates/show_users.inc8
3 files changed, 26 insertions, 10 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 867908dc..8dd4b4aa 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -30,6 +30,9 @@
the preferences, and cleaned up logic
- Fixed a problem with Real Player Tag detection (hack)
- Added RAM playlist type
+ - Added ability for Admin's to view other users personal stats
+ - Fixed a problem with the Apply to All checkbox on admin
+ preferences
--------------------------------------------------------------------------
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']);?>
diff --git a/templates/show_users.inc b/templates/show_users.inc
index 759ba458..aaebf778 100644
--- a/templates/show_users.inc
+++ b/templates/show_users.inc
@@ -54,6 +54,9 @@ $admin_menu = "admin/";
<td align="center">
<b><?php echo _("Prefs"); ?></b>
</td>
+ <td align="center">
+ <b><?php echo _("Stats"); ?></b>
+ </td>
<td align="center">
<b><?php echo _("Access"); ?></b>
</td>
@@ -91,6 +94,11 @@ while ( $results = mysql_fetch_object($db_result) ) {
<?php echo _("Prefs"); ?>
</a>
</td>
+ <td>
+ <a href="<?php echo conf('web_path'); ?>/stats.php?user_id=<?php echo $user->username; ?>">
+ <?php echo _("Stats"); ?>
+ </a>
+ </td>
<?php
//FIXME: Fix this for the extra permission levels
if ($user->disabled == '1') {