修改的文件总共有:
1.回帖通知:
/source/class/helper/helper_notification.php
$notevars['actor'] = "<a href=\"home.php?mod=space&uid=$_G[uid]\">".getuserprofile('field8')."</a>";
30行
2.添加昵称过滤:
/source/include/spacecp/spacecp_profile.php
133-159
// 去重 和 非管理员禁词 chenyonghui
if ($key == 'field8' && ! empty ( $value )) {
//过滤特殊字符
if (!preg_match ( "/[^0-9a-zA-Z一-龥]/u", $value )) {
$value = addslashes ( $value );
$str_nicname = DB::result_first ( "SELECT field8 FROM " . DB::table ( 'common_member_profile' ) . " WHERE uid={$_G['uid']}" );
if ($str_nicname != $value) {
$str_check = DB::result_first ( "SELECT field8 FROM " . DB::table ( 'common_member_profile' ) . " WHERE field8='{$value}'" );
if ($str_check) {
profile_showerror ( $key, '该昵称已被注册,您不能再设置!' );
}
// 非管理员检查
$id_group = DB::result_first ( "SELECT groupid FROM " . DB::table ( 'common_member' ) . " WHERE uid={$_G['uid']}" );
if ($id_group > 3) {
$str_check = DB::result_first ( "SELECT description FROM " . DB::table ( 'common_member_profile_setting' ) . " WHERE fieldid='field8'" );
$check_tag = 0;
foreach ( explode ( '|', $str_check ) as $v ) {
if (strpos ( $value, $v ) !== FALSE) {
profile_showerror ( $key, '该昵称已被注册,您不能再设置!' . $v );
}
}
}
}
} else {
profile_showerror ( $key, '不能包含特殊字符和空格' );
}
}
//end
169
elseif($key=='field8'){
$extrainfo = '用户昵不能超过10个汉字,30个字符长度!';
}
profile_showerror($key,$extrainfo);
3.修改的文件:
/template/default/forum/viewthread_node.htm
/source/include/spacecp/spacecp_profile.php
/template/default/home/spacecp_profile.htm
/source/module/home/home_space.php
/template/ppgame/common/header.htm
/source/function/function_space.php
/source/include/space/space_index.php
/source/include/space/space_thread.php
/template/default/home/space_card.htm 名片模板
/template/default/home/space_menu.htm
/template/default/home/space_userabout.htm
/source/function/function_forumlist.php
156行
$moderator2 = $moderator;
//start chenyonghui 版主
if(!empty($moderator)){
$lastposter = addslashes($moderator);
$lastpostid = DB::result_first("SELECT uid FROM ".DB::table('common_member')." WHERE username='$lastposter'");
if(!empty($lastpostid)){
$threadlastposter = DB::result_first("SELECT field8 FROM ".DB::table('common_member_profile')." WHERE uid=$lastpostid");
if(!empty($threadlastposter)){$moderator2 = $threadlastposter;}
}
}
//end
/source/module/forum/forum_index.php
166
//start chenyonghui 版主
if(!empty($category['moderators'])){
$lastposter = addslashes($category['moderators']);
$lastpostid = DB::result_first("SELECT uid FROM ".DB::table('common_member')." WHERE username='$lastposter'");
if(!empty($lastpostid)){
$threadlastposter = DB::result_first("SELECT field8 FROM ".DB::table('common_member_profile')." WHERE uid=$lastpostid");
if(!empty($threadlastposter)){$catlist[$catid]['moderators'] = $threadlastposter;}
}
}
//end
/source/module/forum/forum_viewthread.php
1098
//chenyonghui start
$viewauthor = DB::result_first("SELECT field8 FROM ".DB::table('common_member_profile')." WHERE uid=$lastlog[uid]");
if(!empty($viewauthor)){
$lastlog['username'] = $viewauthor;
}
//end
|