Topic: users online

Sorry for bothering you so much wink

The usersonline of the extern.php file only gives the number of members and guests that are online.

On my mainpage i would like to display the nicks of the members who are online.
Is this somehow possible?

Thanks.

Re: users online

Sure. I'll help you out when I come home from the univ. tonight.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: users online

cool smile
hope i am online by that time (i don't know in what timezone you are wink)

4

Re: users online

If you want to experiment... I already did something like that:

That's a modded extern.php around line 262

else if ($_GET['action'] == 'online')
{
    // Fetch users online info and generate strings for output
    $num_guests = $num_users = 0;
    $result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online ORDER BY ident') or error('Unable to fetch online users info', __FILE__, __LINE__, $db->error());
    
    $user_name_list=" ";

    while (list($cur_online_id,$user_name_name) = $db->fetch_row($result))
    {
        if ($cur_online_id > 0)
        {
            ++$num_users;
            $user_name_list.=$user_name_name;
        }
        else
        {
            ++$num_guests;
        }
    }

    echo $lang_extern['Users online'].': '.$num_users.':'.$user_name_list.'<br>';
    echo $lang_extern['Guests online'].': '.$num_guests;

    exit;
}

Dunno, just something quick and dirty that seems to work for me. But my forum is not open yet, so... you'd rather wait for Rickard to confirm, since I am not sure I used the right DB field.

Marc

Re: users online

i'll give it a try anyway wink
i'll just make it so 'action' needs to be something like 'online2', so i can easily remove it again wink

i'll let you know if it works or not.

Re: users online

well, it works:
http://www.dutcholsentwins.com/test.php (gotta hope there are users online if you take a look wink
just got to make it links to the profile pages now.

thank you smile

7

Re: users online

OMG, there they are: the little ones!!!!! smile I like those fotos. Nice layout.

Of course, you can edit things out to suit your needs, say like:
echo $lang_extern[$num_users.' users online'].' ('.$user_name_list.')<br>';

You see what I mean, just work it out. Now it's ugly wink

Marc
PS: glad to help-

Re: users online

heh thank you smile
layout based on the punBB style wink

anyway, yeah, i still have to do loads of things before that site will be ready. I want to make it members only, people need to register etc and i want it to make use of the same userdata as the forums. So later on people who are on the mainpage should be listed in the 'users online' list as well..