新聞中心
disncuzX3.2關閉注冊郵箱必填選項
作者 / 無憂主機 時間 2014-10-20 12:18:59
大家好,今天無憂小編(m.love62.cn)和大家又見面了,最近有看到有站長想去掉discuz注冊時候的郵箱必填選項,在無憂主機購買php虛擬主機時,注冊用戶郵箱也是必填項哦。本來這個在x3.0 和 x3.1 版本時後臺可以設置的,但 x3.2 版本後臺又取消這個功能設置了。 不過既然有需求恢復這個功能,那么無憂小編(m.love62.cn)就把教程貼出來給大家: 1、第一步 source/admincp/admincp_setting.php 文件 查找
showsetting('setting_access_register_send_register_url', 'settingnew[sendregisterurl]', $setting['sendregisterurl'], 'radio');在這個代碼下添加:
showsetting('setting_access_register_forge_email', 'settingnew[forgeemail]', $setting['forgeemail'], 'radio');2、第二步 打開 source/language/lang_admincp.php 文件 查找: 個郵箱只允許註冊一個帳戶<br/>注意:只有在<a href="?action=setting&operation=mail">站長 - 郵件設置</a>中完成郵件設置,確保郵件能發(fā)送成功下可以開啟該功能 ', 或者(看是簡體還是繁體): 一個郵箱只允許注冊一個帳戶<br/>注意:只有在<a href="?action=setting&operation=mail">站長 - 郵件設置</a>中完成郵件設置,確保郵件能發(fā)送成功下可以開啟該功能 在下面添加:
'setting_access_register_forge_email' => '取消注冊郵箱必填', 'setting_access_register_forge_email_comment' => '開啟后如果用不不填寫注冊郵箱,將自動生成一個郵箱地址',或者:
'setting_access_register_forge_email' => '取消註冊郵箱必填', 'setting_access_register_forge_email_comment' => '開啟後如果用戶不填寫註冊郵箱,將自動生成一個隨機郵箱地址',3、第三步: 修改
source/class/class_member.php 文件 $email = strtolower(trim($_GET['email'])); if(empty($this->setting['ignorepassword'])) { if($_GET['password'] !== $_GET['password2']) { showmessage('profile_passwd_notmatch'); } if(!$_GET['password'] || $_GET['password'] != addslashes($_GET['password'])) { showmessage('profile_passwd_illegal'); } $password = $_GET['password']; } else { $password = md5(random(10)); } }修改為:
$email = strtolower(trim($_GET['email'])); if(empty($email) && $_G['setting']['forgeemail']) { $_GET['email'] = $email = strtolower(random(6)).'@'.$_SERVER['HTTP_HOST']; } if(empty($this->setting['ignorepassword'])) { if($_GET['password'] !== $_GET['password2']) { showmessage('profile_passwd_notmatch'); } if(!$_GET['password'] || $_GET['password'] != addslashes($_GET['password'])) { showmessage('profile_passwd_illegal'); } $password = $_GET['password']; } else { $password = md5(random(10)); } }這樣修改后,后臺就會出現(xiàn)一個注冊郵箱取消的功能。然后設置取消后,前臺也會相應的變化了。 無憂主機相關文章推薦閱讀: 快速去除整站程序文件編碼中的BOM方法 解決DISCUZ“UC通信成功但通知失敗”問題 DISCUZX3.2提示“DIY模板目錄不正確“的一個解決方法 DISCUZX論壇中DIY頁面對HTML的代碼長度限制造成DIY頁面錯位
本文地址:http://m.love62.cn/discuz/17147.html