本文整理汇总了PHP中MAX_commonSendContentTypeHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP MAX_commonSendContentTypeHeader函数的具体用法?PHP MAX_commonSendContentTypeHeader怎么用?PHP MAX_commonSendContentTypeHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MAX_commonSendContentTypeHeader函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MAX_sendStatusCode
}
$plugin = MAX_PATH . $conf['pluginPaths']['plugins'] . 'invocationTags/oxInvocationTags/layerstyles/' . $layerstyle . '/layerstyle.inc.php';
if (!preg_match('/^[a-z0-9-]{1,64}$/Di', $layerstyle) || !@(include $plugin)) {
MAX_sendStatusCode(404);
echo '// Cannot load required layerstyle file. Check if openXInvocationTags plugin is installed';
exit;
}
MAX_commonRegisterGlobalsArray(array('block', 'blockcampaign', 'exclude', 'mmm_fo', 'q'));
if (isset($context) && !is_array($context)) {
$context = MAX_commonUnpackContext($context);
}
if (!is_array($context)) {
$context = array();
}
$limitations = MAX_layerGetLimitations();
MAX_commonSendContentTypeHeader("application/x-javascript", $charset);
if ($limitations['compatible']) {
$output = MAX_adSelect($what, $campaignid, $target, $source, $withtext, $charset, $context, $limitations['richmedia'], $GLOBALS['ct0'], $GLOBALS['loc'], $GLOBALS['referer']);
MAX_cookieFlush();
$uniqid = substr(md5(uniqid('', 1)), 0, 8);
if (empty($output['bannerid'])) {
echo MAX_javascriptToHTML($output['html'], "MAX_{$uniqid}");
exit;
}
if (!empty($block) && !empty($output['bannerid'])) {
$output['context'][] = array('!=' => 'bannerid:' . $output['bannerid']);
}
if (!empty($blockcampaign) && !empty($output['campaignid'])) {
$output['context'][] = array('!=' => 'campaignid:' . $output['campaignid']);
}
if (!empty($blockcampaign) && !empty($output['campaignid'])) {
示例2: foreach
$outputXml = "<?xml version='1.0' encoding='{$charset}' ?" . ">\n";
if ($useMultipleZones) {
$outputXml .= "<ads>\n";
foreach ($aBanners as $aBanner) {
$outputXml .= "<ad version=\"1.0\">\n";
buildXmlTree($aBanner, $outputXml);
$outputXml .= "</ad>\n";
}
$outputXml .= "</ads>";
} elseif (count($aBanners) > 0) {
$outputXml .= "<ad version=\"1.0\">\n";
buildXmlTree($aBanners[0], $outputXml);
$outputXml .= "</ad>\n";
}
MAX_cookieFlush();
MAX_commonSendContentTypeHeader('application/xml', $charset);
echo $outputXml;
function xmlencode($string)
{
$search = array('‘', '’', '“', '”', ' ', '�');
$replace = array(''', ''', '"', '"', ' ', '_');
return str_replace($search, $replace, preg_replace('#%([A-F0-9]{2})#', '&#x${1};', rawurlencode($string)));
}
function buildXmlTree($var, &$xml)
{
if (is_array($var)) {
foreach ($var as $key => $value) {
if (is_numeric($key)) {
$key = "id_" . $key;
}
$xml .= "<{$key}>";
示例3: array
// Send bannerid headers
$cookie = array();
$cookie[$conf['var']['adId']] = $banner['bannerid'];
// Send zoneid headers
if ($zoneid != 0) {
$cookie[$conf['var']['zoneId']] = $zoneid;
}
// Send source headers
if (!empty($source)) {
$cookie[$conf['var']['channel']] = $source;
}
// Set the cookie
MAX_cookieAdd($conf['var']['vars'] . "[{$n}]", serialize($cookie));
}
MAX_cookieFlush();
MAX_commonSendContentTypeHeader('text/html', $charset);
// Rewrite targets in HTML code to make sure they are
// local to the parent and not local to the iframe
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 = "<html>\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
示例4: MAX_commonSendContentTypeHeader
/*
+---------------------------------------------------------------------------+
| Revive Adserver |
| http://www.revive-adserver.com |
| |
| Copyright: See the COPYRIGHT.txt file. |
| License: GPLv2 or later, see the LICENSE.txt file. |
+---------------------------------------------------------------------------+
*/
// Require the initialisation file
require_once '../../init-delivery.php';
// Required files
require_once MAX_PATH . '/lib/max/Delivery/adSelect.php';
require_once MAX_PATH . '/lib/max/Delivery/flash.php';
require_once MAX_PATH . '/lib/max/Delivery/cache.php';
MAX_commonSendContentTypeHeader('text/html');
//Register any script specific input variables
MAX_commonRegisterGlobalsArray(array('timeout'));
$timeout = !empty($timeout) ? $timeout : 0;
if ($zoneid > 0) {
// Get the zone from cache
$aZone = MAX_cacheGetZoneInfo($zoneid);
} else {
// Direct selection, or problem with admin DB
$aZone = array();
$aZone['zoneid'] = $zoneid;
$aZone['append'] = '';
$aZone['prepend'] = '';
}
// Get the banner from cache
$aBanner = MAX_cacheGetAd($bannerid);
示例5: array
$output['context'][] = array('!=' => 'campaignid:' . $output['campaignid']);
}
}
if (!empty($blockcampaign) && !empty($output['campaignid'])) {
$output['context'][] = array('!=' => 'campaignid:' . $output['campaignid']);
}
if (!empty($output['context'])) {
foreach ($output['context'] as $id => $contextArray) {
if (!in_array($contextArray, $context)) {
$context[] = $contextArray;
}
}
}
$output['html'] .= !empty($context) ? "<script type='text/javascript'>document.context='" . MAX_commonPackContext($context) . "'; </script>" : '';
MAX_cookieFlush();
MAX_commonSendContentTypeHeader("text/javascript", $charset);
if (isset($output['contenttype']) && $output['contenttype'] == 'swf' && !isset($mmm_fo)) {
echo MAX_flashGetFlashObjectInline();
}
echo MAX_javascriptToHTML($output['html'], 'OX_' . substr(md5(uniqid('', 1)), 0, 8));
if (!empty($block) && !empty($output['bannerid'])) {
$varprefix = $GLOBALS['_MAX']['CONF']['var']['prefix'];
echo "\nif (document.{$varprefix}used) document.{$varprefix}_used += 'bannerid:" . $output['bannerid'] . ",';\n";
echo "\nif (document.MAX_used) document.MAX_used += 'bannerid:" . $output['bannerid'] . ",';\n";
echo "\nif (document.phpAds_used) document.phpAds_used += 'bannerid:" . $output['bannerid'] . ",';\n";
}
if (!empty($blockcampaign) && !empty($output['campaignid'])) {
$varprefix = $GLOBALS['_MAX']['CONF']['var']['prefix'];
echo "\nif (document.{$varprefix}used) document.{$varprefix}used += 'campaignid:" . $output['campaignid'] . ",';\n";
echo "\nif (document.MAX_used) document.MAX_used += 'campaignid:" . $output['campaignid'] . ",';\n";
echo "\nif (document.phpAds_used) document.phpAds_used += 'campaignid:" . $output['campaignid'] . ",';\n";