大家好
今天有看到有站長想去掉註冊時郵箱必填
x3.0 和 x3.1 版本時後台可以設置的
但 x3.2 版本後台又取消這個功能設置了
剛才有空時整理了一下
分享給有需要的站長們
另外樓主樓層第二頁
提供簡體版本方便其他站長閱讀^^
打開
source/admincp/admincp_setting.php 文件
查找
Code:
showsetting('setting_access_register_send_register_url', 'settingnew[sendregisterurl]', $setting['sendregisterurl'], 'radio');
在這段代碼下方添加
Code:
showsetting('setting_access_register_forge_email', 'settingnew[forgeemail]', $setting['forgeemail'], 'radio');
再打開
source/language/lang_admincp.php 文件
查找
Code:
個郵箱只允許註冊一個帳戶<br/>注意:只有在<a href="?action=setting&operation=mail">站長 - 郵件設置</a>中完成郵件設置,確保郵件能發送成功下可以開啟該功能 ',
在這段代碼下方添加
Code:
'setting_access_register_forge_email' => '取消註冊郵箱必填',
'setting_access_register_forge_email_comment' => '開啟後如果用戶不填寫註冊郵箱,將自動生成一個隨機郵箱地址',
再打開
source/class/class_member.php 文件
查找
Code:
$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));
}
}
替換為
Code:
$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));
}
}