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


PHP _adRenderBuildParams函數代碼示例

本文整理匯總了PHP中_adRenderBuildParams函數的典型用法代碼示例。如果您正苦於以下問題:PHP _adRenderBuildParams函數的具體用法?PHP _adRenderBuildParams怎麽用?PHP _adRenderBuildParams使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了_adRenderBuildParams函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _adRenderBuildClickUrl

function _adRenderBuildClickUrl($aBanner, $zoneId = 0, $source = '', $ct0 = '', $logClick = true, $overrideDest = false)
{
    $conf = $GLOBALS['_MAX']['CONF'];
    $clickUrl = '';
    if (is_string($logClick)) {
        $clickUrl = $logClick;
    } elseif (!empty($aBanner['url']) || $overrideDest) {
        $clickUrl = MAX_commonGetDeliveryUrl($conf['file']['click']) . '?' . $conf['var']['params'] . '=' . _adRenderBuildParams($aBanner, $zoneId, $source, $ct0, $logClick, true);
    }
    return $clickUrl;
}
開發者ID:hawodi,項目名稱:revive-adserver,代碼行數:11,代碼來源:al.php

示例2: test_adRenderBuildParams

 /**
  * build params
  *
  */
 function test_adRenderBuildParams()
 {
     $this->sendMessage('test_adRenderBuildParams');
     $aBanner = array('bannerid' => '9999', 'url' => 'http://www.somewhere.com', 'contenttype' => '');
     $zoneId = 0;
     $source = '';
     $ct0 = '';
     $logClick = true;
     $overrideDest = false;
     $conf = $GLOBALS['_MAX']['CONF'];
     $ret = _adRenderBuildParams($aBanner, $zoneId, $source, $ct0, $logClick, $overrideDest);
     $this->assertEqual($ret, "2__{$conf['var']['adId']}=9999__{$conf['var']['zoneId']}=0__{$conf['var']['cacheBuster']}={random}__{$conf['var']['dest']}=http%3A%2F%2Fwww.somewhere.com");
     preg_match('/(http.*?)$/', $ret, $m);
     $this->assertEqual(urldecode($m[1]), $aBanner['url']);
     $this->sendMessage('test_adRenderBuildParams');
     $aBanner = array('bannerid' => '9999', 'url' => 'http://www.example.com/?foo+bar', 'contenttype' => '');
     $zoneId = 0;
     $source = '';
     $ct0 = '';
     $logClick = true;
     $overrideDest = false;
     $conf = $GLOBALS['_MAX']['CONF'];
     $ret = _adRenderBuildParams($aBanner, $zoneId, $source, $ct0, $logClick, $overrideDest);
     $this->assertEqual($ret, "2__{$conf['var']['adId']}=9999__{$conf['var']['zoneId']}=0__{$conf['var']['cacheBuster']}={random}__{$conf['var']['dest']}=http%3A%2F%2Fwww.example.com%2F%3Ffoo%2Bbar");
     preg_match('/(http.*?)$/', $ret, $m);
     $this->assertEqual(urldecode($m[1]), $aBanner['url']);
     $this->sendMessage('test_adRenderBuildParams');
     $aBanner = array('bannerid' => '9999', 'url' => 'http://www.example.com/?foo+bar', 'contenttype' => '');
     $zoneId = 0;
     $source = '';
     $ct0 = 'http://www.openx.org/ck.php?foo=bar&dest=';
     $logClick = true;
     $overrideDest = false;
     $conf = $GLOBALS['_MAX']['CONF'];
     $ret = _adRenderBuildParams($aBanner, $zoneId, $source, $ct0, $logClick, $overrideDest);
     $this->assertEqual($ret, "2__{$conf['var']['adId']}=9999__{$conf['var']['zoneId']}=0__{$conf['var']['cacheBuster']}={random}__{$conf['var']['dest']}=http%3A%2F%2Fwww.openx.org%2Fck.php%3Ffoo%3Dbar%26dest%3Dhttp%253A%252F%252Fwww.example.com%252F%253Ffoo%252Bbar");
     preg_match('/(http.*?openx.org.*?)$/', $ret, $m);
     preg_match('/=(http.*?)$/', urldecode($m[1]), $m);
     $this->assertEqual(urldecode($m[1]), $aBanner['url']);
     // Same as above, wrong ct0
     $this->sendMessage('test_adRenderBuildParams');
     $aBanner = array('bannerid' => '9999', 'url' => 'http://www.example.com/?foo+bar', 'contenttype' => '');
     $zoneId = 0;
     $source = '';
     $ct0 = 'foobar';
     $logClick = true;
     $overrideDest = false;
     $conf = $GLOBALS['_MAX']['CONF'];
     $ret = _adRenderBuildParams($aBanner, $zoneId, $source, $ct0, $logClick, $overrideDest);
     $this->assertEqual($ret, "2__{$conf['var']['adId']}=9999__{$conf['var']['zoneId']}=0__{$conf['var']['cacheBuster']}={random}__{$conf['var']['dest']}=http%3A%2F%2Fwww.example.com%2F%3Ffoo%2Bbar");
     preg_match('/(http.*?)$/', $ret, $m);
     $this->assertEqual(urldecode($m[1]), $aBanner['url']);
 }
開發者ID:ballistiq,項目名稱:revive-adserver,代碼行數:57,代碼來源:adRender.del.test.php


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