$uid_name = XoopsUser::getUnameFromId($uid, 1);
$uid_name = (empty($uid_name)) ? XoopsUser::getUnameFromId($uid, 0) : $uid_name;
=====替換成=====
$member_handler = xoops_getHandler('member');
$user = $member_handler->getUser($uid);
$uid_name = $user->getVar('user_occ');