ECSHOP其他页面调用首页的FLASH主广告

首先修改 /category.php 文件



找到


$smarty->assign('script_name', 'category');


在它下面增加代码


$smarty->assign('flash_theme',     $_CFG['flash_theme']);  // Flash轮播图片模板


 /* 首页主广告设置 */


    $smarty->assign('index_ad',     $_CFG['index_ad']);


    if ($_CFG['index_ad'] == 'cus')


    {


        $sql = 'SELECT ad_type, content, url FROM ' . $ecs->table("ad_custom") . ' WHERE ad_status = 1';


        $ad = $db->getRow($sql, true);


        $smarty->assign('ad', $ad);


    }



然后 再修改 模板文件 /themes/default/category.dwt  (这里以官方默认模板为例)



在你想显示 FLASH主广告的地方加入下面代码


<!-- #BeginLibraryItem "/library/index_ad.lbi" --><!-- #EndLibraryItem -->

posted on 2012-12-09 13:43  ECshop商城二次开发博客  阅读(342)  评论(0编辑  收藏  举报

导航