Posted on: 05/21/03 04:26am
By: Anonymous (nctek)
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="' . &#36;_CONF['site_url'] . '/users.php?mode=profile&amp;uid=' . &#36;A['uid'] . '">' . $A['fullname'] . '</a>';
}
else
{
$retval .= '<a href="' . &#36;_CONF['site_url'] . '/users.php?mode=profile&amp;uid=' . &#36;A['uid'] . '">' . $A['username'] . '</a>';
}
if( !empty( $A['photo'] ) AND $_CONF['allow_user_photo'] == 1)
{
$retval .= ' <a href="' . &#36;_CONF['site_url'] . '/users.php?mode=profile&amp;uid=' . &#36;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;
}
Whose Online
Posted on: 05/22/03 12:40pm
By: bcbrock
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
Whose Online
Posted on: 05/22/03 01:00pm
By: 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.
Whose Online
Posted on: 05/25/03 10:15pm
By: bcbrock
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.
Whose Online
Posted on: 02/27/04 10:17am
By: Anonymous (Nick)
is there a way to show the users photo in the whosonline block next to their username?
Whose Online
Posted on: 02/27/04 02:02pm
By: Dirk
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
Whose Online
Posted on: 02/27/04 05:37pm
By: Anonymous (Nick)
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.
Whose Online
Posted on: 03/09/04 09:44am
By: Anonymous (John Billings aka desierto)
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.