Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 07:59 am EDT

Geeklog Forums

Whose Online


nctek

Anonymous
For those of you who want to show the full name of the person under the 'whose online' block, here are some changes that I made. If the user does not have a full name, then their userID will show up. Feel free to use it. If you want to see it in action, go to nctek.net

I'm not too sure how many people will be on there, but hey, take your chances.function phpblock_whosonline()
{
global $_CONF,$_TABLES,$LANG01;

$expire_time = time() - $_CONF['whosonline_threshold'];

$result = DB_query( "SELECT DISTINCT {$_TABLES['sessions']}.uid, fullname,username, photo FROM {$_TABLES['sessions']},{$_TABLES['users']} WHERE {$_TABLES['users']}.uid = {$_TABLES['sessions']}.uid AND start_time >= $expire_time AND {$_TABLES['sessions']}.uid 1 ORDER BY fullname" );
$nrows = DB_numRows( $result );

for( $i = 1; $i
{
$A = DB_fetchArray( $result );

if (!empty ( $A['fullname'] ))
{
$retval .= '<a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '">' . $A['fullname'] . '</a>';
}
else
{
$retval .= '<a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '">' . $A['username'] . '</a>';
}


if( !empty( $A['photo'] ) AND $_CONF['allow_user_photo'] == 1)
{
$retval .= ' <a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '">
</a>';
}

$retval .= '<br>';
}

$num_anon = DB_query( "SELECT DISTINCT uid,remote_ip FROM {$_TABLES['sessions']} WHERE uid = 1" );
$num_anon = DB_numRows( $num_anon );

if( $num_anon > 0 )
{
$retval .= 'Guests: ' . $num_anon . '<br>';
}

return $retval;
}
 Quote

Status: offline

bcbrock

Forum User
Chatty
Registered: 02/04/03
Posts: 64
Your timing on this couldn't have been any better for me. Just yesterday morning, one of my users made the comment that he was having a hard time telling who was who because of all the different usernames people had chosen. Now, he can tell at a glance who is really online. Any change you might be willing to come up with a way that a users full name appear on articles they submit instead of their username??? :-) Thanks! ~Brian
~Brian
 Quote

Anonymous

Anonymous
Don't you think if people wanted to be known by their real names they would use this as their username? You may end up pissing off a lot of people if you just switch to posting their names without asking for feedback.
 Quote

Status: offline

bcbrock

Forum User
Chatty
Registered: 02/04/03
Posts: 64
I think that's a perfectly valid point, especially for site open to the general public. In my case, the site I have is a family web site, so everybody knows everybody else anyway. Smile
~Brian
 Quote

Nick

Anonymous
is there a way to show the users photo in the whosonline block next to their username?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
That shouldn't be too hard to do. The code for the block already pulls the name of the user's photo from the database (so that it knows whether to display the little camera icon or not). You would only need to replace that with the proper URL to the real photo - and possibly rearrange things a bit ...

The function is phpblock_whosonline in lib-common.php

bye, Dirk
 Quote

Nick

Anonymous
ok. I see that section of the block in lib-common.php. but i'm not sure how to edit it. Any suggestions?

IF you could paste the code that would be helpful.
 Quote

John Billings aka desierto

Anonymous
In one sense all you have to do is click on the username to find out more details about the author of the post, or whose online, right?

But I also thought it would be nice to see the authors full name under posts.

I believe yabb allows the user, upon registration or in edit profile, to select whether or not to display username or full name.
 Quote

All times are EDT. The time is now 07:59 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content