5
I can't think of a reason why it would work on a remote server and not on localhost.
But here's how I would do that:
// Given user ID $uid, get username $uname.
$member_handler =& xoops_gethandler('member');
$user =& $member_handler->getUser($uid);
$uname = $user->getVar('uname');
The file kernel/member.php defines the getUser method, as well as other related methods. For example, getUserList is more efficient if you need to get the usernames of multiple users.
I'm using XOOPS 2.2.4, but this should be applicable to XOOPS 2.x in general.