ecshop 注册时邮箱可填可不填,选填
发布:smiling 来源: PHP粉丝网 添加日期:2014-07-19 17:02:54 浏览: 评论:0
注册时,邮箱可选可不选,如果填写了该项,会有邮箱格式验证,是否重复等,不填写则什么都没有.
第1,打开 /themes/default/user_passport.dwt 文件,找到:
id="username_notice" style="color:#FF0000">*
修改为:
id="username_notice" style="color:#FF0000">
第2,打开 /js/user.js文件,找到下面js代码并删除掉.
1).查找 function checkEmail(email),将整个函数替换为:
- function checkEmail(email)
- {
- if (email != '')
- {
- var submit_disabled = false;
- if (!Utils.isEmail(email))
- {
- document.getElementByIdx_x_x_x('email_notice').innerHTML = msg_email_format;
- submit_disabled = true;
- }
- if( submit_disabled )
- {
- document.forms['formUser'].elements['Submit'].disabled = 'disabled';
- return false;
- }
- Ajax.call( 'user.php?act=check_email', 'email=' + email, check_email_callback , 'GET', 'TEXT', true, true );
- }
- }
2).查找一下代码,并删除:
- if (email.length == 0)
- {
- msg += email_empty + ‘\n’;
- }
- else
- {
- if ( ! (Utils.isEmail(email)))
- {
- msg += email_invalid + ‘\n’;
- }
- }
第3.打开/includes/lib_passport.php 文件找到下面的代码:
- if (emptyempty($email))
- {
- $GLOBALS['err']->add($GLOBALS['_LANG']['email_empty']);
- }
- else
- {
- if (!is_email($email))
- {
- $GLOBALS['err']->add(sprintf($GLOBALS['_LANG']['email_invalid'], htmlspecialchars($email)));
- }
- }
- //替换为:
- // 检查email
- if (!emptyempty($email))
- {
- if (!is_email($email))
- {
- $GLOBALS['err']->add(sprintf($GLOBALS['_LANG']['email_invalid'], htmlspecialchars($email)));
- }
- }
4.最后打开includes/modules/integrates/integrate.php 文件,找到:
- $sql = “SELECT ” . $this->field_id .
- ” FROM ” . $this->table($this->user_table).
- ” WHERE ” . $this->field_email . ” = ‘$email’”;
- if ($this->db->getOne($sql, true) > 0)
- {
- $this->error = ERR_EMAIL_EXISTS;
- return false;
- }
- //替换为:
- if(!emptyempty($email)){
- $sql = "SELECT " . $this->field_id .
- " FROM " . $this->table($this->user_table).
- " WHERE " . $this->field_email . " = '$email'";
- if ($this->db->getOne($sql, true) > 0)
- {
- $this->error = ERR_EMAIL_EXISTS;
- return false;
- }
- }
- //即OK。
Tags: ecshop 注册邮箱 可填选项
- 上一篇:ecshop网络环境的搭建
- 下一篇:ecshop在商品详情页添加商品出售数量
相关文章
- ·ECshop在线客服代码添加操作(2013-11-15)
- ·ecshop2.7.0商品分类显示数量(2013-11-15)
- ·Ecshop与jQuery冲突最简单的解决办法! (2013-11-15)
- ·ecshop不同的文章分类使用不同的模板的方法(2013-11-15)
- ·使用.htaccess来实现ecshop 301重定向的方法(伪静态可行)(2013-11-15)
- ·本机安装Ecshop时出现创建管理员帐号失败(2013-11-30)
- ·ecshop分类树显示所有分类的解决方法(2013-12-02)
- ·ecshop后台登录超时session过期的解决办法(2013-12-07)
- ·Ecshop系统添加免运费赠品后购物车变为收取运费解决办法(2014-01-06)
- ·将ecshop相对地址改成绝对地址的方法(2014-01-10)
- ·ECShop——回到顶部(2014-01-10)
- ·ECShop 模板修改(2014-01-10)
- ·Ecshop与jQuery冲突最简单的解决办法(2014-06-13)
- ·ecshop后台登录地址修改(2014-06-14)
- ·ecshop商城回收站的设计(2014-06-14)
- ·ecshop的标题$page_title之seo优化方案(2014-06-14)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)