分类归档

网站开发

FWQ
网站开发
ecshop用户中心发送认证邮件加上发送时间限制
ecshop用户中心发送认证邮件加上发送时间限制,打开ECSHOP网站根目录中的user.php文件,搜索如下代码 if (send_regiter_hash($user_id)) { $result['message'] = $_LANG['validate_mail_ok']; die($json->encode($result)); } 将以上的代码修改为如下代码 if (isset($_SESSION['send_email_time'])) { if (gmtime()-$_SESSION['send_email_time'] < 30) { $result['error'] = 1; $result['message'] ='您的操作过于频繁,30秒内请勿重复操作!'; die($json->encode($result)); } } if (send_regiter_hash($user_id))…
2025-04-24 阅读全文 →
FWQ
网站开发
ecshop属性 {$goods.goods_attr|nl2br} 标签的赋值相关
 1、nl2br() 函数在字符串中的每个新行 (\n) 之前插入 HTML 换行符 (<br />)。 2、 如果要向{$goods.goods_attr|nl2br}赋新值,这个值是保存在数据库中的,用户在商品页(goods.php)选择了商品属性(goods.attr)之后,点击"购买"就会进入购物车页面(flow.php),同时,将用户选择的商品属性(goods.attr)保存进了数据库,当进入购物车页面的时候,楼主可以看flow.dwt的代码(<!-- {foreach from=$goods_list item=goods} -->),那么{$goods.goods_attr}这个东西的值来自于flow.php中的$goods_list,查看flow.php,会发现,$goods_list的值来自cart_goods()这个方法,cart_goods()这个方法在includes/lib_order.php内,那里面有一段sql ($sql = "SELECT 。。。, " . "。。。, goods_attr(重点),。。。, " . "。。。 " . "FROM…
2025-04-24 阅读全文 →
FWQ
网站开发
ECSHOP首页调用指定扩展分类商品
因为一些原因需要在网站首页调用扩展分类的商品,找了一天没找到具体方法,所以决定自己动手丰衣足食,现将此方法分享给大家 1.在后台给商品添加扩展分类 2.查看该扩展分类的cat_id   3.includes\lib_goods.php,添加方法 [php] view plaincopy   function index_appoint_goods_list($cat_id = ”, $num = ”)   {       $sql = ‘select g.goods_id, g.cat_id,c.parent_id, g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price, ‘ .              “IFNULL(mp.user_price, g.shop_price * ‘$_SESSION[discount]’) AS shop_price, “.              “promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, goods_img, “ .              “g.is_best, g.is_new, g.is_hot, g.is_promote “ .              ‘FROM ‘ . $GLOBALS[‘ecs’]->table(‘goods’) . ‘ AS g ‘ .              ‘LEFT JOIN ‘ . $GLOBALS[‘ecs’]->table(‘category’) . ‘ AS c ON c.cat_id = g.cat_id ‘ .              ‘LEFT JOIN ‘ . $GLOBALS[‘ecs’]->table(‘member_price’) . ‘ AS mp ON mp.goods_id = g.goods_id AND mp.user_rank = ‘.$_SESSION[user_rank].‘ ‘.              ‘LEFT JOIN ‘ . $GLOBALS[‘ecs’]->table(‘goods_cat’) . ‘ AS gc ON gc.goods_id = g.goods_id ‘.              ‘Where g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0 ‘.       $sql .= ” AND (gc.cat_id = “ . $cat_id .” OR c.parent_id =” . $cat_id. ” OR g.cat_id = “ . $cat_id .” OR g.cat_id “. db_create_in(array_unique(array_merge(array($cat_id), array_keys(cat_list($cat_id, 0, false))))) .“)”;       $sql .= ” LIMIT $num”;          $res = $GLOBALS[‘db’]->getAll($sql);       $goods = array();              foreach ($res AS $idx => $row)       {           $goods[$idx][‘id’] = $row[‘article_id’];  …
2025-04-24 阅读全文 →
FWQ
网站开发
将ECSHOP中的相对地址改为带域名的绝对地址
这里说的绝对地址(或者叫完整地址)是指 查看网页源文件,在源文件中都能看到的带域名的完整URL形式,例如 “<a href=”http://www.xxxxx.com/213423.html “>xxxxx</a>” 修改成绝对地址的好处: 相信很多朋友都喜欢将 带www的域名(www.xxxxx.com)与不带www的域名(xxxxx.com)同时指向到一起。 这样修改以后就可以让搜索引擎第一时间确认 以 www 开头的域名 为首选域, 也不需要再做301重定向了。 修改起来也很简单的 打开 /includes/lib_common.php 文件 将 return $uri; 修改为 return ‘http://www.xxxxx.com/’.$uri; 就可以了
2025-04-24 阅读全文 →
FWQ
网站开发
在ECSHOP文章详情页的标题上加个链接
 怎么给文章内容页面的 标题 加上这篇文章的 URL连接。这样有利于SEO 首先修改 article.php 文件 找到 $row[‘comment_rank’] = ceil($row[‘comment_rank’]); 在它下面增加一行代码 $row[‘thisurl’]=build_uri(‘article’, array(‘aid’=>$article_id), $row[‘title’]); 然后再修改 模板文件 themes/default/article.dwt 将 {$article.title|escape:html} 修改为 <a href=”{$article.thisurl}”>{$article.title|escape:html}</a
2025-04-24 阅读全文 →
FWQ
网站开发
ecshop自动把赠品添加到购物车的开发
 把以下代码加到flow.php文件(165行),$result[‘confirm_type’] = !empty($_CFG[‘cart_confirm’]) ? $_CFG[‘cart_confirm’] : 2;的上面     /* 取得优惠活动 */     $favourable_list = favourable_list($_SESSION[‘user_rank’]);  // 自动把赠品添加到购物车  foreach($favourable_list as $v)  { if(!$v[‘available’]) continue;   /* 取得优惠活动信息 */   $act_id =…
2025-04-24 阅读全文 →
FWQ
网站开发
ecshop Ajax和Smarty fetch的结合
ecshop的ajax无刷新异步获取数据技术十分流行,但是我之前的做法是获取一堆json的数值.然后在前端页面由javascript来解析替换html.这样操作比较繁琐。   在开发ecshop的过程中,发现ecshop的无刷新加载,对于返回来的json值没有作解析。而是直接用innerHTML替换 /admin/js/listtable.js document.getElementById(‘listDiv’).innerHTML = result.content;   这是由于在服务端,即php文件里已经把数据组合成可以直接显示的html了。 这个是用smarty->fetch函数实现。fetch函数和display不同之处,fetch只赋值,不显示。 $order_list = order_list(); $smarty->assign('order_list', $order_list['orders']); $smarty->assign('filter', $order_list['filter']); $smarty->assign('record_count', $order_list['record_count']); $smarty->assign('page_count', $order_list['page_count']); $sort_flag = sort_flag($order_list['filter']); $smarty->assign($sort_flag['tag'], $sort_flag['img']); make_json_result($smarty->fetch('order_list.htm'), '', array('filter' =>…
2025-04-24 阅读全文 →
FWQ
网站开发
ecshop调用指定栏目下的商品的方法
ecshop调用指定栏目下的商品,第一步 在ecshop系统目录文件找到includes/lib_goods.php  这个文件打开 在此页最底部加入以下函数代码 /** * 首页获取指定分类产品 * * @access public * @param string $cat_id53_best_goods * @param array $cat_id53_best_goods * @return array */ function index_get_cat_id_goods_best_list($cat_id = '', $num…
2025-04-24 阅读全文 →
FWQ
网站开发
去掉ECSHOP商品评论的30秒时间限制
如果商品评论或留言 没有启用验证码的话,ECSHOP默认有30秒的限制,也就是两次评论之间需要间隔30秒。 有的店长建站之初,自己总会想预发一些评论来填充网站。 下面这个教程教你如何解除这个限制: 1)打开comment.php 文件 找到 if (($cur_time – $_SESSION[‘send_time’]) < 30) 修改为 if (($cur_time – $_SESSION[‘send_time’]) < -1) 2)打开 message.php  文件 找到 if (($cur_time – $_SESSION[‘send_time’])…
2025-04-24 阅读全文 →