Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[发布] 免费的论坛昵称修改

[复制链接]
 楼主| 用户昵称插件 发表于 2014-2-28 18:10:12 | 显示全部楼层
管理员设置的 特定昵称关键词可以高亮显示

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

 楼主| 用户昵称插件 发表于 2014-2-28 18:11:18 | 显示全部楼层
发帖真的是很累,要的 回帖我好吧    修改的 地方详细贴上来  供大家用。
回复

使用道具 举报

 楼主| 用户昵称插件 发表于 2014-3-6 15:52:17 | 显示全部楼层
插 好吧 没人要
回复

使用道具 举报

 楼主| 用户昵称插件 发表于 2014-3-6 16:09:01 | 显示全部楼层
修改的文件总共有:
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

回复

使用道具 举报

 楼主| 用户昵称插件 发表于 2014-3-6 16:19:03 | 显示全部楼层
论坛昵称有保留关键字 可在后台 filed8 自定义字段说明里面设置  以| 分隔

回复

使用道具 举报

ジ正点﹏诸侯 发表于 2014-3-6 19:38:39 | 显示全部楼层
支持3.1?支持求一份是插件么?{:soso_e121:}
回复

使用道具 举报

McVed 发表于 2014-3-7 15:02:32 | 显示全部楼层
挺好的,当年Dz时代的朋友吧?
回复

使用道具 举报

raycat 发表于 2014-3-10 17:58:32 | 显示全部楼层
3.修改的文件:

这些文件全部都要改吗?都改哪里?
回复

使用道具 举报

touchlly 发表于 2014-5-14 09:06:40 | 显示全部楼层
感谢楼主,正在找这个东西。谢谢楼主分享{:soso_e179:}
回复

使用道具 举报

Discuz耀 发表于 2014-6-3 21:22:24 | 显示全部楼层
顶楼主,小弟还有不懂的地方求大哥指点QQ390705604
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-30 13:40 , Processed in 0.148379 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表