ECSHOP留言板添加字段虽然有点繁锁,但也不是很难,操作方法如下(本人已经实现过):
步骤 1. 更改文件message_board.dwt
<tr>
<td align="right">{$lang.message_board_qq}</td>
<td><input name="msg_qq" type="text" class="inputBg" size="20" value=""/></td>
</tr>
<script type="text/javascript">
{foreach from=$lang.message_board_js item=item key=key}
var {$key} = "{$item}";
{/foreach}
{literal}
function submitMsgBoard(frm)
{
var msg = new Object;
msg.user_email = frm.elements['user_email'].value;
msg.msg_qq = frm.elements['msg_qq'].value;
msg.msg_title = frm.elements['msg_title'].value;
msg.msg_content = frm.elements['msg_content'].value;
msg.captcha = frm.elements['captcha'] ? frm.elements['captcha'].value : '';
var msg_err = '';
if (msg.user_email.length > 0)
{
if (!(Utils.isEmail(msg.user_email)))
{
msg_err += msg_error_email + '\n';
}
}
else
{
msg_err += msg_empty_email + '\n';
}
if (msg.msg_title.length == 0)
{
msg_err += msg_title_empty + '\n';
}
if (frm.elements['captcha'] && msg.captcha.length==0)
{
msg_err += msg_captcha_empty + '\n'
}
if (msg.msg_content.length == 0)
{
msg_err += msg_content_empty + '\n'
}
if (msg.msg_qq.length == 0)
{
msg_err += 'QQ不能为空\n';
}
if (msg.msg_title.length > 200)
{
msg_err += msg_title_limit + '\n';
}
if (msg_err.length > 0)
{
alert(msg_err);
return false;
}
else
{
return true;
}
}
{/literal}
</script>
步骤 2. 更改文件message.php
$message = array(
'user_id' => $user_id,
'user_name' => $user_name,
'user_email' => isset($_POST['user_email']) ? htmlspecialchars(trim($_POST['user_email'])) : '',
'msg_qq' => isset($_POST['msg_qq']) ? trim($_POST['msg_qq']) : '',
'msg_type' => isset($_POST['msg_type']) ? intval($_POST['msg_type']) : 0,
'msg_title' => isset($_POST['msg_title']) ? trim($_POST['msg_title']) : '',
'msg_content' => isset($_POST['msg_content']) ? trim($_POST['msg_content']) : '',
'order_id' => 0,
'msg_area' => 1,
'upload' => array()
);
步骤 2. 更改文件lib_clips.php
$message['msg_area'] = isset($message['msg_area']) ? intval($message['msg_area']) : 0;
$sql = "INSERT INTO " . $GLOBALS['ecs']->table('feedback') .
" (msg_id, parent_id, user_id, user_name, user_email,msg_qq, msg_title, msg_type, msg_status, msg_content, msg_time, message_img, order_id, msg_area)".
" VALUES (NULL, 0, '$message[user_id]', '$message[user_name]', '$message[user_email]', ".
" '$message[msg_qq]','$message[msg_title]', '$message[msg_type]', '$status', '$message[msg_content]', '".gmtime()."', '$img_name', '$message[order_id]', '$message[msg_area]')";
$GLOBALS['db']->query($sql);
发表评论:
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
相关文章
ecshop出现Warning: Invalid argument supplied for foreach()错误2019-02-26
Ecshop 分类页产品列表不同分类调用不同产品属性2018-03-08
ECSHOP商品属性调用到任意页面方法2018-03-01
ECSHOP商品列表页显示每个商品的品牌2018-02-28
Ecshop 分类页品牌调用商品数量2018-02-28
ecshop调整默认商品图片排序2018-02-27
ecshop各个页面调用商品销售量方法2016-09-23
ecshop mobile首页循环显示分类及分类下商品2016-09-23
ecshop后台添加虚拟销量以及前台显示销量2016-09-22
ecshop重新导入数据库,管理员和密码正确登录失败2016-09-21