本帖最后由 tx1159 于 2010-11-30 15:50 编辑
现在希望认证后的用户在全站显示用户名,而不是真实姓名。请高手帮忙!!!看了好几天,都没有看明白,现在觉得这段代码应该是关键点。
请求高手怎么改代码。
function_common.php 文件的下代码:
----------------------------------------------------------
//获取用户名
function realname_set($uid, $username, $name='', $namestatus=0) {
global $_SGLOBAL, $_SN, $_SCONFIG;
if($name) {
$_SN[$uid] = ($_SCONFIG['realname'] && $namestatus)?$nameusername;
} elseif(empty($_SN[$uid])) {
$_SN[$uid] = $username;
$_SGLOBAL['select_realname'][$uid] = $uid;//需要检索
}
}
//获取实名
function realname_get() {
global $_SGLOBAL, $_SCONFIG, $_SN, $space;
if(empty($_SGLOBAL['_realname_get']) && $_SCONFIG['realname'] && $_SGLOBAL['select_realname']) {
//禁止重复调用
$_SGLOBAL['_realname_get'] = 1;
//已经有的
if($space && isset($_SGLOBAL['select_realname'][$space['uid']])) {
unset($_SGLOBAL['select_realname'][$space['uid']]);
}
if($_SGLOBAL['member']['uid'] && isset($_SGLOBAL['select_realname'][$_SGLOBAL['member']['uid']])) {
unset($_SGLOBAL['select_realname'][$_SGLOBAL['member']['uid']]);
}
//获得实名
$uids = empty($_SGLOBAL['select_realname'])?array():array_keys($_SGLOBAL['select_realname']);
if($uids) {
$query = $_SGLOBAL['db']->query("SELECT uid, name, namestatus FROM ".tname('space')." WHERE uid IN (".simplode($uids).")");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if($value['name'] && $value['namestatus']) {
$_SN[$value['uid']] = $value['name'];
}
}
}
}
}
怎样改才能让认证后的用户在全站所有操作全部显示用户名!!!!真情请求帮助!!
|