Exemplo n.º 1
0
}
$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'])) {
Exemplo n.º 2
0
$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('&#x91;', '&#x92;', '&#x93;', '&#x94;', '&#x20;', '&#x00;');
    $replace = array('&#x27;', '&#x27;', '&#x22;', '&#x22;', ' ', '_');
    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}>";
Exemplo n.º 3
0
    // 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
Exemplo n.º 4
0
/*
+---------------------------------------------------------------------------+
| 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);
Exemplo n.º 5
0
        $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";