By cre8d on
I'd like to change how the "Who's online" block looks.
I would like it to read like this:
There are currently 8543 members and 58 people are online right now, including: Member 1, Member 2, Member 3
Instead of this:
Who's online
There are currently 3 users and 55 guests online.
Online users:
- Member 1
- Member 2
- Member 3
Is this possible - and if so, how do I go about making the changes?
Comments
It's part of the user module
It's part of the code of the user module -- here is the source from CVS. You have two choices -- either hack the code for generating the Who's Online block, or just copy that code into a new, custom PHP block, and edit it to be formatted however you like.
Thanks
Will try making it into a custom block so I don't muck with the source :)
Is there a way someone could
Is there a way someone could post the code I should place in the block? I'm a little confused as to what sections of that code need to be included in a custom "Who's Online" block (I want to add how many total members exist to the block).
Thanks,
Nathan
http://www.sbbic.org
Ok, I think I got it - put
Ok, I think I got it - put this in a block with php enabled:
That adds the total number of users and then tells how many are currently online
-Nathan
That works perfectly, thanks
That works perfectly, thanks nathan,
Glad to help :) -Nathan
Glad to help :)
-Nathan
Nicely Done
Thanks, worked great for me!
Tried this
Okay so I tried this on Drupal 5 and not sure if it's because it's a new version or what but when the online count comes up it comes up as:
"Out of 4 registered users there are currently %count users and %count guests online." rather than stating the numbers (It will say there is 1 user on or 1 guest but when there is neither one the other or both it will still say %count)
Secondly is there anyway to make certain members Admin, Moderator, Etc) different colors?
If you used the code posted
If you used the code posted in the thread and didnt pull new code out of the user.module in the cvs link that would be why it did not work. The code in the post is for Drupal 4.x.x.
Check out the cvs link and pull the proper code for Drupal 5.
neat idea, may be able to be done with some .css magic. I don't have a recipe for it off the top of my head though.
Yeah figured that
Yeah I kind-of figured that. Unfortunately not the coding king (know basic html) so I will probably have to wait to get it fixed. Thanks though will try and look through it and see if I can guesstimate or figure something out.
...
Zen theme has some css class selectors for comments. Not sure if it is tied to user or role but it should be adaptable for it.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
warning do not use this php code
i popped this in to a new block just to see what it would do and it completely disabled my drupal4.7 website and its been a real pain to get the site running again. avoid.
from 2005
This thread is from 2005 so probably Drupal 4.5
Note this link in the Best Practices section on testing php code.
I am locking this thread due to age.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide