Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: FiNCH - helmikuu 26, 2006, 04:24:48 IP

Otsikko: using SSI to load who's online into an array
Kirjoitti: FiNCH - helmikuu 26, 2006, 04:24:48 IP
Okay i've been at this all day, all i'm trying to do is load the whosOnline(); function into an array and simply display the number of people online, including guests, members, hidden...every possible user.

Can someone help me out with this?
Otsikko: Re: using SSI to load who's online into an array
Kirjoitti: kegobeer - helmikuu 26, 2006, 04:33:21 IP
Have you reviewed the SSI Basic, Advanced, and Expert threads?  They show how to call a function and get the data instead of merely echoing the data.


$users = ssi_whosOnline('array');


You can look at the whosOnline function and see what data is returned into the array (things like id, username, group, etc), and then you can write the code to output only what you want.
Otsikko: Re: using SSI to load who's online into an array
Kirjoitti: FiNCH - helmikuu 26, 2006, 04:44:23 IP
bleh i don't know what i did...

i couldn't see this part of the array before *shrugs*

    [guests] => 0
    [hidden] => 0
    [buddies] => 0
    [num_users] => 1
    [total_users] => 1


thanx for the help, i just needed to step back, take a deep breath and think for 5 seconds :P