ecshop注册时添加生日字段

如何在ecshop注册的时候,新增生日字段,具体步骤如下:

第一步:修改includes/lib_passport.php

找到:function register($username, $password, $email, $other = array())

替换:function register($username, $password, $email, $other = array(), $birthday)

第二步:修改根目录的 user.php

找到:include_once(ROOT_PATH . ‘includes/lib_passport.php’);

下面增加:$birthday = trim($_POST[‘birthdayYear’]) .’-‘. trim($_POST[‘birthdayMonth’]) .’-‘. trim($_POST[‘birthdayDay’]);

找到:/* 写入密码提示问题和答案 */ if (!empty($passwd_answer) && !empty($sel_question))

上面增加:$sql = ‘UPDATE ‘ . $ecs->table(‘users’) . " SET `birthday`=’$birthday’ WHERE `user_id`=’" . $_SESSION[‘user_id’] . "’"; $db->query($sql);

找到:if (register($username, $password, $email, $other) !== false)

替换:if (register($username, $password, $email, $other,$birthday) !== false)

第三步:修改ecshop模板中注册文件 themes/yourstemplatename/user_passport.dwt,如果是默认模板,则是themes/default /user_passport.dwt

找到这段代码: <tr> <td align="right">{$lang.label_confirm_password}</td> <td> <input name="confirm_password" type="password"id="conform_password" class="inputBg" style="width:179px;"/> <span style="color:#FF0000" id="conform_password_notice"> *</span> </td> </tr>

在其之后,插入代码 <tr> <td width="28%" align="right" bgcolor="#FFFFFF">{$lang.birthday}: </td> <td width="72%" align="left" bgcolor="#FFFFFF"> {html_select_date field_order=YMD prefix=birthday start_year=-60 end_year=+1 display_days=true month_format=%m day_value_format=%02d time=this.birthday} </td> </tr>

,到尽头,也许快乐,或有时孤独,如果心在远方,

ecshop注册时添加生日字段

相关文章:

你感兴趣的文章:

标签云: