本文整理汇总了PHP中MAX_commonGetDeliveryUrl函数的典型用法代码示例。如果您正苦于以下问题:PHP MAX_commonGetDeliveryUrl函数的具体用法?PHP MAX_commonGetDeliveryUrl怎么用?PHP MAX_commonGetDeliveryUrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MAX_commonGetDeliveryUrl函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_MAX_commonGetDeliveryUrl_Includes_Nonstandard_Secure_Port_Number
function test_MAX_commonGetDeliveryUrl_Includes_Nonstandard_Secure_Port_Number()
{
$_SERVER['SERVER_PORT'] = 4430;
$GLOBALS['_MAX']['SSL_REQUEST'] = true;
$GLOBALS['_MAX']['CONF']['openads']['sslPort'] = 4430;
$url = MAX_commonGetDeliveryUrl('test.html');
$this->assertEqual($url, 'https://secure.maxstore.net:4430/www/delivery/test.html', "A non-standard port number should be explicitly provided in delivery URLs. %s");
unset($_SERVER['HTTPS']);
}
示例2: MAX_flashGetFlashObjectExternal
/**
* This function outputs the code to include the FlashObject code as an external
* JavaScript file
*
*/
function MAX_flashGetFlashObjectExternal()
{
$conf = $GLOBALS['_MAX']['CONF'];
if (substr($conf['file']['flash'], 0, 4) == 'http') {
$url = $conf['file']['flash'];
} else {
$url = MAX_commonGetDeliveryUrl($conf['file']['flash']);
}
return "<script type='text/javascript' src='{$url}'></script>";
}
示例3: MAX_trackerbuildJSVariablesScript
/**
* This function builds the JavaScript to track variables for a tracker-impression via JavaScript
*
* @todo Ask Matteo what the $trackerJsCode is for
*
* @param int $trackerid The ID of the tracker
* @param array $conversionInfo An array of the information from the tracker impression
* @param unknown_type $trackerJsCode Unknown
*
* @return string The JavaScript to pick up the variables from the page, and pass them in to the
* conversionvars script
*/
function MAX_trackerbuildJSVariablesScript($trackerid, $conversionInfo, $trackerJsCode = null)
{
$conf = $GLOBALS['_MAX']['CONF'];
$buffer = '';
$url = MAX_commonGetDeliveryUrl($conf['file']['conversionvars']);
$tracker = MAX_cacheGetTracker($trackerid);
$variables = MAX_cacheGetTrackerVariables($trackerid);
$variableQuerystring = '';
if (empty($trackerJsCode)) {
$trackerJsCode = md5(uniqid('', true));
} else {
// Appended tracker - set method to default
$tracker['variablemethod'] = 'default';
}
if (!empty($variables)) {
if ($tracker['variablemethod'] == 'dom') {
$buffer .= "\n function MAX_extractTextDom(o)\n {\n var txt = '';\n\n if (o.nodeType == 3) {\n txt = o.data;\n } else {\n for (var i = 0; i < o.childNodes.length; i++) {\n txt += MAX_extractTextDom(o.childNodes[i]);\n }\n }\n\n return txt;\n }\n\n function MAX_TrackVarDom(id, v)\n {\n if (max_trv[id][v]) { return; }\n var o = document.getElementById(v);\n if (o) {\n max_trv[id][v] = escape(o.tagName == 'INPUT' ? o.value : MAX_extractTextDom(o));\n }\n }";
$funcName = 'MAX_TrackVarDom';
} elseif ($tracker['variablemethod'] == 'default') {
$buffer .= "\n function MAX_TrackVarDefault(id, v)\n {\n if (max_trv[id][v]) { return; }\n if (typeof(window[v]) == undefined) { return; }\n max_trv[id][v] = window[v];\n }";
$funcName = 'MAX_TrackVarDefault';
} else {
$buffer .= "\n function MAX_TrackVarJs(id, v, c)\n {\n if (max_trv[id][v]) { return; }\n if (typeof(window[v]) == undefined) { return; }\n if (typeof(c) != 'undefined') {\n eval(c);\n }\n max_trv[id][v] = window[v];\n }";
$funcName = 'MAX_TrackVarJs';
}
$buffer .= "\n if (!max_trv) { var max_trv = new Array(); }\n if (!max_trv['{$trackerJsCode}']) { max_trv['{$trackerJsCode}'] = new Array(); }";
foreach ($variables as $key => $variable) {
$variableQuerystring .= "&{$variable['name']}=\"+max_trv['{$trackerJsCode}']['{$variable['name']}']+\"";
if ($tracker['variablemethod'] == 'custom') {
$buffer .= "\n {$funcName}('{$trackerJsCode}', '{$variable['name']}', '" . addcslashes($variable['variablecode'], "'") . "');";
} else {
$buffer .= "\n {$funcName}('{$trackerJsCode}', '{$variable['name']}');";
}
}
if (!empty($variableQuerystring)) {
$buffer .= "\n document.write (\"<\" + \"script language='JavaScript' type='text/javascript' src='\");\n document.write (\"{$url}?trackerid={$trackerid}&server_conv_id={$conversionInfo['server_conv_id']}&server_raw_ip={$conversionInfo['server_raw_ip']}{$variableQuerystring}'\");";
$buffer .= "\n\tdocument.write (\"><\\/scr\"+\"ipt>\");";
}
}
if (!empty($tracker['appendcode'])) {
// Add the correct "inherit" parameter if a OpenX trackercode was found
$tracker['appendcode'] = preg_replace('/("\\?trackerid=\\d+&inherit)=1/', '$1=' . $trackerJsCode, $tracker['appendcode']);
$jscode = MAX_javascriptToHTML($tracker['appendcode'], "MAX_{$trackerid}_appendcode");
// Replace template style variables
$jscode = preg_replace("/\\{m3_trackervariable:(.+?)\\}/", "\"+max_trv['{$trackerJsCode}']['\$1']+\"", $jscode);
$buffer .= "\n" . preg_replace('/^/m', "\t", $jscode) . "\n";
}
if (empty($buffer)) {
$buffer = "document.write(\"\");";
}
return $buffer;
}
示例4: _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;
}
示例5: 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);
}
示例6: MAX_adSelect
$resizable = 0;
}
if (!isset($scrollbars)) {
$scrollbars = 0;
}
// Get the banner
$row = MAX_adSelect($what, $campaignid, $target, $source, $withtext, $charset, $context, true, $ct0, $GLOBALS['loc'], $GLOBALS['referer']);
$row['zoneid'] = 0;
if (isset($zoneid)) {
$row['zoneid'] = $zoneid;
}
// Do not pop a window if not banner was found..
if (!$row['bannerid']) {
exit;
}
$contenturl = MAX_commonGetDeliveryUrl($conf['file']['content']) . "?bannerid={$row['bannerid']}&zoneid={$row['zoneid']}&target={$target}&withtext={$withtext}&source=" . urlencode($source) . "&timeout={$timeout}&ct0={$ct0}";
/*-------------------------------------------------------*/
/* Build the code needed to pop up a window */
/*-------------------------------------------------------*/
MAX_commonSendContentTypeHeader("application/x-javascript");
echo "\nvar MAX_errorhandler = null;\n\nif (window.captureEvents && Event.ERROR)\n window.captureEvents (Event.ERROR);\n\n// Error handler to prevent 'Access denied' errors\nfunction MAX_onerror(e) {\n window.onerror = MAX_errorhandler;\n return true;\n}\n\nfunction MAX_{$row['bannerid']}_pop() {\n MAX_errorhandler = window.onerror;\n window.onerror = MAX_onerror;\n\n // Determine the size of the window\n var X={$row['width']};\n var Y={$row['height']};\n\n // If Netscape 3 is used add 20 to the size because it doesn't support a margin of 0\n if(!window.resizeTo) {\n X+=20;\n Y+=20;\n }\n\n // Open the window if needed\n window.MAX_{$row['bannerid']}=window.open('', 'MAX_{$row['bannerid']}','height='+Y+',width='+X+',toolbar=" . ($toolbars == 1 ? 'yes' : 'no') . ",location=" . ($location == 1 ? 'yes' : 'no') . ",menubar=" . ($menubar == 1 ? 'yes' : 'no') . ",status=" . ($status == 1 ? 'yes' : 'no') . ",resizable=" . ($resizable == 1 ? 'yes' : 'no') . ",scrollbars=" . ($scrollbars == 1 ? 'yes' : 'no') . "');\n\n if (window.MAX_{$row['bannerid']}.document.title == '' || window.MAX_{$row['bannerid']}.location == 'about:blank' || window.MAX_{$row['bannerid']}.location == '') {\n var browser = navigator.userAgent.toLowerCase();\n\n // Resize window to correct size on IE < 6, determine outer width and height - IE 5.1x on MAC should't resize!\n if (window.resizeTo && browser.match(/msie [345]/) && browser.indexOf('msie 5.1') == -1 && browser.indexOf('mac') == -1) {\n if(MAX_{$row['bannerid']}.innerHeight) {\n var diffY = MAX_{$row['bannerid']}.outerHeight-Y;\n var diffX = MAX_{$row['bannerid']}.outerWidth-X;\n var outerX = X+diffX;\n var outerY = Y+diffY;\n } else {\n MAX_{$row['bannerid']}.resizeTo(X, Y);\n var time = new Date().getTime();\n while (!MAX_{$row['bannerid']}.document.body) {\n if (new Date().getTime() - time > 250) {\n MAX_{$row['bannerid']}.close();\n return false;\n }\n }\n var diffY = MAX_{$row['bannerid']}.document.body.clientHeight-Y;\n var diffX = MAX_{$row['bannerid']}.document.body.clientWidth-X;\n var outerX = X-diffX;\n var outerY = Y-diffY;\n }\n MAX_{$row['bannerid']}.resizeTo(outerX, outerY);\n }";
if (!empty($left) || !empty($top)) {
if (!isset($left) || empty($left)) {
$left = 0;
}
if (!isset($top) || empty($top)) {
$top = 0;
}
echo "\n if (window.moveTo) {";
if ($left == 'center') {
echo "\n var posX = parseInt((screen.width/2)-(outerX/2));";
示例7: preg_replace
if (isset($rewrite) && $rewrite == 1) {
$banner['html'] = preg_replace('#target\\s*=\\s*([\'"])_parent\\1#i', "target='_top'", $banner['html']);
$banner['html'] = preg_replace('#target\\s*=\\s*([\'"])_self\\1#i', "target='_parent'", $banner['html']);
}
// Build HTML
$outputHtml = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
$outputHtml .= "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>\n";
$outputHtml .= "<head>\n";
$outputHtml .= "<title>" . (!empty($banner['alt']) ? $banner['alt'] : 'Advertisement') . "</title>\n";
// Include the FlashObject script if required
if (isset($banner['contenttype']) && $banner['contenttype'] == 'swf') {
$outputHtml .= MAX_flashGetFlashObjectExternal();
}
// Add refresh meta tag if $refresh is set and numeric
if (isset($refresh) && is_numeric($refresh) && $refresh > 0) {
$dest = MAX_commonGetDeliveryUrl($conf['file']['frame']) . '?' . $_SERVER['QUERY_STRING'];
parse_str($_SERVER['QUERY_STRING'], $qs);
$dest .= !array_key_exists('loc', $qs) ? "&loc=" . urlencode($loc) : '';
// Try to use JS location.replace since browsers deal with this and history much better than meta-refresh
$outputHtml .= "\n <script type='text/javascript'><!--// <![CDATA[\n setTimeout('window.location.replace(\"{$dest}\")', " . $refresh * 1000 . ");\n // ]]> --></script><noscript><meta http-equiv='refresh' content='" . $refresh . ";url={$dest}'></noscript>\n ";
}
if (isset($resize) && $resize == 1) {
$outputHtml .= "<script type='text/javascript'>\n";
$outputHtml .= "<!--// <![CDATA[ \n";
$outputHtml .= "\tfunction MAX_adjustframe(frame) {\n";
$outputHtml .= "\t\tif (document.all) {\n";
$outputHtml .= "\t\t\tparent.document.all[frame.name].width = " . $banner['width'] . ";\n";
$outputHtml .= "\t\t\tparent.document.all[frame.name].height = " . $banner['height'] . ";\n";
$outputHtml .= "\t\t}\n";
$outputHtml .= "\t\telse if (document.getElementById) {\n";
$outputHtml .= "\t\t\tparent.document.getElementById(frame.name).width = " . $banner['width'] . ";\n";