#92 function xoops_getLinkedUnameFromId

XOOPS_2.2
closed
Jan Pedersen
5
2012-09-25
2005-03-14
Herve Thouzard
No

Hello,

The function getUnameFromId can return the full user's
name with its last parameter. Is it possible to do the
same with the function xoops_getLinkedUnameFromId

Replace its content from :
function xoops_getLinkedUnameFromId($userid)
{
$userid = intval($userid);
if ($userid > 0) {
$member_handler =& xoops_gethandler('member');
$user =& $member_handler->getUser($userid);
if (is_object($user)) {
$linkeduser = ''.
$user->getVar('uname').'
';
return $linkeduser;
}
}
return $GLOBALS['xoopsConfig']['anonymous'];
}

To :

function xoops_getLinkedUnameFromId($userid, $usereal = 0 )
{
$userid = intval($userid);
if ($userid > 0) {
$member_handler =& xoops_gethandler('member');
$user =& $member_handler->getUser($userid);
if (is_object($user)) {
$linkeduser = ''.
$user->getVar('uname').'
';
if ( $usereal ) {
if(xoops_trim($user->getVar('name'))!='') {
$linkeduser = ''.
$user->getVar('name').'
';
}
}
return $linkeduser;
}
}
return $GLOBALS['xoopsConfig']['anonymous'];
}

Bye,
Hervé

Discussion

  • Jan Pedersen
    Jan Pedersen
    2005-04-08

    Logged In: YES
    user_id=841117

    Fixed in CVS and waiting for review before merging to the trunk.

     
  • Herve Thouzard
    Herve Thouzard
    2005-04-08

    Logged In: YES
    user_id=976995

    thank you