资源描述:
《如何添加ecshop模板导航弹出菜单》由会员上传分享,免费在线阅读,更多相关内容在PPT专区-天天文库。
1、如何添加ecshop模板导航弹出菜单ecshop开发中心在做模板时经常用到的导航弹出菜单效果,如下图,下面我来讲解下具体的安装步骤:一般头部代码都写在库文件page_header.lbi中1.先把php代码复制到文件顶部。
2、ray();$sql="select*from".$GLOBALS['ecs']->table('category')."whereparent_id=".$cid."andis_show=1ORDERBYsort_orderASC,cat_idASC";$res=$GLOBALS['db']->getAll($sql);foreach($resas$idx=>$row){$cat_arr[$idx]['id']=$row['cat_id'];$cat_arr[$idx]['name']=$row['ca
3、t_name'];$cat_arr[$idx]['url']=build_uri('category',array('cid'=>$row['cat_id']),$row['cat_name']);$cat_arr[$idx]['children']=get_clild_list($row['cat_id']);}return$cat_arr;}else{returnfalse;}}functionget_clild_list($pid){$sql_sub="select*from".$GLOBALS['
4、ecs']->table('category')."whereparent_id=".$pid."andis_show=1ORDERBYsort_orderASC,cat_idASC";$subres=$GLOBALS['db']->getAll($sql_sub);if($subres){foreach($subresas$sidx=>$subrow){$children[$sidx]['id']=$subrow['cat_id'];$children[$sidx]['name']=$subrow['c
5、at_name'];$children[$sidx]['url']=build_uri('category',array('cid'=>$subrow['cat_id']),$subrow['cat_name']);}}else{$children=null;}return$children;}//functionget_brands1($url=0,$app='brand'){preg_match("/d+/i",$url,$matches);$cat=$matches[0];$children=($
6、cat>0)?'AND'.get_children($cat):'';$sql="SELECTb.brand_id,b.brand_name,b.brand_logo,b.brand_desc,COUNT(*)ASgoods_num,IF(b.brand_logo>'','1','0')AStag"."FROM".$GLOBALS['ecs']->table('brand')."ASb,".$GLOBALS['ecs']->table('goods')."ASg"."WHEREg.brand_id=b.b
7、rand_id$childrenANDis_show=1"."ANDg.is_on_sale=1ANDg.is_alone_sale=1ANDg.is_delete=0"."GROUPBYb.brand_idHAVINGgoods_num>0ORDERBYtagDESC,b.sort_orderASC";$row=$GLOBALS['db']->getAll($sql);foreach($rowAS$key=>$val){$row[$key]['url']=build_uri($app,array('ci
8、d'=>$cat,'bid'=>$val['brand_id']),$val['brand_name']);$row[$key]['brand_desc']=htmlspecialchars($val['brand_desc'],ENT_QUOTES);}return$row;}//functionget_promotion_info1($goods_id=''){$snatch=array();$group=array();