当前位置: 首页>>代码示例>>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;未经允许,请勿转载。