1、\source\function\function_core.php 增加一个方法
//根据username显示真实姓名
function getrealname($username)
{
$uid = C::t('common_member')->fetch_uid_by_username($username);
static $nickname_users = array();
if (empty($nickname_users[$uid])) {
$nickname_users[$uid] = C::t('common_member_profile' . ($fetch_archive === 2 ? '_archive' : ''))->fetch($uid);
if ($fetch_archive === 1 && empty($nickname_users[$uid])) {
$nickname_users[$uid] = C::t('common_member_archive')->fetch($uid);
}
}
if (!isset($nickname_users[$uid]['self']) && $uid == getglobal('uid') && getglobal('uid')) {
$nickname_users[$uid]['self'] = 1;
}
return $nickname_users[$uid];
}
2、\source\function\function_forumlist.php第152行位置(版主)
function moddisplay($moderators, $type, $inherit = 0) {
if($moderators) {
$modlist = $comma = '';
foreach(explode("\t", $moderators) as $moderator) {
$moderatorrealname=getrealname($moderator)['realname'];
$modlist .= $comma.'<a href="home.php?mod=space&username='.rawurlencode($moderator).'" class="notabs" c="1">'.($inherit ? ''.$moderatorrealname.'' : $moderatorrealname).'';
$comma = ', ';
}
} else {
$modlist = '';
}
return $modlist;
}
当前剩余积分:0
点击数字可修改