复制代码代码如下://加载广告function ad_block($catid){ $adblocks = pc_base::load_config('ad',$catid); if(empty($adblo
复制代码代码如下:
//加载广告
function ad_block($catid){
$adblocks = pc_base::load_config('ad',$catid);
if(empty($adblocks)){
$model = pc_base::load_model("cateGory_model");
$catid = $model->get_one(array('catid'=>$catid));
$adblocks = pc_base::load_config('ad',$catid['parentid']);
if(empty($adblocks) && $catid['parentid'] != 0){
$adblocks = ad_block($catid['parentid']);
}
if(empty($adblocks)||is_array($adblocks)){
$adblocks = pc_base::load_config('ad','other');
}
}
return $adblocks;
}
复制代码代码如下:
$ad = array();
$ad[1234]=<<<EOF
<!-- 广告位:1234-栏目独立广告位 -->;
<script type="text/javascript" >BaiDU_CLB_SLOT_ID = "XXXXX";</script>
<script type="text/javascript" src="<a href="Http://cbjs.baidu.com/js/o.js"></script">http://cbjs.baidu.com/js/o.js"></script</a>>
EOF;
$ad['other']=<<<EOF
<!-- 广告位:0000-默认显示广告位 -->
<script type="text/javascript" >BAIDU_CLB_SLOT_ID = "XXXXX";</script>
<script type="text/javascript" src="<a href="http://cbjs.baidu.com/js/o.js"></script">http://cbjs.baidu.com/js/o.js"></script</a>>
EOF;
return $ad;
--结束END--
本文标题: phpcms根据栏目放置加载不同广告方法分享
本文链接: https://lsjlt.com/news/31773.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0