本文整理汇总了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;
}
示例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']);
}