# HG changeset patch
# User Dan
# Date 1278751663 14400
# Node ID 5cf660b4dce22567f4d8e8261834d4339780dc0e
# Parent a314569f88298a4088518ae0e67340fa6aec626b
Added user rank support.
diff -r a314569f8829 -r 5cf660b4dce2 plugins/WhosOnline.php
--- a/plugins/WhosOnline.php Wed Jun 13 22:35:49 2007 -0400
+++ b/plugins/WhosOnline.php Sat Jul 10 04:47:43 2010 -0400
@@ -65,28 +65,38 @@
$num_guests = 0;
$num_users = 0;
$users = Array();
- while ( $row = $db->fetchrow() )
+ while ( $row = $db->fetchrow($q) )
{
( $row['user_id'] == 1 ) ? $num_guests++ : $num_users++;
if($row['user_id'] > 1)
{
- switch($row['user_level'])
- {
- case USER_LEVEL_MEMBER:
- default:
- $color = '303030';
- $weight = 'normal';
- break;
- case USER_LEVEL_MOD:
- $color = '00AA00';
- $weight = 'bold';
- break;
- case USER_LEVEL_ADMIN:
- $color = 'AA0000';
- $weight = 'bold';
- break;
- }
- $users[] = "{$row['username']}";
+ if ( defined('RANK_ID_MEMBER') )
+ {
+ // We're in an Enano with rank support
+ $rankinfo = $session->get_user_rank($row['user_id']);
+ $rank_style = $rankinfo['rank_style'];
+ }
+ else
+ {
+ switch($row['user_level'])
+ {
+ case USER_LEVEL_MEMBER:
+ default:
+ $color = '303030';
+ $weight = 'normal';
+ break;
+ case USER_LEVEL_MOD:
+ $color = '00AA00';
+ $weight = 'bold';
+ break;
+ case USER_LEVEL_ADMIN:
+ $color = 'AA0000';
+ $weight = 'bold';
+ break;
+ }
+ $rank_style = "color: #$color; font-weight: $weight";
+ }
+ $users[] = "{$row['username']}";
$whos_online['users'][] = $row['username'];
}
else