本文整理汇总了PHP中_adSelectCheckCriteria函数的典型用法代码示例。如果您正苦于以下问题:PHP _adSelectCheckCriteria函数的具体用法?PHP _adSelectCheckCriteria怎么用?PHP _adSelectCheckCriteria使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_adSelectCheckCriteria函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _adSelectDiscardNonMatchingAds
function _adSelectDiscardNonMatchingAds(&$aAds, $aContext, $source, $richMedia)
{
if (empty($GLOBALS['_MAX']['CONF']['delivery']['aclsDirectSelection']) && !empty($GLOBALS['_MAX']['DIRECT_SELECTION'])) {
return;
}
foreach ($aAds as $adId => $aAd) {
OX_Delivery_logMessage('_adSelectDiscardNonMatchingAds: checking bannerid ' . $aAd['ad_id'], 7);
if (!_adSelectCheckCriteria($aAd, $aContext, $source, $richMedia)) {
OX_Delivery_logMessage('failed _adSelectCheckCriteria: bannerid ' . $aAd['ad_id'], 7);
unset($aAds[$adId]);
} else {
OX_Delivery_logMessage('passed _adSelectCheckCriteria: bannerid ' . $aAd['ad_id'], 7);
}
}
return;
}
示例2: test_CheckCriteria
function test_CheckCriteria()
{
$context = array();
$source = array();
$richMedia = true;
$test_ad = array('ad_id' => 5, 'name' => 'my ad', 'expire_time' => '2010-02-02 07:59:59');
// positive case
$GLOBALS['_MAX']['NOW'] = strtotime('2010-02-02 00:00:00');
$this->assertTrue(_adSelectCheckCriteria($test_ad, $criteria, $source, $richMedia));
// campaign expired
$GLOBALS['_MAX']['NOW'] = strtotime('2010-02-02 08:00:00');
$this->assertFalse(_adSelectCheckCriteria($test_ad, $criteria, $source, $richMedia));
// invalid or unset expire_times should always pass
$test_ad['expire_time'] = '0000-00-00 00:00:00';
$this->assertTrue(_adSelectCheckCriteria($test_ad, $criteria, $source, $richMedia));
$test_ad['expire_time'] = null;
$this->assertTrue(_adSelectCheckCriteria($test_ad, $criteria, $source, $richMedia));
}
示例3: _adSelectDiscardNonMatchingAds
function _adSelectDiscardNonMatchingAds($aAds, $aContext, $source, $richMedia)
{
foreach ($aAds as $adId => $aAd) {
if (!_adSelectCheckCriteria($aAd, $aContext, $source, $richMedia)) {
unset($aAds[$adId]);
} else {
}
}
return $aAds;
}
示例4: _adSelectDiscardNonMatchingAds
/**
* This function removes any ads which cannot be shown for the current impression
*
* @param array $aAds - The array of ads to be evaluated
* @param $aContext
* @param unknown_type $source
* @param unknown_type $richMedia
* @return unknown
*/
function _adSelectDiscardNonMatchingAds($aAds, $aContext, $source, $richMedia)
{
foreach ($aAds as $adId => $aAd) {
###START_STRIP_DELIVERY
OA::debug('_adSelectDiscardNonMatchingAds: checking bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
if (!_adSelectCheckCriteria($aAd, $aContext, $source, $richMedia)) {
###START_STRIP_DELIVERY
OA::debug('failed _adSelectCheckCriteria: bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
unset($aAds[$adId]);
} else {
###START_STRIP_DELIVERY
OA::debug('passed _adSelectCheckCriteria: bannerid ' . $aAd['ad_id'] . ' ' . $aAd['name']);
###END_STRIP_DELIVERY
}
}
return $aAds;
}