ecshop首页文章搜索框功能增加方法
2016-06-13 13:05 来源:www.chinab4c.com 作者:ecshop专家
ecshop首页增加文章搜索框功能方法: 怎么样让ecshop商城首页有商品搜索框,同时又可以搜索文章? 1.首页lbi库文件需要显示地方: 增加:
2.在inculudes/lib_article.php 中 找出下列语句,并修改。【约42行】 //增加搜索条件,如果有搜索内容就进行搜索 if ($requirement != '') { $sql = 'SELECT article_id, title, author, add_time, file_url, open_type' . ' FROM ' .$GLOBALS['ecs']->table('article') . ' WHERE is_open = 1 AND ' . $cat_str . ' AND title like \'%' . $requirement . '%\' .//本行为要修改语句 Edited by Lingfeng ' ORDER BY article_type DESC, article_id DESC'; } 所修改句子为: --------------------------------------------------------------------------------------------------------------------------------------------------------------------- ' WHERE is_open = 1 AND ' . $cat_str . ' AND (title like \'%' . $requirement . '%\' or content like \'%' . $requirement . '%\' )' . --------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.再找出: function get_article_count($cat_id ,$requirement='') { global $db, $ecs; if ($requirement != '') { $count = $db->getOne('SELECT COUNT(*) FROM ' . $ecs->table('article') . ' WHERE ' . get_article_children($cat_id) . ' AND title like \'%' . $requirement . '%\' and is_open = 1'); } 所修改后句子为: --------------------------------------------------------------------------------------------------------------------------------------------------------------------- $count = $db->getOne('SELECT COUNT(*) FROM ' . $ecs->table('article') . ' WHERE ' . get_article_children($cat_id) . ' AND ( title like \'%' . $requirement . '%\' or content like \'%' . $requirement . '%\') AND is_open = 1'); ------------------------------------------------------------------- 这样以后首页就可以搜索文章了哦
最近更新
常用插件
- ecshop按分类筛选销售排行
ecshop按分类筛选销售排行...
- ecshop快递发货单打印商品
ecshop快递发货单打印商品信息,大家都知道ecshop快递单打印的时候,只能...
- ecshop选择下单时间插件
ecshop选择下单时间插件主要是根据不同的下单配送要求,在ecshop购物车...
- ecshop二次开发售后维修卡
插件介绍: 本插件是用于专门从事电子,信息,软件等售后服务关键比...
- ecshop供应商插件免费下载
ecshop供应商插件免费下载...
ecshop热门问答
ecshop热门资料
手机模板
ecshop推荐品牌怎么设置
ecshop不能自动发货
ecshopcant
ecshop新天
ecshop美金
ecshop频道
ecshop右键
ecshopFlash轮播图片样式
ecshop商品批量修改
ecshop空行代码
ecshop346
ecshopEcshop
ecshop退订
ecshop多相册插件
ecshop幽灵
ecshop展开
ecshopblock
nginx代理
ecshop窗户
ecshop生活
ecshop内衣
ecshop市场价格
ecshop求助贴
ecshop积分兑换
ecshop攻略
ecshop网页抽奖程序
ecshop细化
ecshop物件
ecshop运费