資源描述:
《如何添加ecshop模板導(dǎo)航彈出菜單》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在PPT專區(qū)-天天文庫。
1、如何添加ecshop模板導(dǎo)航彈出菜單ecshop開發(fā)中心在做模板時經(jīng)常用到的導(dǎo)航彈出菜單效果,如下圖,下面我來講解下具體的安裝步驟:一般頭部代碼都寫在庫文件page_header.lbi中1.先把php代碼復(fù)制到文件頂部。
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();