本文整理汇总了PHP中_adRenderBuildLogURL函数的典型用法代码示例。如果您正苦于以下问题:PHP _adRenderBuildLogURL函数的具体用法?PHP _adRenderBuildLogURL怎么用?PHP _adRenderBuildLogURL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_adRenderBuildLogURL函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MAX_adSelect
//.........这里部分代码省略.........
$g_prepend = '';
if (!empty($what)) {
while ($first || $what != '' && $found == false) {
$first = false;
$ix = strpos($what, '|');
if ($ix === false) {
$remaining = '';
} else {
$remaining = substr($what, $ix + 1);
$what = substr($what, 0, $ix);
}
if (strpos($what, 'zone:') === 0) {
$zoneId = intval(substr($what, 5));
$row = _adSelectZone($zoneId, $context, $source, $richmedia);
} else {
if (strpos($what, '/') > 0) {
if (strpos($what, '@') > 0) {
list($what, $append) = explode('@', $what);
} else {
$append = '';
}
$separate = explode('/', $what);
$expanded = '';
$collected = array();
reset($separate);
while (list(, $v) = each($separate)) {
$expanded .= ($expanded != '' ? ',+' : '') . $v;
$collected[] = $expanded . ($append != '' ? ',+' . $append : '');
}
$what = strtok(implode('|', array_reverse($collected)), '|');
$remaining = strtok('') . ($remaining != '' ? '|' . $remaining : '');
}
$row = _adSelectDirect($what, $campaignid, $context, $source, $richmedia, $remaining == '');
}
if (is_array($row) && empty($row['default'])) {
MAX_Delivery_log_logAdRequest($row['bannerid'], $row['zoneid'], $row);
if (($row['adserver'] == 'max' || $row['adserver'] == '3rdPartyServers:ox3rdPartyServers:max') && preg_match("#{$conf['webpath']['delivery']}.*zoneid=([0-9]+)#", $row['htmltemplate'], $matches) && !stristr($row['htmltemplate'], $conf['file']['popup'])) {
$GLOBALS['_MAX']['adChain'][] = $row;
$found = false;
$what = "zone:{$matches[1]}";
} else {
$found = true;
}
} else {
MAX_Delivery_log_logAdRequest(null, $originalZoneId, null);
$what = $remaining;
}
}
}
if ($found) {
$zoneId = empty($row['zoneid']) ? 0 : $row['zoneid'];
if (!empty($GLOBALS['_MAX']['adChain'])) {
foreach ($GLOBALS['_MAX']['adChain'] as $index => $ad) {
if ($ad['ad_id'] != $row['ad_id'] && !empty($ad['append'])) {
$row['append'] .= $ad['append'];
}
}
}
$outputbuffer = MAX_adRender($row, $zoneId, $source, $target, $ct0, $withtext, $charset, true, true, $richmedia, $loc, $referer, $context);
$output = array('html' => $outputbuffer, 'bannerid' => $row['bannerid'], 'contenttype' => $row['contenttype'], 'alt' => $row['alt'], 'width' => $row['width'], 'height' => $row['height'], 'url' => $row['url'], 'campaignid' => $row['campaignid'], 'clickUrl' => $row['clickUrl'], 'logUrl' => $row['logUrl'], 'aSearch' => $row['aSearch'], 'aReplace' => $row['aReplace'], 'bannerContent' => $row['bannerContent'], 'clickwindow' => $row['clickwindow'], 'aRow' => $row, 'context' => _adSelectBuildContext($row, $context), 'iframeFriendly' => (bool) $row['iframe_friendly']);
$row += array('block_ad' => 0, 'cap_ad' => 0, 'session_cap_ad' => 0, 'block_campaign' => 0, 'cap_campaign' => 0, 'session_cap_campaign' => 0, 'block_zone' => 0, 'cap_zone' => 0, 'session_cap_zone' => 0);
if (MAX_Delivery_cookie_cappingOnRequest()) {
if ($row['block_ad'] > 0 || $row['cap_ad'] > 0 || $row['session_cap_ad'] > 0) {
MAX_Delivery_cookie_setCapping('Ad', $row['bannerid'], $row['block_ad'], $row['cap_ad'], $row['session_cap_ad']);
}
if ($row['block_campaign'] > 0 || $row['cap_campaign'] > 0 || $row['session_cap_campaign'] > 0) {
MAX_Delivery_cookie_setCapping('Campaign', $row['campaign_id'], $row['block_campaign'], $row['cap_campaign'], $row['session_cap_campaign']);
}
if ($row['block_zone'] > 0 || $row['cap_zone'] > 0 || $row['session_cap_zone'] > 0) {
MAX_Delivery_cookie_setCapping('Zone', $row['zoneid'], $row['block_zone'], $row['cap_zone'], $row['session_cap_zone']);
}
MAX_Delivery_log_setLastAction(0, array($row['bannerid']), array($zoneId), array($row['viewwindow']));
}
} else {
if (!empty($zoneId)) {
$logUrl = _adRenderBuildLogURL(array('ad_id' => 0, 'placement_id' => 0), $zoneId, $source, $loc, $referer, '&');
$g_append = str_replace('{random}', MAX_getRandomNumber(), MAX_adRenderImageBeacon($logUrl)) . $g_append;
}
if (!empty($row['default'])) {
if (empty($target)) {
$target = '_blank';
}
$outputbuffer = $g_prepend . '<a href=\'' . $row['default_banner_destination_url'] . '\' target=\'' . $target . '\'><img src=\'' . $row['default_banner_image_url'] . '\' border=\'0\' alt=\'\'></a>' . $g_append;
$output = array('html' => $outputbuffer, 'bannerid' => '', 'default_banner_image_url' => $row['default_banner_image_url']);
} else {
if (!empty($conf['defaultBanner']['imageUrl'])) {
if (empty($target)) {
$target = '_blank';
}
$outputbuffer = "{$g_prepend}<img src='{$conf['defaultBanner']['imageUrl']}' border='0' alt=''>{$g_append}";
$output = array('html' => $outputbuffer, 'bannerid' => '', 'default_banner_image_url' => $conf['defaultBanner']['imageUrl']);
} else {
$outputbuffer = $g_prepend . $g_append;
$output = array('html' => $outputbuffer, 'bannerid' => '');
}
}
}
OX_Delivery_Common_hook('postAdSelect', array(&$output));
return $output;
}
示例2: _adRenderImageBeacon
function _adRenderImageBeacon($aBanner, $zoneId = 0, $source = '', $loc = '', $referer = '', $logUrl = '')
{
if (empty($logUrl)) {
$logUrl = _adRenderBuildLogURL($aBanner, $zoneId, $source, $loc, $referer, '&');
}
return MAX_adRenderImageBeacon($logUrl);
}
示例3: prepareTrackingParams
function prepareTrackingParams(&$aOutputParams, $aBanner, $zoneId, $source, $loc, $ct0, $logClick, $referer)
{
$conf = $GLOBALS['_MAX']['CONF'];
$aOutputParams['impressionUrl'] = _adRenderBuildLogURL($aBanner, $zoneId, $source, $loc, $referer, '&');
if ($aOutputParams['format'] == 'vast') {
$trackingUrl = MAX_commonGetDeliveryUrl($conf['file']['frontcontroller']) . "?script=deliveryLog:oxLogVast:logImpressionVast&banner_id={$aBanner['bannerid']}&zone_id={$zoneId}";
if (!empty($source)) {
$trackingUrl .= "&source={$source}";
}
$aOutputParams['trackUrlStart'] = $trackingUrl . '&vast_event=start';
$aOutputParams['trackUrlMidPoint'] = $trackingUrl . '&vast_event=midpoint';
$aOutputParams['trackUrlFirstQuartile'] = $trackingUrl . '&vast_event=firstquartile';
$aOutputParams['trackUrlThirdQuartile'] = $trackingUrl . '&vast_event=thirdquartile';
$aOutputParams['trackUrlComplete'] = $trackingUrl . '&vast_event=complete';
$aOutputParams['trackUrlMute'] = $trackingUrl . '&vast_event=mute';
$aOutputParams['trackUrlPause'] = $trackingUrl . '&vast_event=pause';
$aOutputParams['trackReplay'] = $trackingUrl . '&vast_event=replay';
$aOutputParams['trackUrlFullscreen'] = $trackingUrl . '&vast_event=fullscreen';
$aOutputParams['trackUrlStop'] = $trackingUrl . '&vast_event=stop';
$aOutputParams['trackUrlUnmute'] = $trackingUrl . '&vast_event=unmute';
$aOutputParams['trackUrlResume'] = $trackingUrl . '&vast_event=resume';
$aOutputParams['vastVideoClickThroughUrl'] = _adRenderBuildVideoClickThroughUrl($aBanner, $zoneId, $source, $ct0);
}
$aOutputParams['clickUrl'] = _adRenderBuildClickUrl($aBanner, $zoneId, $source, $ct0, $logClick);
}
示例4: test_adRenderBuildLogURL
/**
* build a log URL
*
*/
function test_adRenderBuildLogURL()
{
$this->sendMessage('test_adRenderBuildLogURL');
require_once MAX_PATH . '/lib/max/Delivery/common.php';
$aBanner = array('bannerid' => '9999', 'url' => 'http://www.somewhere.com', 'contenttype' => '');
$zoneId = 1;
$source = 'test';
$loc = 'http://www.example.com/page.php?name=value';
$referer = 'http://www.example.com/referer.php?name=value';
$amp = '&';
$return = _adRenderBuildLogURL($aBanner, $zoneId, $source, $loc, $referer, $amp);
$expect = "http://" . $GLOBALS['_MAX']['CONF']['webpath']['delivery'] . "/lg.php?bannerid=&campaignid=&zoneid=1&source=test&loc=http%3A%2F%2Fwww.example.com%2Fpage.php%3Fname%3Dvalue&referer=http%3A%2F%2Fwww.example.com%2Freferer.php%3Fname%3Dvalue&cb={random}";
$this->assertEqual($return, $expect);
}
示例5: MAX_adSelect
//.........这里部分代码省略.........
if (strpos($what, '@') > 0) {
list($what, $append) = explode('@', $what);
} else {
$append = '';
}
$separate = explode('/', $what);
$expanded = '';
$collected = array();
reset($separate);
while (list(, $v) = each($separate)) {
$expanded .= ($expanded != '' ? ',+' : '') . $v;
$collected[] = $expanded . ($append != '' ? ',+' . $append : '');
}
$what = strtok(implode('|', array_reverse($collected)), '|');
$remaining = strtok('') . ($remaining != '' ? '|' . $remaining : '');
}
$row = _adSelectDirect($what, $campaignid, $context, $source, $richmedia, $remaining == '');
}
if (is_array($row) && empty($row['default'])) {
// Log the ad request
MAX_Delivery_log_logAdRequest($row['bannerid'], $row['zoneid'], $row);
if (($row['adserver'] == 'max' || $row['adserver'] == '3rdPartyServers:ox3rdPartyServers:max') && preg_match("#{$conf['webpath']['delivery']}.*zoneid=([0-9]+)#", $row['htmltemplate'], $matches) && !stristr($row['htmltemplate'], $conf['file']['popup'])) {
// The ad selected was an OpenX HTML ad on the same server... do internal redirecty stuff
$GLOBALS['_MAX']['adChain'][] = $row;
$found = false;
$what = "zone:{$matches[1]}";
} else {
$found = true;
}
} else {
// Log the ad request
MAX_Delivery_log_logAdRequest(null, $originalZoneId, null);
$what = $remaining;
}
}
}
// Return the banner information
if ($found) {
$zoneId = empty($row['zoneid']) ? 0 : $row['zoneid'];
// For internal redirected creatives, make sure that any appended code in the adChain is appended
if (!empty($GLOBALS['_MAX']['adChain'])) {
foreach ($GLOBALS['_MAX']['adChain'] as $index => $ad) {
if ($ad['ad_id'] != $row['ad_id'] && !empty($ad['append'])) {
$row['append'] .= $ad['append'];
}
}
}
$outputbuffer = MAX_adRender($row, $zoneId, $source, $target, $ct0, $withtext, $charset, true, true, $richmedia, $loc, $referer, $context);
$output = array('html' => $outputbuffer, 'bannerid' => $row['bannerid'], 'contenttype' => $row['contenttype'], 'alt' => $row['alt'], 'width' => $row['width'], 'height' => $row['height'], 'url' => $row['url'], 'campaignid' => $row['campaignid'], 'clickUrl' => $row['clickUrl'], 'logUrl' => $row['logUrl'], 'aSearch' => $row['aSearch'], 'aReplace' => $row['aReplace'], 'bannerContent' => $row['bannerContent'], 'clickwindow' => $row['clickwindow'], 'aRow' => $row, 'context' => _adSelectBuildContext($row, $context), 'iframeFriendly' => (bool) $row['iframe_friendly']);
// Init block/capping fields to avoid notices below
$row += array('block_ad' => 0, 'cap_ad' => 0, 'session_cap_ad' => 0, 'block_campaign' => 0, 'cap_campaign' => 0, 'session_cap_campaign' => 0, 'block_zone' => 0, 'cap_zone' => 0, 'session_cap_zone' => 0);
// If ad-logging is disabled, the log beacon won't be sent, so set the capping at request
if (MAX_Delivery_cookie_cappingOnRequest()) {
if ($row['block_ad'] > 0 || $row['cap_ad'] > 0 || $row['session_cap_ad'] > 0) {
MAX_Delivery_cookie_setCapping('Ad', $row['bannerid'], $row['block_ad'], $row['cap_ad'], $row['session_cap_ad']);
}
if ($row['block_campaign'] > 0 || $row['cap_campaign'] > 0 || $row['session_cap_campaign'] > 0) {
MAX_Delivery_cookie_setCapping('Campaign', $row['campaign_id'], $row['block_campaign'], $row['cap_campaign'], $row['session_cap_campaign']);
}
if ($row['block_zone'] > 0 || $row['cap_zone'] > 0 || $row['session_cap_zone'] > 0) {
MAX_Delivery_cookie_setCapping('Zone', $row['zoneid'], $row['block_zone'], $row['cap_zone'], $row['session_cap_zone']);
}
// Store the last view action event om the cookie as well (if required)
MAX_Delivery_log_setLastAction(0, array($row['bannerid']), array($zoneId), array($row['viewwindow']));
}
} else {
// Blank impression beacon
if (!empty($zoneId)) {
$logUrl = _adRenderBuildLogURL(array('ad_id' => 0, 'placement_id' => 0), $zoneId, $source, $loc, $referer, '&');
$g_append = str_replace('{random}', MAX_getRandomNumber(), MAX_adRenderImageBeacon($logUrl)) . $g_append;
}
// No banner found
if (!empty($row['default'])) {
// Return the default banner
if (empty($target)) {
$target = '_blank';
// Default
}
$outputbuffer = $g_prepend . '<a href=\'' . $row['default_banner_destination_url'] . '\' target=\'' . $target . '\'><img src=\'' . $row['default_banner_image_url'] . '\' border=\'0\' alt=\'\'></a>' . $g_append;
$output = array('html' => $outputbuffer, 'bannerid' => '', 'default_banner_image_url' => $row['default_banner_image_url']);
} else {
if (!empty($conf['defaultBanner']['imageUrl'])) {
// Return the default banner
if (empty($target)) {
$target = '_blank';
// Default
}
$outputbuffer = "{$g_prepend}<img src='{$conf['defaultBanner']['imageUrl']}' border='0' alt=''>{$g_append}";
$output = array('html' => $outputbuffer, 'bannerid' => '', 'default_banner_image_url' => $conf['defaultBanner']['imageUrl']);
} else {
// No default banner was returned, return no banner
$outputbuffer = $g_prepend . $g_append;
$output = array('html' => $outputbuffer, 'bannerid' => '');
}
}
}
// post adSelect hook
OX_Delivery_Common_hook('postAdSelect', array(&$output));
return $output;
}