Пример #1
0
 /**
  * 异步调用广告
  *
  */
 public function get_adv_listOp()
 {
     $ap_ids = $_GET['ap_ids'];
     $list = array();
     if (!empty($ap_ids) && is_array($ap_ids)) {
         uk86_import('function.adv');
         foreach ($ap_ids as $key => $value) {
             $ap_id = intval($value);
             //广告位编号
             $adv_info = uk86_advshow($ap_id, 'array');
             if (!empty($adv_info) && is_array($adv_info)) {
                 $list[$ap_id] = $adv_info;
             }
         }
     }
     echo $_GET['callback'] . '(' . json_encode($list) . ')';
     exit;
 }
Пример #2
0
/**
 * 加载广告
 *
 * @param  $ap_id 广告位ID
 * @param $type 广告返回类型 html,js
 */
function uk86_loadadv($ap_id = null, $type = 'html')
{
    if (!is_numeric($ap_id)) {
        return false;
    }
    if (!function_exists('uk86_advshow')) {
        uk86_import('function.adv');
    }
    return uk86_advshow($ap_id, $type);
}