本文整理汇总了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));
}
示例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);
}
}