当前位置: 首页>>代码示例>>PHP>>正文


PHP Admin_DA::_checkBannerZoneAdAssoc方法代码示例

本文整理汇总了PHP中Admin_DA::_checkBannerZoneAdAssoc方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::_checkBannerZoneAdAssoc方法的具体用法?PHP Admin_DA::_checkBannerZoneAdAssoc怎么用?PHP Admin_DA::_checkBannerZoneAdAssoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Admin_DA的用法示例。


在下文中一共展示了Admin_DA::_checkBannerZoneAdAssoc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCheckBannerZoneAdAssoc

 function testCheckBannerZoneAdAssoc()
 {
     // sql banner with an email zone
     $aZone = array('type' => 4);
     $bannerType = 'sql';
     $contentType = 'gif';
     $ret = Admin_DA::_checkBannerZoneAdAssoc($aZone, $bannerType, $contentType);
     $this->assertFalse(PEAR::isError($ret));
     // web banner (png) with an email zone
     $aZone = array('type' => 4);
     $bannerType = 'web';
     $contentType = 'png';
     $ret = Admin_DA::_checkBannerZoneAdAssoc($aZone, $bannerType, $contentType);
     $this->assertFalse(PEAR::isError($ret));
     // url banner (jpg) with an email zone
     $aZone = array('type' => 4);
     $bannerType = 'url';
     $contentType = 'jpeg';
     $ret = Admin_DA::_checkBannerZoneAdAssoc($aZone, $bannerType, $contentType);
     $this->assertFalse(PEAR::isError($ret));
     // html banner (swf) with an email zone
     $aZone = array('type' => 4);
     $bannerType = 'html';
     PEAR::pushErrorHandling(null);
     $ret = Admin_DA::_checkBannerZoneAdAssoc($aZone, $bannerType);
     PEAR::popErrorHandling();
     $this->assertTrue(PEAR::isError($ret));
     // url banner (swf) with an email zone
     $aZone = array('type' => 4);
     $bannerType = 'url';
     $contentType = 'swf';
     PEAR::pushErrorHandling(null);
     $ret = Admin_DA::_checkBannerZoneAdAssoc($aZone, $bannerType, $contentType);
     PEAR::popErrorHandling();
     $this->assertTrue(PEAR::isError($ret));
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:36,代码来源:AdminDA.dal.test.php

示例2: _isValidAdZoneAssoc

 function _isValidAdZoneAssoc($aVariables)
 {
     $aAdZone = Admin_DA::getAdZones($aVariables);
     if (empty($aAdZone)) {
         if (!$aVariables['zone_id']) {
             // Direct selection zone, always allow
             return true;
         }
         $azParams = Admin_DA::getLinkedAdParams($aVariables['zone_id']);
         $azParams['ad_id'] = $aVariables['ad_id'];
         $azParams['market_ads_include'] = true;
         $azAds = Admin_DA::getAds($azParams);
         if (!empty($azAds)) {
             // Ad seems OK to link, check if this is an email zone, and enforce only a single active linked ad at a time
             $aZone = Admin_DA::getZone($aVariables['zone_id']);
             if ($aZone['type'] == MAX_ZoneEmail) {
                 $aAd = Admin_DA::getAd($azParams['ad_id']);
                 $okToLink = Admin_DA::_checkEmailZoneAdAssoc($aZone['zone_id'], $aAd['placement_id']);
                 if (PEAR::isError($okToLink)) {
                     return $okToLink;
                 }
                 PEAR::pushErrorHandling(null);
                 $okToLink = Admin_DA::_checkBannerZoneAdAssoc($aZone, $aAd['type'], $aAd['contenttype']);
                 PEAR::popErrorHandling();
                 if (PEAR::isError($okToLink)) {
                     return $okToLink;
                 }
             }
             if ($aZone['type'] != phpAds_ZoneText && $azAds[$azParams['ad_id']]['type'] == 'txt') {
                 return PEAR::raiseError('Text banner can be linked only to text zone', MAX_ERROR_INVALIDBANNERSIZE);
             }
             return true;
         } else {
             return PEAR::raiseError('This banner is the wrong size for this zone', MAX_ERROR_INVALIDBANNERSIZE);
         }
     } else {
         // If already linked...
         return PEAR::raiseError('This banner is already linked to this zone', MAX_ERROR_ALREADYLINKED);
     }
 }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:40,代码来源:Admin_DA.php


注:本文中的Admin_DA::_checkBannerZoneAdAssoc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。