當前位置: 首頁>>代碼示例>>PHP>>正文


PHP _adSelectCheckCriteria函數代碼示例

本文整理匯總了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;
}
開發者ID:hawodi,項目名稱:revive-adserver,代碼行數:16,代碼來源:al.php

示例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));
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:18,代碼來源:adSelect.del.test.php

示例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;
}
開發者ID:villos,項目名稱:tree_admin,代碼行數:10,代碼來源:alocal.php

示例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;
}
開發者ID:villos,項目名稱:tree_admin,代碼行數:28,代碼來源:adSelect.php


注:本文中的_adSelectCheckCriteria函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。