phpcms根据栏目放置加载不同广告方法分享
phpcms根据栏目放置加载不同广告方法分享
发布时间:2016-12-23 来源:查字典编辑
摘要://加载广告functionad_block($catid){$adblocks=pc_base::load_config('ad',$ca...

//加载广告

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

<>;

<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

<>

<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;

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新phpcms学习
热门phpcms学习
CMS教程子分类