帝国CMS取消注册邮箱必填的教程
2018-03-26 站长 站长日志
帝国CMS会员注册的时候,邮箱是必填项,但有时候,我们希望注册时不需要填写邮箱,但帝国CMS并没有给这样一个可以关闭的设置项。
通过本教程就可以实现取消邮箱必填。
以帝国CMS7.2为例:
打开 /e/member/class/member_registerfun.php 文件
1、查找:
1 2 3 4 |
if (!chemail( $email ))
{
printerror( 'EmailFail' , '' ,1);
}
|
删除或者注释掉
2、继续查找:
1 2 3 4 5 6 7 8 |
if ( $pr [ 'regemailonly' ])
{
$num = $empire ->gettotal( "select count(*) as total from " .eReturnMemberTable(). " where " .egetmf( 'email' ). "='$email' limit 1" );
if ( $num )
{
printerror( 'ReEmailFail' , '' ,1);
}
}
|
删除或者注释
3、继续查找:
1 |
if (! $username ||! $password ||! $email )
|
修改为:
1 |
if (! $username ||! $password )
|
也就是去掉了email
至此,搞定了!
如果你不想修改源文件,也可以查看另一种用JS隐藏的方法: