帝国cms伪静态规则修改 帝国CMS取消会员注册时邮箱必填的方法

帝国CMS教程

帝国cms取消会员注册时邮箱必填的方法

以帝国CMS7.2为例:

打开 /e/member/class/member_registerfun.php 文件

1)找到

  1. if(!chemail($email))
  2. {
  3. printerror('EmailFail','',1);
  4. }

将其删除或者注释掉

2)找到

  1. if($pr['regemailonly'])
  2. {
  3. $num=$empire->gettotal("select count(*) as total from ".eReturnMemberTable()." where ".egetmf('email')."='$email' limit 1");
  4. if($num)
  5. {
  6. printerror('ReEmailFail','',1);
  7. }
  8. }

将其删除或者注释掉

3)找到

  1. if(!$username||!$password||!$email)

修改为

  1. if(!$username||!$password)

到这里,网上随处可以搜索到,但是还没完!

为什么这么说呢?

  • 因为用户可能编辑信息,那时将变成必填。
  • 管理员后台可能修改用户信息,那时也是必填的。

取消会员编辑个人信息时邮箱必填

打开 /e/member/class/member_editinfofun.php

4)找到

  1. //邮箱
  2. $email=trim($add['email']);
  3. if(!$email||!chemail($email))
  4. {
  5. printerror("EmailFail","history.go(-1)",1);
  6. }
  7. $email=RepPostStr($email);

将其删除或者注释掉

5)找到

  1. //邮箱
  2. $pr=$empire->fetch1("select regemailonly from {$dbtbpre}enewspublic limit 1");
  3. if($pr['regemailonly'])
  4. {
  5. $num=$empire->gettotal("select count(*) as total from ".eReturnMemberTable()." where ".egetmf('email')."='$email' and ".egetmf('userid')."<>'$userid' limit 1");
  6. if($num)
  7. {
  8. printerror("ReEmailFail","history.go(-1)",1);
  9. }
  10. }

将其删除或者注释掉。

取消管理员编辑会员信息时邮箱必填

6)找到

  1. if(!trim($add[userid])||!trim($add[email])||!trim($add[username])||!$add[groupid])

改为

  1. if(!trim($add[userid])||!trim($add[username])||!$add[groupid])

7)找到

  1. $add[email]=RepPostStr($add[email]);

将其删除或者注释掉。

8)找到

  1. $email=RepPostStr($add['email']);

将其删除或者注释掉。

9)找到

  1. if($email)
  2. {
  3. $where.=" and ".egetmf('email')." like '%$email%'";
  4. }

将其删除或者注释掉。

至此,才是真正的取消会员邮箱必填的完整方法!