Welcome to Geeklog, Anonymous Sunday, May 17 2026 @ 02:50 pm EDT
Geeklog Forums
Real name instead of nickname
Status: offline
roberto
Forum User
Chatty
Registered: 12/01/03
Posts: 43
I have replaced the nickname with the real name in the title it of
articles, but it is possible to replace the nickname with the real name
also in the welcome message and in "Who's Online" box and "What's Related" information?
Tnx
Rob
articles, but it is possible to replace the nickname with the real name
also in the welcome message and in "Who's Online" box and "What's Related" information?
Tnx
Rob
19
17
Quote
Status: offline
Turias
Forum User
Full Member
Registered: 10/20/03
Posts: 807
welcome_msg:
In lib-common.php, change
{
$msg .= ', ' . $_USER['username'];
}
to
{
$msg .= ', ' . $_USER['fullname'];
}
else if( !empty( $_USER['username'] ))
{
$msg .= ', ' . $_USER['username'];
}
In lib-common.php, change
Text Formatted Code
if( !empty( $_USER['username'] )){
$msg .= ', ' . $_USER['username'];
}
to
Text Formatted Code
if( !empty( $_USER['fullname'] )){
$msg .= ', ' . $_USER['fullname'];
}
else if( !empty( $_USER['username'] ))
{
$msg .= ', ' . $_USER['username'];
}
18
21
Quote
Status: offline
Turias
Forum User
Full Member
Registered: 10/20/03
Posts: 807
Who's online (put this in lib-custom and make a new block using it):
{
global $_CONF,$_TABLES,$LANG01;
$expire_time = time() - $_CONF['whosonline_threshold'];
$result = DB_query( "SELECT DISTINCT {$_TABLES['sessions']}.uid, username,photo,showonline,fullname FROM {$_TABLES['sessions']},{$_TABLES['users']},{$_TABLES['userprefs']} WHERE {$_TABLES['users']}.uid = {$_TABLES['sessions']}.uid AND {$_TABLES['users']}.uid = {$_TABLES['userprefs']}.uid AND start_time >= $expire_time AND {$_TABLES['sessions']}.uid <> 1 ORDER BY username" );
$nrows = DB_numRows( $result );
$num_anon = 0;
for( $i = 1; $i <= $nrows; $i++ )
{
$A = DB_fetchArray( $result );
if( $A['showonline'] == 1 ) {
$retval .= '<a href="' . $_CONF['site_url']
. '/users.php?mode=profile&uid=' . $A['uid'] . '">';
if (!empty($A['fullname']))
{
$retval .= $A['fullname'];
}
else
{
$retval .= $A['username'];
}
$retval .= '</a>';
if( !empty( $A['photo'] ) AND $_CONF['allow_user_photo'] == 1)
{
$retval .= ' <a href="' . $_CONF['site_url']
. '/users.php?mode=profile&uid=' . $A['uid']
. '"><img src="' . $_CONF['layout_url']
. '/images/smallcamera.gif" border="0" alt=""></a>';
}
$retval .= '<br>';
} else {
// this user does not want to show up in Who's Online
$num_anon++; // count as anonymous
}
}
$result = DB_query( "SELECT DISTINCT uid,remote_ip FROM {$_TABLES['sessions']} WHERE uid = 1" );
$num_anon += DB_numRows( $result );
if( $num_anon > 0 )
{
$retval .= $LANG01[41] . ': ' . $num_anon . '<br>';
}
return $retval;
}
Text Formatted Code
function phpblock_whosonline_fullname(){
global $_CONF,$_TABLES,$LANG01;
$expire_time = time() - $_CONF['whosonline_threshold'];
$result = DB_query( "SELECT DISTINCT {$_TABLES['sessions']}.uid, username,photo,showonline,fullname FROM {$_TABLES['sessions']},{$_TABLES['users']},{$_TABLES['userprefs']} WHERE {$_TABLES['users']}.uid = {$_TABLES['sessions']}.uid AND {$_TABLES['users']}.uid = {$_TABLES['userprefs']}.uid AND start_time >= $expire_time AND {$_TABLES['sessions']}.uid <> 1 ORDER BY username" );
$nrows = DB_numRows( $result );
$num_anon = 0;
for( $i = 1; $i <= $nrows; $i++ )
{
$A = DB_fetchArray( $result );
if( $A['showonline'] == 1 ) {
$retval .= '<a href="' . $_CONF['site_url']
. '/users.php?mode=profile&uid=' . $A['uid'] . '">';
if (!empty($A['fullname']))
{
$retval .= $A['fullname'];
}
else
{
$retval .= $A['username'];
}
$retval .= '</a>';
if( !empty( $A['photo'] ) AND $_CONF['allow_user_photo'] == 1)
{
$retval .= ' <a href="' . $_CONF['site_url']
. '/users.php?mode=profile&uid=' . $A['uid']
. '"><img src="' . $_CONF['layout_url']
. '/images/smallcamera.gif" border="0" alt=""></a>';
}
$retval .= '<br>';
} else {
// this user does not want to show up in Who's Online
$num_anon++; // count as anonymous
}
}
$result = DB_query( "SELECT DISTINCT uid,remote_ip FROM {$_TABLES['sessions']} WHERE uid = 1" );
$num_anon += DB_numRows( $result );
if( $num_anon > 0 )
{
$retval .= $LANG01[41] . ': ' . $num_anon . '<br>';
}
return $retval;
}
16
20
Quote
Status: offline
roberto
Forum User
Chatty
Registered: 12/01/03
Posts: 43
Hi Turias,
tnx for help!
no problem with the firs code, but with second code display the error "the php function not exist" in the box of block.
I have followed these steps:
1 - copy your code
2 - edit system/lib-custom.php
3 - paste your code at end of file, before ?>
4 - create new php block
the name of function in lib-custom (with "()") and the name in the block admin (without "()") is equal
Where mistake?
tnx and sorry for my english
rob
tnx for help!
no problem with the firs code, but with second code display the error "the php function not exist" in the box of block.
I have followed these steps:
1 - copy your code
2 - edit system/lib-custom.php
3 - paste your code at end of file, before ?>
4 - create new php block
the name of function in lib-custom (with "()") and the name in the block admin (without "()") is equal
Where mistake?
tnx and sorry for my english
rob
17
19
Quote
Status: offline
roberto
Forum User
Chatty
Registered: 12/01/03
Posts: 43
Hi Turias
This error, in the block box: " Error in PHP Block. Function, phpblock_wosonline_fullname, does not exist."
yes
Tnx, rob
Quote by Turias: Hmmm. I didn't actually test it (and don't have time right now). What is the exact error you got?
This error, in the block box: " Error in PHP Block. Function, phpblock_wosonline_fullname, does not exist."
And are you sure you set the block to a "phpblock" with function "phpblock_whosonline_fullname"?
yes
Tnx, rob
22
23
Quote
All times are EDT. The time is now 02:50 pm.
- 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
