phpcms根据栏目放置加载不同广告方法分享


复制代码
代码如下:

//加载广告
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]=<<;


你可能感兴趣的:(phpcms根据栏目放置加载不同广告方法分享)