去除phpcms会员登录后头部登陆条的会员名称的括号
phpcms会员登录后显示会员名称是带括号的,现在把他修改成不带括号。
找到函数库libs/functions/global.func.php,修改如下即可:
function get_nickname($userid='', $field='') {
$return = '';
if(is_numeric($userid)) {
$member_db = pc_base::load_model('member_model');
$memberinfo = $member_db->get_one(array('userid'=>$userid));
if(!empty($field) && $field != 'nickname' && isset($memberinfo[$field]) &&!empty($memberinfo[$field])) {
$return = $memberinfo[$field];
} else {
$return = isset($memberinfo['nickname']) && !empty($memberinfo['nickname']) ? $memberinfo['nickname'].'('.$memberinfo['username'].')' : $memberinfo['username'];
}
} else {
if (param::get_cookie('_nickname')) {
$return .= '('.param::get_cookie('_nickname').')';
} else {
$return .= '('.param::get_cookie('_username').')';
}
}
return $return;
}
改为
function get_nickname($userid='', $field='') {
$return = '';
if(is_numeric($userid)) {
$member_db = pc_base::load_model('member_model');
$memberinfo = $member_db->get_one(array('userid'=>$userid));
if(!empty($field) && $field != 'nickname' && isset($memberinfo[$field]) &&!empty($memberinfo[$field])) {
$return = $memberinfo[$field];
} else {
$return = isset($memberinfo['nickname']) && !empty($memberinfo['nickname']) ? $memberinfo['nickname'].'('.$memberinfo['username'].')' : $memberinfo['username'];
}
} else {
if (param::get_cookie('_nickname')) {
$return .= param::get_cookie('_nickname');
} else {
$return .= param::get_cookie('_username');
}
}
return $return;
}