Beispiel #1
0
/**
 * @package    MaxDelivery
 * @subpackage image
 *
 * This library defines functions that need to be available to
 * the ai delivery script
 *
 */
function MAX_imageServe($aCreative, $filename, $contenttype)
{
    // Check if the browser sent a If-Modified-Since header and if the image was
    // modified since that date
    if (!isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || $aCreative['t_stamp'] > strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
        MAX_header("Last-Modified: " . gmdate('D, d M Y H:i:s', $aCreative['t_stamp']) . ' GMT');
        if (isset($contenttype) && $contenttype != '') {
            switch ($contenttype) {
                case 'swf':
                    MAX_header('Content-type: application/x-shockwave-flash; name=' . $filename);
                    break;
                case 'dcr':
                    MAX_header('Content-type: application/x-director; name=' . $filename);
                    break;
                case 'rpm':
                    MAX_header('Content-type: audio/x-pn-realaudio-plugin; name=' . $filename);
                    break;
                case 'mov':
                    MAX_header('Content-type: video/quicktime; name=' . $filename);
                    break;
                default:
                    MAX_header('Content-type: image/' . $contenttype . '; name=' . $filename);
                    break;
            }
        }
        echo $aCreative['contents'];
    } else {
        // Send "Not Modified" status header
        MAX_sendStatusCode(304);
    }
}
Beispiel #2
0
function MAX_redirect($url)
{
    if (!preg_match('/^(?:javascript|data):/i', $url)) {
        $host = @parse_url($url, PHP_URL_HOST);
        if (function_exists('idn_to_ascii')) {
            $idn = idn_to_ascii($host);
            if ($host != $idn) {
                $url = preg_replace('#^(.*?://)' . preg_quote($host, '#') . '#', '$1' . $idn, $url);
            }
        }
        header('Location: ' . $url);
        MAX_sendStatusCode(302);
    }
}
function MAX_redirect($url)
{
    if (!preg_match('/^(?:javascript|data):/i', $url)) {
        header('Location: ' . $url);
        MAX_sendStatusCode(302);
    }
}
Beispiel #4
0
function MAX_redirect($url)
{
    header('Location: ' . $url);
    MAX_sendStatusCode(302);
}
Beispiel #5
0
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/javascript.php';
// No Caching
MAX_commonSetNoCacheHeaders();
//Register any script specific input variables
MAX_commonRegisterGlobalsArray(array('layerstyle'));
if (!isset($layerstyle) || empty($layerstyle)) {
    $layerstyle = 'geocities';
}
$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)) {
    // Don't generate output when plugin layerstyleisn't available,just send javascript comment on fail
    MAX_sendStatusCode(404);
    echo '// Cannot load required layerstyle file. Check if openXInvocationTags plugin is installed';
    exit;
}
//Register any script specific input variables
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']);