本文整理匯總了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;
}