ecshop教程

ECSHOP首页FLASH播放器广告显示调用到其他页面

ecshop教程 51源码 2022-12-02 人阅读

我想在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 -->

版权声明:文章搜集于网络,如有侵权请联系本站,转载请说明出处:https://www.51yma.cn/jiaocheng/ecshop/922.html
文章来源: