} MAX_Delivery_log_logAdClick($adId[$i], $zoneId[$i]); MAX_Delivery_log_setLastAction($i, $adId, $zoneId, $lastClick, 'click'); } } } // Set the userid cookie MAX_cookieAdd($conf['var']['viewerId'], $viewerId, time() + $conf['cookie']['permCookieSeconds']); MAX_cookieFlush(); // Get the URL that we are going to redirect to $destination = MAX_querystringGetDestinationUrl($adId[0]); // Redirect to the destination url if (!empty($destination) && empty($_GET['trackonly'])) { // Prevent HTTP response split attacks if (!preg_match('/[\\r\\n]/', $destination)) { MAX_redirect($destination); } } function _getZoneAd($zoneId) { $conf = $GLOBALS['conf']; $zoneLinkedAds = MAX_cacheGetZoneLinkedAds($zoneId, false); if (!empty($zoneLinkedAds['xAds']) && count($zoneLinkedAds['xAds']) == 1) { list($adId, $ad) = each($zoneLinkedAds['xAds']); } elseif (!empty($zoneLinkedAds['ads']) && count($zoneLinkedAds['ads']) == 1) { list($adId, $ad) = each($zoneLinkedAds['ads']); } elseif (!empty($zoneLinkedAds['lAds']) && count($zoneLinkedAds['lAds']) == 1) { list($adId, $ad) = each($zoneLinkedAds['lAds']); } if (!empty($ad['url'])) { // Store the destination URL to save querying the DB again
MAX_header('Content-type: video/quicktime; name=' . $filename); break; default: MAX_header('Content-type: image/' . $contenttype . '; name=' . $filename); break; } } echo $aCreative['contents']; } else { MAX_sendStatusCode(304); } } MAX_commonRegisterGlobalsArray(array('filename', 'contenttype')); if (!empty($filename)) { $aCreative = MAX_cacheGetCreative($filename); if (empty($aCreative) || !isset($aCreative['contents'])) { if ($conf['defaultBanner']['imageUrl'] != "") { MAX_redirect($conf['defaultBanner']['imageUrl']); } else { MAX_commonDisplay1x1(); } } else { MAX_imageServe($aCreative, $filename, $contenttype); } } else { if ($conf['defaultBanner']['imageUrl'] != "") { MAX_redirect($conf['defaultBanner']['imageUrl']); } else { MAX_commonDisplay1x1(); } }
// be logged here if ($conf['logging']['adImpressions']) { MAX_Delivery_log_logAdImpression($row['bannerid'], $zoneid); } // Redirect to the banner MAX_cookieAdd($conf['var']['vars'] . "[{$n}]", serialize($cookie)); MAX_cookieFlush(); if ($row['bannerid'] == '') { if ($row['default_banner_image_url'] != '') { // Show default banner image url MAX_redirect($row['default_banner_image_url']); } else { // Show 1x1 Gif, to ensure not broken image icon is shown. MAX_commonDisplay1x1(); } } else { MAX_redirect($creativeURL); } } else { MAX_cookieAdd($conf['var']['vars'] . "[{$n}]", 'DEFAULT'); MAX_cookieFlush(); // Show 1x1 Gif, to ensure not broken image icon is shown. MAX_commonDisplay1x1(); } // Run automaintenance, if needed if (!empty($GLOBALS['_MAX']['CONF']['maintenance']['autoMaintenance']) && empty($GLOBALS['_MAX']['CONF']['lb']['enabled'])) { if (MAX_cacheCheckIfMaintenanceShouldRun()) { include MAX_PATH . '/lib/OA/Maintenance/Auto.php'; OA_Maintenance_Auto::run(); } }
$adId = $aAdIds[$index]; // Log the ad impression, if required if ($GLOBALS['_MAX']['CONF']['logging']['adImpressions']) { MAX_Delivery_log_logAdImpression($adId, $aZoneIds[$index]); } if ($aAdIds[$index] == $adId) { // Set the capping cookies, if required MAX_Delivery_log_setAdLimitations($index, $aAdIds, $aCapAd); MAX_Delivery_log_setCampaignLimitations($index, $aCampaignIds, $aCapCampaign); MAX_Delivery_log_setLastAction($index, $aAdIds, $aZoneIds, $aSetLastSeen); if ($aZoneIds[$index] != 0) { MAX_Delivery_log_setZoneLimitations($index, $aZoneIds, $aCapZone); } } } } MAX_cookieFlush(); MAX_querystringConvertParams(); if (!empty($_REQUEST[$GLOBALS['_MAX']['CONF']['var']['dest']])) { MAX_redirect($_REQUEST[$GLOBALS['_MAX']['CONF']['var']['dest']]); } else { // Display a 1x1 pixel gif MAX_commonDisplay1x1(); } // Run automaintenance, if needed if (!empty($GLOBALS['_MAX']['CONF']['maintenance']['autoMaintenance']) && empty($GLOBALS['_MAX']['CONF']['lb']['enabled'])) { if (MAX_cacheCheckIfMaintenanceShouldRun()) { include MAX_PATH . '/lib/OA/Maintenance/Auto.php'; OA_Maintenance_Auto::run(); } }
// be logged here if ($conf['logging']['adImpressions']) { MAX_Delivery_log_logAdImpression($row['bannerid'], $zoneid); } // Redirect to the banner MAX_cookieAdd($conf['var']['vars'] . "[{$n}]", serialize($cookie)); MAX_cookieFlush(); if ($row['bannerid'] == '') { if ($row['default_banner_image_url'] != '') { // Show default banner image url MAX_redirect($row['default_banner_image_url']); } else { // Show 1x1 Gif, to ensure not broken image icon is shown. MAX_commonDisplay1x1(); } } else { MAX_redirect($row['html']); } } else { MAX_cookieAdd($conf['var']['vars'] . "[{$n}]", 'DEFAULT'); MAX_cookieFlush(); // Show 1x1 Gif, to ensure not broken image icon is shown. MAX_commonDisplay1x1(); } // Run automaintenance, if needed if (!empty($GLOBALS['_MAX']['CONF']['maintenance']['autoMaintenance']) && empty($GLOBALS['_MAX']['CONF']['lb']['enabled'])) { if (MAX_cacheCheckIfMaintenanceShouldRun()) { include MAX_PATH . '/lib/OA/Maintenance/Auto.php'; OA_Maintenance_Auto::run(); } }