MyBB Community Forums

Full Version: How can I do this?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I want to add this to my forum:

Who's Online [Complete List]
4 users active in the past 15 minutes (0 members, 0 of whom are invisible, and 4 guests).
[Admins] [Super Moderator] [Moderator] [Registered] [Staff] [Banned] [Spammers]
Users Online Today:
FirefoxWiz, Beta, _ISR_m3rc_, The_nVIDiA_Guy, rockyou, DOUNUTS, happypenguin, DaSnipa, Papa Spot, Mr.Robato


Can someone help? Smile

Thx!
if you are referring to the group legend read here

if you are referring to today's online read here
well the users online you can find here:
http://community.mybboard.net/showthread.php?tid=8394

about the groups etc. They are in the database, you can do an query and retrive it.
$query = $db->query("SELECT title FROM ".TABLE_PREFIX."usertitles");
$usertitles = "";
while($usertitle = $db->fetch_array($query)) {
$usertitles .= "[".$usertitle['title']."] ";
}
Then you add $usertitles where you wanna show them in the templates, in whos_online or I would guess.

or if you want the groups.
$query = $db->query("SELECT title FROM ".TABLE_PREFIX."usergroups");
$usertitles = "";
while($usertitle = $db->fetch_array($query)) {
$usertitles .= "[".$usertitle['title']."] ";
}
*ALL FIXED*
No it's not an fix. Wink actually he removed something that may give an warning.
Thanks guys. Toungue
in case you wanna display them with their color !then

replace

 $usertitles .= "[".$usertitle['title']."] ";
with

$usertitles .= "[".str_replace("{username}", $usertitle['title'] , $usertitle['namestyle'])."] "; 

ciao
Then you would need to use
$query = $db->query("SELECT title, namestyle FROM ".TABLE_PREFIX."usergroups");
aswell Smile