"http://www.ckplayer.com/down/adv6.1_1.swf", 'ad_time' => 3, //可选参数 ); 文章id广告设置样例 $aid_list['48'] = array( 'ad_url' => "http://www.ckplayer.com/down/adv6.1_1.swf" ); */ //----------配置开始---------- $ad_sys = 1; //广告系统开关,如果为0的话以下所有配置都无效 $turnoff = 0; //是否打开全局广告,0否,1是 $default_ad = 'http://www.ckplayer.com/down/adv6.1_1.swf'; //全局广告打开时有效 $default_ad_time = 5; //播放前广告默认显示时间(秒) //分类广告设置 $ad_list['491'] = array( 'ad_url' => "http://www.ckplayer.com/down/adv6.1_1.swf", 'ad_time' => 30 ); //文章id广告设置 $aid_list['299639'] = array( 'ad_url' => "http://www.ckplayer.com/down/adv6.1_1.swf" ); //----------配置结束---------- $cate_id = !empty($_GET['cateid']) ? intval($_GET['cateid']) : '';//分类id $aid = !empty($_GET['aid']) ? intval($_GET['aid']) : '';//文章id if(!empty($_GET['related'])){ //视频推荐 global $_G; require_once './source/class/class_core.php'; $discuz = C::app(); $discuz->init_cron = false; $discuz->init_session = false; $discuz->init(); $sql = 'pic is not null'; if(!empty(intval($_GET['cateid']))){ $sql .= " and catid = " . intval($_GET['cateid']); }else{ $sql .= " and catid > 8 and catid < 22"; } $atta = C::t('portal_article_title')->fetch_all_by_sql($sql,'order by id desc',0,20); $str = ' 120,90,40,#FFFFFF,#FFCC33,0.8,1,精彩视频推荐:,140,100,25,75,15,10 '; foreach($atta as $a){ $str .='' . $_G['setting']['attachurl'] . $a['pic'] . 'portal.php?mod=view&aid=' . $a['aid'] . '' . $a['title'] . ' '; } $str .=' '; echo $str; exit; } echo "var cate_id = '$cate_id'"; if($ad_sys ==0){ return; } $ad_url = $ad_time = ''; if($turnoff == 1){ $ad_url = $default_ad; $ad_time = $default_ad_time; } if(!empty($ad_list[$cate_id])){ $ad_url = $ad_list[$cate_id]['ad_url']; $ad_time = !empty($ad_list[$cate_id]['ad_time']) ? $ad_list[$cate_id]['ad_time'] : $default_ad_time; } if(!empty($aid_list[$aid])){ $ad_url = $aid_list[$aid]['ad_url']; //最优先显示设置帖子id的广告 $ad_time = !empty($aid_list[$aid]['ad_time']) ? $aid_list[$aid]['ad_time'] : $default_ad_time; } if(!empty($ad_url)){ echo "var ad_url = '$ad_url';"; //输出广告 echo "var ad_time = '$ad_time';"; //输出广告 } ?>