function MAX_layerGetHtml($output, $uniqid)
{
    global $transparent, $backcolor, $shiftv;
    // Register input variables
    MAX_commonRegisterGlobalsArray(array('transparent', 'backcolor', 'shiftv'));
    if (!isset($transparent)) {
        $transparent = 't';
    }
    if (!isset($backcolor)) {
        $backcolor = '#FFFFFF';
    }
    if (!isset($shiftv)) {
        $shiftv = '0';
    }
    // return HTML code
    return '<div id="MAX_' . $uniqid . '" style="position:absolute; width:' . $output['width'] . 'px; height:' . $output['height'] . 'px; z-index:99; left: 0px; top: ' . $shiftv . 'px; visibility: hidden; overflow: hidden' . ($transparent == 't' ? '' : '; background-color: "' . $backcolor . '; layer-background-color: "' . $backcolor) . '">' . $output['html'] . '</td></tr></table></div>';
}
function MAX_layerGetHtml($output, $uniqid)
{
    global $target;
    global $align, $collapsetime, $padding, $closetext;
    $conf = $GLOBALS['_MAX']['CONF'];
    // Register input variables
    MAX_commonRegisterGlobalsArray(array('align', 'collapsetime', 'padding', 'closetext'));
    if (!isset($padding)) {
        $padding = '2';
    }
    // Calculate layer size (inc. borders)
    $layer_width = $output['width'] + 4 + $padding * 2;
    $layer_height = $output['height'] + 30 + $padding * 2;
    // Create imagepath
    $imagepath = _adRenderBuildImageUrlPrefix() . '/layerstyles/geocities/';
    // return HTML code
    return '
<div id="MAX_c' . $uniqid . '" style="position:absolute; width:' . $layer_width . 'px; height:' . $layer_height . 'px; z-index:98; left: 0px; top: 0px; visibility: hidden">
	<table width="100%" border="1" cellspacing="0" cellpadding="0" style="border-style: ridge; border-color: #ffffff">
		<tr>
			<td bordercolor="#DDDDDD" bgcolor="#000099" align="right" style="padding: 3px 3px 2px">' . '<img src="' . $imagepath . 'expand.gif" alt="" style="width:12px;height:12px;margin: 0 3px;" onclick="MAX_geopop(\'expand\', \'' . $uniqid . '\')" />' . '<img src="' . $imagepath . 'close.gif" alt="" style="width:12px;height:12px;" onclick="MAX_geopop(\'close\', \'' . $uniqid . '\')" />' . '</td>
		</tr>
' . (strlen($output['url']) && strlen($output['alt']) ? '		<tr>
			<td bgcolor="#FFFFCC" align="center" style="font-family: Arial, helvetica, sans-serif; font-size: 11px; padding: 2px"><a href="' . $output['url'] . '" ' . (isset($target) ? 'target="' . $target . '"' : '') . 'style="color: #0000ff">' . $output['alt'] . '</a></td>
		</tr>
' : '') . '	</table>
</div>
<div id="MAX_o' . $uniqid . '" style="position:absolute; width:' . $layer_width . 'px; height:' . $layer_height . 'px; z-index:99; left: 0px; top: 0px; visibility: hidden">
	<table width="100%" border="1" cellspacing="0" cellpadding="0" style="border-style: outset; border-color: #ffffff">
		<tr>
			<td bordercolor="#DDDDDD" bgcolor="#000099" align="right" style="padding: 3px 3px 2px">' . '<img src="' . $imagepath . 'expand-d.gif" alt="" style="width:12px;height:12px;margin: 0 3px;" />' . '<img src="' . $imagepath . 'collapse.gif" alt="" style="width:12px;height:12px;" onclick="MAX_geopop(\'collapse\', \'' . $uniqid . '\')" />' . '</td>
		</tr>
		<tr>
			<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td align="center">
							<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
								<tr>
									<td width="' . $output['width'] . '" height="' . $output['height'] . '" align="center" valign="middle" style="padding: ' . $padding . 'px">' . $output['html'] . '</td>
								</tr>
							</table>
						</td>
					</tr>' . (strlen($closetext) ? '
					<tr>
						<td align="center" bgcolor="#FFFFFF" style="font-family: Arial, helvetica, sans-serif; font-size: 9px; padding: 1px">' . '<a href="#" onclick="MAX_geopop(\'collapse\', \'' . $uniqid . '\');return!1;" style="color:#0000ff">' . $closetext . '</a>' . '</td>
					</tr>' : '') . '
				</table>
			</td>
		</tr>
	</table>
</div>
';
}
 function _unsetMAXGlobals()
 {
     unset($GLOBALS['zoneid']);
     unset($GLOBALS['campaignid']);
     unset($GLOBALS['clientid']);
     unset($GLOBALS['bannerid']);
     unset($GLOBALS['what']);
     unset($GLOBALS['target']);
     unset($GLOBALS['charset']);
     unset($GLOBALS['withText']);
     unset($GLOBALS['withtext']);
     MAX_commonRegisterGlobalsArray(array('context', 'source', 'target', 'withText', 'withtext', 'ct0', 'what', 'loc', 'referer', 'zoneid', 'campaignid', 'bannerid', 'clientid', 'charset'));
 }
} else {
    $backURL = "plugin-index.php?selection=plugins";
}
// get the settings for this plugin
$oManager =& new OX_Plugin_ComponentGroupManager();
$aConfig = $oManager->_getComponentGroupConfiguration($group);
// If the settings page is a submission, deal with the form data
if (isset($_POST['submitok']) && $_POST['submitok'] == 'true') {
    // Prepare an array of the HTML elements to process, and the
    // location to save the values in the settings configuration
    // file
    $aElements = array();
    foreach ($aConfig['preferences'] as $k => $v) {
        $aElements[] = $group . '_' . $v['key'];
        // Register the HTML element value
        MAX_commonRegisterGlobalsArray(array($group . '_' . $v['key']));
    }
    $aCheckboxes = array();
    $valid = true;
    $validationFile = MAX_PATH . $GLOBALS['_MAX']['CONF']['pluginPaths']['packages'] . $group . '/processPreferences.php';
    if (file_exists($validationFile)) {
        $className = $group . '_processPreferences';
        include $validationFile;
        if (class_exists($className)) {
            $oPlugin = new $className();
            if (method_exists($oPlugin, 'validate')) {
                $aErrormessage = array();
                $valid = $oPlugin->validate($aErrormessage);
            }
        }
    }
Example #5
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);
$prepend = !empty($aZone['prepend']) ? $aZone['prepend'] : '';
$html = MAX_adRender($aBanner, $zoneid, $source, $target, $ct0, $withtext);
 // file
 $aElements = array();
 // Banner Delivery Cache Settings
 $aElements += array('delivery_cacheExpire' => array('delivery' => 'cacheExpire'), 'delivery_cacheStorePlugin' => array('delivery' => 'cacheStorePlugin'));
 // Banner Delivery Settings
 $aElements += array('delivery_acls' => array('delivery' => 'acls', 'bool' => true), 'delivery_aclsDirectSelection' => array('delivery' => 'aclsDirectSelection', 'bool' => true), 'delivery_obfuscate' => array('delivery' => 'obfuscate', 'bool' => true), 'delivery_execPhp' => array('delivery' => 'execPhp', 'bool' => true), 'delivery_ctDelimiter' => array('delivery' => 'ctDelimiter'), 'defaultBanner_imageUrl' => array('defaultBanner' => 'imageUrl'));
 // Invocation Defaults
 $aElements += array('delivery_clicktracking' => array('delivery' => 'clicktracking'));
 // P3P Privacy Policies
 $aElements += array('p3p_policies' => array('p3p' => 'policies', 'bool' => true), 'p3p_compactPolicy' => array('p3p' => 'compactPolicy'), 'p3p_policyLocation' => array('p3p' => 'policyLocation'));
 // OpenX Server Access Paths
 $aElements += array('webpath_admin' => array('webpath' => 'admin', 'preg_match' => '#/$#', 'preg_replace' => ''), 'webpath_delivery' => array('webpath' => 'delivery', 'preg_match' => '#/$#', 'preg_replace' => ''), 'webpath_deliverySSL' => array('webpath' => 'deliverySSL', 'preg_match' => '#/$#', 'preg_replace' => ''), 'webpath_images' => array('webpath' => 'images', 'preg_match' => '#/$#', 'preg_replace' => ''), 'webpath_imagesSSL' => array('webpath' => 'imagesSSL', 'preg_match' => '#/$#', 'preg_replace' => ''));
 // Delivery File Names
 $aElements += array('file_click' => array('file' => 'click'), 'file_conversionvars' => array('file' => 'conversionvars'), 'file_content' => array('file' => 'content'), 'file_conversion' => array('file' => 'conversion'), 'file_conversionjs' => array('file' => 'conversionjs'), 'file_frame' => array('file' => 'frame'), 'file_image' => array('file' => 'image'), 'file_js' => array('file' => 'js'), 'file_layer' => array('file' => 'layer'), 'file_log' => array('file' => 'log'), 'file_popup' => array('file' => 'popup'), 'file_view' => array('file' => 'view'), 'file_xmlrpc' => array('file' => 'xmlrpc'), 'file_local' => array('file' => 'local'), 'file_frontcontroller' => array('file' => 'frontcontroller'), 'file_flash' => array('file' => 'flash'), 'file_singlepagecall' => array('file' => 'singlepagecall'), 'file_spcjs' => array('file' => 'spcjs'));
 // Test the suitability of the cache store type, if required
 MAX_commonRegisterGlobalsArray(array('delivery_cacheStorePlugin'));
 if (isset($delivery_cacheStorePlugin)) {
     // Check for problems in selected delivery store plugin
     $oDeliveryCacheStore =& OX_Component::factoryByComponentIdentifier($delivery_cacheStorePlugin);
     $result = $oDeliveryCacheStore->getStatus();
     if ($result !== true) {
         $aErrormessage[1][] = $oTranslation->translate('ErrorInCacheStorePlugin', array($oDeliveryCacheStore->getName()));
         foreach ($result as $error) {
             $aErrormessage[1][] = " - " . $error;
         }
     }
 }
 if (empty($aErrormessage)) {
     // Create a new settings object, and save the settings!
     $oSettings = new OA_Admin_Settings();
     $result = $oSettings->processSettingsFromForm($aElements);
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
// Define constant used to place code generator
define('phpAds_adLayerLoaded', true);
// Register input variables
MAX_commonRegisterGlobalsArray(array('target', 'align', 'padding', 'closebutton', 'backcolor', 'bordercolor', 'valign', 'closetime', 'shifth', 'shiftv', 'nobg', 'noborder'));
/**
 *
 * Layerstyle for invocation tag plugin
 *
 */
class Plugins_oxInvocationTags_Adlayer_Layerstyles_Simple_Invocation extends Plugins_InvocationTags_OxInvocationTags_adlayer
{
    /*-------------------------------------------------------*/
    /* Place ad-generator settings                           */
    /*-------------------------------------------------------*/
    function placeLayerSettings()
    {
        global $align, $valign, $closetime, $padding;
        global $shifth, $shiftv, $closebutton;
        global $backcolor, $bordercolor;
        global $nobg, $noborder;
Example #8
0
/**
 * Register an array of variable names in the global scope
 *
 * Note: This is now a wrapper to the delivery engine's equivalent function
 *
 */
function phpAds_registerGlobal()
{
    $args = func_get_args();
    MAX_commonRegisterGlobalsArray($args);
}
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
// Required files
// Define constant used to place code generator
define('phpAds_adLayerLoaded', true);
// Register input variables
MAX_commonRegisterGlobalsArray(array('ltr', 'loop', 'speed', 'pause', 'shiftv', 'transparent', 'backcolor', 'limited', 'lmargin', 'rmargin'));
/**
 *
 * Layerstyle for invocation tag plugin
 *
 */
class Plugins_oxInvocationTags_Adlayer_Layerstyles_Floater_Invocation extends Plugins_InvocationTags_OxInvocationTags_adlayer
{
    /*-------------------------------------------------------*/
    /* Place ad-generator settings                           */
    /*-------------------------------------------------------*/
    function placeLayerSettings()
    {
        global $ltr, $loop, $speed, $pause, $shiftv, $transparent, $backcolor;
        global $limited, $lmargin, $rmargin;
        global $tabindex;
<?php

require_once '../../../../init.php';
require_once '../../config.php';
require_once MAX_PATH . '/lib/OA/Admin/TemplatePlugin.php';
$inputVariables = array('entity', 'entityId', 'startDate', 'endDate', 'dimension', 'exportCsv', 'showAs', 'expandId');
MAX_commonRegisterGlobalsArray($inputVariables);
PEAR::pushErrorHandling(null);
require_once 'stats-api.php';
require_once 'stats-debug.php';
include_once 'lib/SmartyFunctions/function.url.php';
include_once 'lib/SmartyFunctions/modifier.formatNumber.php';
include_once 'VastAreaGraph.php';
include_once 'VastMultiAreaGraph.php';
// Entity
$availableEntities = array('advertiser', 'campaign', 'banner', 'website', 'zone');
if (!in_array($entity, $availableEntities)) {
    exit("Invalid input parameters");
}
$entityToRequiredAccess = array('advertiser' => 'clients', 'campaign' => 'campaigns', 'banner' => 'banners', 'website' => 'affiliates', 'zone' => 'zones');
OA_Permission::enforceAccessToObject($entityToRequiredAccess[$entity], $entityId);
$entityId = (int) $entityId;
$startDate = urlencode($startDate);
$endDate = urlencode($endDate);
// "Show as" dropdown
$availableShowAs = array('table' => "Table", 'graph-percentage' => "Graph (% of views)", 'graph-count' => "Graph (# of views)");
if (empty($showAs) || !isset($availableShowAs[$showAs])) {
    $showAs = 'table';
}
$selectedShowAs = $showAs;
// "View by" dimension
Example #11
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';
// No Caching
MAX_commonSetNoCacheHeaders();
//Register any script specific input variables
MAX_commonRegisterGlobalsArray(array('left', 'top', 'popunder', 'timeout', 'delay', 'toolbars', 'location', 'menubar', 'status', 'resizable', 'scrollbars'));
// Set defaults for script specific input variables
if (!isset($left)) {
    $left = 0;
}
if (!isset($top)) {
    $top = 0;
}
if (!isset($popunder)) {
    $popunder = 0;
}
if (!isset($timeout)) {
    $timeout = 0;
}
if (!isset($delay)) {
    $delay = 0;
Example #12
0
| 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/cache.php';
require_once MAX_PATH . '/lib/max/Delivery/javascript.php';
require_once MAX_PATH . '/lib/max/Delivery/tracker.php';
// No Caching
MAX_commonSetNoCacheHeaders();
//Register any script specific input variables
MAX_commonRegisterGlobalsArray(array('trackerid', 'inherit', 'append'));
if (empty($trackerid)) {
    $trackerid = 0;
}
$conversionsid = NULL;
$variablesScript = '';
MAX_commonSendContentTypeHeader("application/x-javascript", $charset);
// Log the tracker impression
$logVars = false;
$aConversion = $aConversionInfo = array();
if ($conf['logging']['trackerImpressions']) {
    // Only log and gather variable data if this conversion connects back
    $aConversion = MAX_trackerCheckForValidAction($trackerid);
    if (!empty($aConversion)) {
        $aConversionInfo = MAX_Delivery_log_logConversion($trackerid, $aConversion);
        // Generate code required to send variable values to the {$conf['file']['conversionvars']} script
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
// Define constant used to place code generator
define('phpAds_adLayerLoaded', true);
// Register input variables
MAX_commonRegisterGlobalsArray(array('stickyness', 'offsetx', 'offsety', 'hide', 'transparancy', 'delay', 'trail'));
/**
 *
 * Layerstyle for invocation tag plugin
 *
 */
class Plugins_oxInvocationTags_Adlayer_Layerstyles_Cursor_Invocation extends Plugins_InvocationTags_OxInvocationTags_adlayer
{
    /*-------------------------------------------------------*/
    /* Place ad-generator settings                           */
    /*-------------------------------------------------------*/
    function placeLayerSettings()
    {
        global $stickyness, $offsetx, $offsety, $hide, $transparancy, $delay, $trail;
        global $tabindex;
        if (!isset($trail)) {
            $trail = '0';
    $time = $GLOBALS['_MAX']['NOW'];
    return $time;
}
function bumpVastEventTrackingBucketCounter($data)
{
    $aQuery = array('interval_start' => $data['interval_start'], 'creative_id' => $data['creative_id'], 'zone_id' => $data['zone_id'], 'vast_event_id' => $data['vast_event_id']);
    return OX_bucket_updateTable('data_bkt_vast_e', $aQuery);
}
###START_STRIP_DELIVERY
OX_Delivery_logMessage('starting delivery script ' . __FILE__, 7);
###END_STRIP_DELIVERY
MAX_commonRegisterGlobalsArray(array('vast_event'));
// if its a vast tracking event
if ($vast_event) {
    // NB: videotimeposn is not yet supported by the player
    MAX_commonRegisterGlobalsArray(array('video_time_posn', 'banner_id', 'zone_id'));
    // Prevent the logging beacon from being cached by browsers
    MAX_commonSetNoCacheHeaders();
    // Remove any special characters from the request variables
    MAX_commonRemoveSpecialChars($_REQUEST);
    $time = getTimeNow();
    $oi = $GLOBALS['_MAX']['CONF']['maintenance']['operationInterval'];
    $intervalStart = gmdate('Y-m-d H:i:s', $time - $time % ($oi * 60));
    $viewerIsOkToLog = _viewersHostOkayToLog();
    $aQuery = array('creative_id' => intVal($banner_id), 'zone_id' => intVal($zone_id), 'vast_event_id' => getVastEventIdFromVastEventStr($vast_event), 'interval_start' => $intervalStart, 'is_host_ok' => $viewerIsOkToLog);
    if ($viewerIsOkToLog) {
        bumpVastEventTrackingBucketCounter($aQuery);
    }
    if (!empty($_REQUEST[$GLOBALS['_MAX']['CONF']['var']['dest']])) {
        MAX_redirect($_REQUEST[$GLOBALS['_MAX']['CONF']['var']['dest']]);
        exit;
Example #15
0
| 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/javascript.php';
MAX_commonSetNoCacheHeaders();
/*-------------------------------------------------------*/
/* Register input variables                              */
/*-------------------------------------------------------*/
MAX_commonRegisterGlobalsArray(array('zones', 'source', 'block', 'blockcampaign', 'exclude', 'q', 'prefix'));
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
// Derive the source parameter
$source = MAX_commonDeriveSource($source);
$spc_output = array();
if (!empty($zones)) {
    $zones = explode('|', $zones);
    foreach ($zones as $id => $thisZoneid) {
        $zonename = $prefix . $id;
        // Clear deiveryData between iterations
        unset($GLOBALS['_MAX']['deliveryData']);
        $what = 'zone:' . $thisZoneid;
        // Get the banner
        $output = MAX_adSelect($what, $clientid, $target, $source, $withtext, $charset, $context, true, $ct0, $GLOBALS['loc'], $GLOBALS['referer']);
Example #16
0
 /**
  * Build and display the settings or preferences user interface
  *
  * @param array $aData A multi-dimensional array outlining what to
  *                     display for a setting or preference page.
  *                     See pages for examples of layout.
  * @param array   $aErrors An array of error messages to display to
  *                         within the form.
  * @param integer $disableSubmit
  * @param string  $imgPath
  */
 function show($aData, $aErrors = array(), $disableSubmit = 0, $imgPath = "")
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     $aPref = $GLOBALS['_MAX']['PREF_EXTRA'];
     // Initialize tabindex (if not already done)
     global $tabindex;
     if (!isset($tabindex)) {
         $tabindex = 1;
     }
     // Determine if config file is writable
     $configLocked = !OA_Admin_Settings::isConfigWritable();
     $image = $configLocked ? 'closed' : 'open';
     $dependbuffer = "function phpAds_refreshEnabled() {\n";
     $checkbuffer = '';
     $usertypebuffer = '';
     $helpbuffer = '';
     // Iterate over the array of elements to display
     $count = count($aData);
     for ($i = 0; $i < $count; $i++) {
         // Get the section of elements to display
         $aSection = $aData[$i];
         // Are there any items in the section that can be displayed?
         $showBreak = false;
         $showSection = false;
         foreach ($aSection['items'] as $itemKey => $aItem) {
             // The item has been set to be displayed - however, if this is
             // a preference section, it may not end up being shown, so test for this
             if ($this->_optionType == 'account-preferences') {
                 // Don't test break items
                 if ($aItem['type'] != 'break') {
                     // What is the state of the preference item?
                     $result = $this->_hideOrDisablePreference($aPref[$aItem['name']]['account_type']);
                     if ($result == '' || $result == 'disable') {
                         // The preference item is to be shown, so display the section
                         $showSection = true;
                         break;
                     }
                 }
             } else {
                 // The item is not for a preference section, so display the section
                 $showSection = true;
                 break;
             }
         }
         // Where there any items in the section that will be displayed?
         if ($showSection == false) {
             // No, go to the next section
             continue;
         }
         // This section has been set to be displayed, so show its contents!
         if (isset($aErrors[$i])) {
             // Show the section header with the section error
             $this->_showStartSection($aSection['text'], $aErrors[$i], $disableSubmit, $imgPath);
             $showBreak = true;
         } else {
             // Show the section header
             $this->_showStartSection($aSection['text'], NULL, $disableSubmit, $imgPath);
         }
         $sectionHasRequiredField = false;
         foreach ($aSection['items'] as $aItem) {
             // Test to see if the item is a preference item, and if it needs to be hidden from the account in use
             if ($this->_optionType == 'account-preferences' || $this->_optionType == 'account-user') {
                 $result = $this->_hideOrDisablePreference($aPref[$aItem['name']]['account_type']);
                 if ($result == 'hide') {
                     $aItem['visible'] = false;
                 }
             }
             // Only display visible items
             if (!isset($aItem['visible']) || $aItem['visible']) {
                 // Test to see if the item is a settings item, and if it needs to be disabled
                 if ($this->_optionType == 'account-settings') {
                     if (!$aItem['disabled']) {
                         $aItem['disabled'] = $this->_disabledValue($aItem);
                         if (!$aItem['disabled']) {
                             $showBreak = true;
                         }
                     }
                 }
                 // Test to see if the item is a preference item, and if it needs to be disabled from the account in use
                 if ($this->_optionType == 'account-preferences' || $this->_optionType == 'account-user') {
                     $result = $this->_hideOrDisablePreference($aPref[$aItem['name']]['account_type']);
                     if ($result == 'disable') {
                         $aItem['disabled'] = true;
                         $showBreak = false;
                     }
                 }
                 // Update the JavaScript used to enable/disabled option items
                 if (($this->_optionType == 'account-preferences' || $this->_optionType == 'account-preferences-user') && $aItem['type'] == 'statscolumns') {
                     // The statscolumns data type needs to have some conversion work done to match
                     // the more simple data structure used by other option items
                     foreach ($aItem['rows'] as $aSubItem) {
                         // Create two fake items for the label and rank
                         $aLabelItem = array('name' => $aSubItem['name'] . '_label', 'depends' => $aSubItem['name'] . '==true');
                         $aRankItem = array('name' => $aSubItem['name'] . '_rank', 'depends' => $aSubItem['name'] . '==true', 'check' => 'wholeNumber');
                         $checkbuffer .= "max_formSetRequirements('" . $aSubItem['name'] . '_rank' . "', '" . addslashes($aSubItem['text']) . "', false, 'wholeNumber');\n";
                         // Add the fake item dependencies
                         $dependbuffer .= $this->_showCheckDependancies($aData, $aLabelItem);
                         $dependbuffer .= $this->_showCheckDependancies($aData, $aRankItem);
                     }
                 } else {
                     if (!$aItem['disabled']) {
                         $dependbuffer .= $this->_showCheckDependancies($aData, $aItem);
                     }
                 }
                 // Display the option item
                 if (count($aErrors)) {
                     // Page is the result of an error message, get values from the input,
                     // not from the settings configuration file or preferences in the database
                     $value = '';
                     if (isset($aItem['name'])) {
                         MAX_commonRegisterGlobalsArray(array($aItem['name']));
                         if (isset($GLOBALS[$aItem['name']])) {
                             $value = stripslashes($GLOBALS[$aItem['name']]);
                             if ($aErrors[0] != MAX_ERROR_YOU_HAVE_NO_TRACKERS && $aErrors[0] != MAX_ERROR_YOU_HAVE_NO_CAMPAIGNS) {
                                 if (isset($GLOBALS[$aItem['name'] . '_defVal'])) {
                                     $value = $GLOBALS[$aItem['name'] . '_defVal'];
                                 }
                             }
                         }
                     }
                     if ($aItem[type] != 'break') {
                         $showBreak = true;
                     }
                 } else {
                     // The page had no error, so, get the value for the item from an appropriate source
                     unset($value);
                     if (isset($aItem['name'])) {
                         // Try to load the item value from the globals array
                         if (isset($GLOBALS[$aItem['name'] . '_defVal'])) {
                             $value = $GLOBALS[$aItem['name'] . '_defVal'];
                         }
                         // If that did not work, and the item is a setting, try to load the
                         // item value from the settings configuration file
                         if (is_null($value) && $this->_optionType == 'account-settings') {
                             $aNameExploded = explode('_', $aItem['name']);
                             $aSettingSection = isset($aNameExploded[0]) ? $aNameExploded[0] : null;
                             $aSettingKey = isset($aNameExploded[1]) ? $aNameExploded[1] : null;
                             if (isset($aConf[$aSettingSection][$aSettingKey])) {
                                 // Load the configuration .php file value
                                 $value = $aConf[$aSettingSection][$aSettingKey];
                             } elseif (isset($aConf[$aItem['name']][0])) {
                                 // The value in the settings configuration file is an array,
                                 // so re-constitute into a comma separated list
                                 $value = implode(', ', $aConf[$aItem['name']]);
                             }
                         }
                         // toggle the checkbox if a local db socket is being used
                         if ($aSettingSection == 'database' && $aItem['name'] == 'database_localsocket') {
                             $value = $aConf[$aSettingSection]['protocol'] == 'unix' ? true : false;
                         }
                         // toggle the checkbox if checkForUpdates (sync section) is disabled
                         if ($aSettingSection == 'ui' && $aItem['name'] == 'ui_dashboardEnabled') {
                             if (isset($aConf['sync']['checkForUpdates']) && $aConf['sync']['checkForUpdates'] == true) {
                                 $value = $aConf[$aSettingSection][$aSettingKey];
                             } else {
                                 $value = false;
                             }
                         }
                         // If that did not work, and the item is a preference, try to load the
                         // item value from the preferences values in the database
                         if (is_null($value) && $this->_optionType == 'account-preferences') {
                             // Deal with statistics column values separately
                             if ($aItem['type'] == 'statscolumns') {
                                 foreach ($aItem['rows'] as $key => $aRow) {
                                     if (isset($aPref[$aRow['name']]['value'])) {
                                         $value[$aRow['name']]['base'] = $aPref[$aRow['name']]['value'];
                                     }
                                     if (isset($aPref[$aRow['name'] . '_label']['value'])) {
                                         $value[$aRow['name']]['label'] = $aPref[$aRow['name'] . '_label']['value'];
                                     }
                                     if (isset($aPref[$aRow['name'] . '_rank']['value'])) {
                                         $value[$aRow['name']]['rank'] = $aPref[$aRow['name'] . '_rank']['value'];
                                     }
                                 }
                             } else {
                                 if (isset($aPref[$aItem['name']]['value'])) {
                                     $value = $aPref[$aItem['name']]['value'];
                                 }
                             }
                         }
                         // If that did not work, try to load the value from the $aItem array itself
                         if (is_null($value)) {
                             if (isset($aItem['value'])) {
                                 $value = $aItem['value'];
                             }
                         }
                         // If that did not work, set to an empty string
                         if (is_null($value)) {
                             $value = '';
                         }
                     }
                     if (!empty($value) && isset($aItem['preg_split']) && isset($aItem['merge'])) {
                         $aValues = preg_split($aItem['preg_split'], $value);
                         $value = implode($aItem['merge'], $aValues);
                     }
                     if ($aItem[type] != 'break') {
                         $showBreak = true;
                     }
                 }
                 // Display the item!
                 switch ($aItem['type']) {
                     case 'plaintext':
                         $this->_showPlainText($aItem);
                         break;
                     case 'break':
                         if ($showBreak) {
                             $this->_showBreak($aItem, $imgPath);
                             $showBreak = false;
                         }
                         break;
                     case 'checkbox':
                         $this->_showCheckbox($aItem, $value);
                         break;
                     case 'text':
                         $this->_showText($aItem, $value);
                         break;
                     case 'url':
                         $this->_showUrl($aItem, $value);
                         break;
                     case 'urln':
                         $this->_showUrl($aItem, $value, 'n');
                         break;
                     case 'urls':
                         $this->_showUrl($aItem, $value, 's');
                         break;
                     case 'textarea':
                         $this->_showTextarea($aItem, $value);
                         break;
                     case 'password':
                         $this->_showPassword($aItem, $value);
                         break;
                     case 'select':
                         $this->_showSelect($aItem, $value, $disableSubmit);
                         break;
                     case 'statscolumns':
                         $this->_showStatsColumns($aItem, $value);
                         break;
                     case 'hiddenfield':
                         $this->_showHiddenField($aItem, $value);
                         break;
                     case 'hiddencheckbox':
                         $this->_showHiddenCheckbox($aItem, $value);
                         break;
                 }
                 // ???
                 if (isset($aItem['req'])) {
                     $sectionHasRequiredField = true;
                 }
                 if (isset($aItem['check']) || isset($aItem['req'])) {
                     if (!isset($aItem['check'])) {
                         $aItem['check'] = '';
                     }
                     if (!isset($aItem['req'])) {
                         $aItem['req'] = false;
                     }
                     $checkbuffer .= "max_formSetRequirements('" . $aItem['name'] . "', '" . addslashes($aItem['text']) . "', " . ($aItem['req'] ? 'true' : 'false') . ", '" . $aItem['check'] . "');\n";
                     if (isset($aItem['unique'])) {
                         $checkbuffer .= "max_formSetUnique('" . $aItem['name'] . "', '|" . addslashes(implode('|', $aItem['unique'])) . "|');\n";
                     }
                 }
                 if (isset($aItem['name'])) {
                     $helpbuffer .= $this->_help($aItem['name']);
                 }
             }
         }
         $this->_showEndSection($sectionHasRequiredField);
     }
     if (OA_INSTALLATION_STATUS == OA_INSTALLATION_STATUS_INSTALLED) {
         if ($disableSubmit != 0) {
             $max_file_size = $this->_display_to_bytes(ini_get('upload_max_filesize'));
             $max_post_size = $this->_display_to_bytes(ini_get('post_max_size'));
             if ($max_post_size > 0 && $max_post_size < $max_file_size) {
                 $max_file_size = $max_post_size;
             }
             $this->oTpl->assign('max_file_size', $max_file_size);
             $this->oTpl->assign('max_post_size', $max_post_size);
         }
     }
     $this->oTpl->assign('this', $this);
     $this->oTpl->assign('aOption', $this->aOption);
     $this->oTpl->assign('configLocked', $configLocked);
     $this->oTpl->assign('image', $image);
     $this->oTpl->assign('formUrl', $_SERVER['PHP_SELF']);
     $this->oTpl->assign('checkbuffer', $checkbuffer);
     $this->oTpl->assign('dependbuffer', $dependbuffer);
     $this->oTpl->assign('disableSubmit', $disableSubmit);
     $this->oTpl->assign('usertypebuffer', $usertypebuffer);
     $this->oTpl->assign('tabindex', $tabindex);
     $this->oTpl->assign('section', $aSettingSection);
     $this->oTpl->assign('optionType', $this->_optionType);
     $this->oTpl->assign('adminUser', OA_Permission::isAccount(OA_ACCOUNT_ADMIN));
     $this->oTpl->assign('oxInstalled', OA_INSTALLATION_STATUS == OA_INSTALLATION_STATUS_INSTALLED);
     $this->oTpl->display();
 }
Example #17
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';
// No Caching
MAX_commonSetNoCacheHeaders();
// Register any script specific input variables
MAX_commonRegisterGlobalsArray(array('n'));
if (!isset($n)) {
    $n = 'default';
}
$richMedia = false;
// This is an image tag - we only need the filename (or URL?) of the image...
$target = '';
// Target cannot be dynamically set in basic tags.
$context = array();
// I don't think that $context is valid in adview.php...
$ct0 = '';
// Click tracking should be done using external tags rather than this way...
$withText = 0;
// Cannot write text using a simple tag...
$row = MAX_adSelect($what, $campaignid, $target, $source, $withText, $charset, $context, $richMedia, $ct0, $loc, $referer);
if (!empty($row['html'])) {
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
/*
 * NOTE: If this list of event ever changes (IDs or names), the Video Reports must be updated as well
 */
$aVastEventStrToIdMap = array('start' => 1, 'midpoint' => 2, 'firstquartile' => 3, 'thirdquartile' => 4, 'complete' => 5, 'mute' => 6, 'replay' => 7, 'fullscreen' => 8, 'stop' => 9, 'unmute' => 10, 'resume' => 11, 'pause' => 12);
MAX_commonRegisterGlobalsArray(array('event', 'video_time_posn'));
// Prevent the logging beacon from being cached by browsers
MAX_commonSetNoCacheHeaders();
// if its a vast tracking event
if (!empty($bannerid) && isset($aVastEventStrToIdMap[$event])) {
    // Remove any special characters from the request variables
    MAX_commonRemoveSpecialChars($_REQUEST);
    $time = MAX_commonGetTimeNow();
    $oi = $GLOBALS['_MAX']['CONF']['maintenance']['operationInterval'];
    $GLOBALS['_MAX']['deliveryData'] = array('interval_start' => gmdate('Y-m-d H:i:s', $time - $time % ($oi * 60)), 'creative_id' => (int) $bannerid, 'zone_id' => (int) $zoneid, 'vast_event_id' => $aVastEventStrToIdMap[$event]);
    OX_Delivery_Common_hook('logImpressionVast', array($bannerid, $zoneid, _viewersHostOkayToLog()));
}
MAX_cookieFlush();
MAX_commonDisplay1x1();
Example #19
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/cache.php';
require_once MAX_PATH . '/lib/max/Delivery/image.php';
//Register any script specific input variables
MAX_commonRegisterGlobalsArray(array('filename', 'contenttype'));
if (!empty($filename)) {
    $aCreative = MAX_cacheGetCreative($filename);
    if (empty($aCreative) || !isset($aCreative['contents'])) {
        // Filename not found, show the admin user's default banner
        // (as the agency cannot be determined from a filename)
        if ($conf['defaultBanner']['imageUrl'] != "") {
            MAX_redirect($conf['defaultBanner']['imageUrl']);
        } else {
            MAX_commonDisplay1x1();
        }
    } else {
        // Filename found, dump contents to browser
        MAX_imageServe($aCreative, $filename, $contenttype);
    }
} else {
function MAX_layerGetHtml($output, $uniqid)
{
    global $target;
    global $align, $padding, $closebutton;
    global $backcolor, $bordercolor;
    global $nobg, $noborder;
    $conf = $GLOBALS['_MAX']['CONF'];
    // Register input variables
    MAX_commonRegisterGlobalsArray(array('align', 'padding', 'closebutton', 'backcolor', 'bordercolor', 'nobg', 'noborder'));
    if (!isset($padding)) {
        $padding = '2';
    }
    if (!isset($closebutton)) {
        $closebutton = 'f';
    }
    if (!isset($backcolor)) {
        $backcolor = 'FFFFFF';
    }
    if (!isset($bordercolor)) {
        $bordercolor = '000000';
    }
    if (!isset($nobg)) {
        $nobg = 'f';
    }
    if (!isset($noborder)) {
        $noborder = 'f';
    }
    // Calculate layer size (inc. borders)
    $layer_width = $output['width'] + 2 + $padding * 2;
    $layer_height = $output['height'] + 2 + ($closebutton == 't' ? 11 : 0) + $padding * 2;
    // Create imagepath
    $imagepath = 'http://' . $conf['webpath']['images'] . '/layerstyles/simple/';
    // return HTML code
    return '
<div id="MAX_' . $uniqid . '" style="position:absolute; width:' . $layer_width . 'px; height:' . $layer_height . 'px; z-index:99; left: 0px; top: 0px; visibility: hidden">
	<table cellspacing="0" cellpadding="0"' . ($noborder == 't' ? '' : ' style="border-style: solid; border-width: 1px; border-color: #' . $bordercolor . '"') . '>
' . ($closebutton == 't' ? '		<tr>
			<td' . ($nobg == 't' ? '' : ' bgcolor="#' . $backcolor . '"') . ' align="right" style="padding: 2px"><a href="javascript:;" onClick="MAX_simplepop_' . $uniqid . '(\'close\'); return false;" style="color:#0000ff"><img src="' . $imagepath . 'close.gif" width="7" height="7" alt="Close" border="0"></a></td>
		</tr>
' : '') . '		<tr>
			<td ' . ($nobg == 't' ? '' : ' bgcolor="#' . $backcolor . '"') . ' align="center">
				<table border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="' . $output['width'] . '" height="' . $output['height'] . '" align="center" valign="middle" style="padding: ' . $padding . 'px">' . $output['html'] . '</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</div>
';
}
Example #21
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';
// No Caching
MAX_commonSetNoCacheHeaders();
//Register any script specific input variables
MAX_commonRegisterGlobalsArray(array('zones', 'block', 'blockcampaign', 'nz'));
if (isset($context) && !is_array($context)) {
    $context = MAX_commonUnpackContext($context);
}
if (!is_array($context)) {
    $context = array();
}
$useMultipleZones = false;
if (empty($zones)) {
    $zones = $zoneid;
} else {
    $useMultipleZones = true;
}
$aBanners = array();
$zones = explode('|', $zones);
foreach ($zones as $thisZone) {
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
// Define constant used to place code generator
define('phpAds_adLayerLoaded', true);
// Register input variables
MAX_commonRegisterGlobalsArray(array('align', 'collapsetime', 'padding', 'closetext'));
/**
 *
 * Layerstyle for invocation tag plugin
 *
 */
class Plugins_oxInvocationTags_Adlayer_Layerstyles_Geocities_Invocation extends Plugins_InvocationTags_OxInvocationTags_adlayer
{
    /*-------------------------------------------------------*/
    /* Place ad-generator settings                           */
    /*-------------------------------------------------------*/
    function placeLayerSettings()
    {
        global $align, $collapsetime, $padding, $closetext;
        global $tabindex;
        if (!isset($align)) {
            $align = 'right';
 *    Copyright (c) 2009 Bouncing Minds - Option 3 Ventures Limited
 *
 *    This file is part of the Regions plug-in for Flowplayer.
 *
 *    The Regions plug-in is free software: you can redistribute it
 *    and/or modify it under the terms of the GNU General Public License
 *    as published by the Free Software Foundation, either version 3 of
 *    the License, or (at your option) any later version.
 *
 *    The Regions plug-in is distributed in the hope that it will be
 *    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with the plug-in.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * @package    Plugin
 * @subpackage vastServeVideoPlayer
 */
MAX_commonRegisterGlobalsArray(array('file_to_serve'));
if ($file_to_serve && strpos($file_to_serve, '..') === false) {
    $pwd = dirname(__FILE__);
    if (strpos($file_to_serve, 'swf') !== false) {
        header("content-type: application/x-shockwave-flash");
    }
    echo file_get_contents($pwd . '/' . $file_to_serve);
} else {
    echo "no 'file_to_serve' parameter supplied";
}
Example #24
0
| 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/cache.php';
require_once MAX_PATH . '/lib/max/Delivery/javascript.php';
require_once MAX_PATH . '/lib/max/Delivery/tracker.php';
// No Caching
MAX_commonSetNoCacheHeaders();
//Register any script specific input variables
MAX_commonRegisterGlobalsArray(array('trackerid'));
if (empty($trackerid)) {
    $trackerid = 0;
}
// Log the tracker impression
if ($conf['logging']['trackerImpressions']) {
    $aConversion = MAX_trackerCheckForValidAction($trackerid);
    if (!empty($aConversion)) {
        $aConversionInfo = MAX_Delivery_log_logConversion($trackerid, $aConversion);
        foreach ($aConversionInfo as $pluginId => $aData) {
            $serverConvId = $serverRawIp = null;
            if (isset($aData['server_conv_id'])) {
                $serverConvId = $aData['server_conv_id'];
            }
            if (isset($aData['server_raw_ip'])) {
                $serverRawIp = $aData['server_raw_ip'];
Example #25
0
MAX_commonSetNoCacheHeaders();
//Register any script specific input variables
MAX_commonRegisterGlobalsArray(array('layerstyle'));
if (!isset($layerstyle) || empty($layerstyle)) {
    $layerstyle = 'geocities';
}
// Include layerstyle
if (file_exists(MAX_PATH . $conf['pluginPaths']['plugins'] . 'invocationTags/oxInvocationTags/layerstyles/' . $layerstyle . '/layerstyle.inc.php')) {
    include MAX_PATH . $conf['pluginPaths']['plugins'] . 'invocationTags/oxInvocationTags/layerstyles/' . $layerstyle . '/layerstyle.inc.php';
} else {
    // Don't generate output when plugin layerstyleisn't available,just send javascript comment on fail
    echo '// Cannot load required layerstyle file. Check if openXInvocationTags plugin is installed';
    exit(1);
}
//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']);
    MAX_cookieFlush();
    // Exit if no matching banner was found
    if (empty($output['html'])) {
        exit;
    }
Example #26
0
 /**
  * A method for processing settings values from a UI form, and updating the settings
  * values in the configuration file.
  *
  * @param array $aElements An array of arrays, indexed by the HTML form element names,
  *                         and then the top level configuration file item, containing
  *                         the configuration file key.
  *
  *                         The inner array can also contain the fixed keys "preg_match"
  *                         and "preg_replace", and the values will be used as a preg
  *                         pattern on the actual value.
  *
  *                         The inner array can also contain the fixed key "bool", in
  *                         which case the value will be treated as a true/false
  *                         element from the HTML form.
  *
  *                         The inner array can also contain the fixed keys "preg_split"
  *                         and "merge", and the preg_split value will be used to split
  *                         the actual value into an array, and then remove any empty
  *                         values from the result, and then the resulting array will be
  *                         merged with the merge value, and stored. The "merge_unique"
  *                         value can also be set to true, in which case only unique
  *                         values will be stored from the split array values.
  *
  *                         For example:
  *  array(
  *      delivery_cacheExpire => array(
  *                                  delivery     => acls
  *                                  preg_match   => #/$#
  *                                  preg_replace =>
  *                              )
  *  )
  *
  * This array would store the value from the "delivery_cacheExpire" HTML form element
  * in the configuration file under the [delivery] section, acls key; but the value stored
  * would have the "/" character, if it existed, removed from the end of the string value
  * stored.
  *
  * @return boolean True if the configuration file was saved correctly, false otherwise.
  */
 function processSettingsFromForm($aElementNames)
 {
     foreach ($aElementNames as $htmlElement => $aConfigInfo) {
         // Register the HTML element value
         MAX_commonRegisterGlobalsArray(array($htmlElement));
         // Was the HTML element value set?
         if (isset($GLOBALS[$htmlElement])) {
             reset($aConfigInfo);
             if (isset($aConfigInfo['preg_match'])) {
                 $preg_match = $aConfigInfo['preg_match'];
                 unset($aConfigInfo['preg_match']);
             }
             if (isset($aConfigInfo['preg_replace'])) {
                 $preg_replace = $aConfigInfo['preg_replace'];
                 unset($aConfigInfo['preg_replace']);
             }
             $value = stripslashes($GLOBALS[$htmlElement]);
             if (isset($preg_match) && isset($preg_replace)) {
                 $value = preg_replace($preg_match, $preg_replace, $value);
             }
             unset($preg_match);
             unset($preg_replace);
             if (isset($aConfigInfo['bool'])) {
                 $value = 'true';
             }
             if (!empty($aConfigInfo['trim'])) {
                 $value = trim($value);
             }
             unset($aConfigInfo['bool']);
             if (isset($aConfigInfo['preg_split']) && isset($aConfigInfo['merge'])) {
                 $pregSplit = $aConfigInfo['preg_split'];
                 $merge = $aConfigInfo['merge'];
                 $mergeUnique = false;
                 if ($aConfigInfo['merge_unique']) {
                     $mergeUnique = true;
                 }
                 unset($aConfigInfo['preg_split']);
                 unset($aConfigInfo['merge']);
                 unset($aConfigInfo['merge_unique']);
                 foreach ($aConfigInfo as $levelKey => $itemKey) {
                     $aValues = preg_split($pregSplit, $value);
                     if ($mergeUnique) {
                         $aValues = array_unique($aValues);
                     }
                     if (!empty($aConfigInfo['trim'])) {
                         array_walk($aValues, 'trim');
                     }
                     $aEmptyKeys = array_keys($aValues, '');
                     $counter = -1;
                     foreach ($aEmptyKeys as $key) {
                         $counter++;
                         array_splice($aValues, $key - $counter, 1);
                     }
                     $value = implode($merge, $aValues);
                     $this->settingChange($levelKey, $itemKey, $value);
                 }
             } else {
                 unset($aConfigInfo['preg_split']);
                 unset($aConfigInfo['merge']);
                 unset($aConfigInfo['merge_unique']);
                 foreach ($aConfigInfo as $levelKey => $itemKey) {
                     $this->settingChange($levelKey, $itemKey, $value);
                 }
             }
         } else {
             // The element may required "false" to be stored
             if (isset($aConfigInfo['bool'])) {
                 unset($aConfigInfo['bool']);
                 foreach ($aConfigInfo as $levelKey => $itemKey) {
                     $this->settingChange($levelKey, $itemKey, 'false');
                 }
             }
         }
     }
     $writeResult = $this->writeConfigChange();
     return $writeResult;
 }
Example #27
0
|                                                                           |
| 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/javascript.php';
MAX_commonSetNoCacheHeaders();
/*-------------------------------------------------------*/
/* Register input variables                              */
/*-------------------------------------------------------*/
MAX_commonRegisterGlobalsArray(array('zones', 'source', 'block', 'blockcampaign', 'exclude', 'mmm_fo', 'q', 'nz'));
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
// Derive the source parameter
$source = MAX_commonDeriveSource($source);
$spc_output = 'var ' . $conf['var']['prefix'] . 'output = new Array(); ' . "\n";
if (!empty($zones)) {
    $zones = explode('|', $zones);
    foreach ($zones as $thisZone) {
        if (empty($thisZone)) {
            continue;
        }
        // nz is set when "named zones" are being used, this allows a zone to be selected more than once
        if (!empty($nz)) {
            list($zonename, $thisZoneid) = explode('=', $thisZone);
function MAX_layerPutJs($output, $uniqid)
{
    global $stickyness, $offsetx, $offsety, $hide, $transparancy, $delay, $trail;
    // Register input variables
    MAX_commonRegisterGlobalsArray(array('stickyness', 'offsetx', 'offsety', 'hide', 'transparancy', 'delay', 'trail'));
    if (!isset($trail) || $trail == '') {
        $trail = 0;
    }
    if (!isset($stickyness) || $stickyness == '') {
        $stickyness = 5;
    }
    if (!isset($offsetx) || $offsetx == '') {
        $offsetx = 10;
    }
    if (!isset($offsety) || $offsety == '') {
        $offsety = 10;
    }
    if (!isset($hide) || $hide == '') {
        $hide = 0;
    }
    if (!isset($transparancy) || $transparancy == '') {
        $transparancy = 0;
    }
    if (!isset($delay) || $delay == '') {
        $delay = 90;
    }
    ?>



var MAX_ns4 = (document.layers) ? true : false;
var MAX_ie4 = (document.all && !window.innerWidth) ? true : false;
var MAX_ns6 = ((document.getElementById) && (!MAX_ie4)) ? true : false;

var MAX_<?php 
    echo $uniqid;
    ?>
_posX_old = 0;
var MAX_<?php 
    echo $uniqid;
    ?>
_posX_new = 0;
var MAX_<?php 
    echo $uniqid;
    ?>
_posY_old = 0;
var MAX_<?php 
    echo $uniqid;
    ?>
_posY_new = 0;
var MAX_<?php 
    echo $uniqid;
    ?>
_speedX = 0;
var MAX_<?php 
    echo $uniqid;
    ?>
_speedY = 0;
var MAX_<?php 
    echo $uniqid;
    ?>
_NoMove = 0;
var MAX_<?php 
    echo $uniqid;
    ?>
_transparancy = 0;


if (MAX_ie4 || MAX_ns6) { document.onmousemove = MAX_storePos_<?php 
    echo $uniqid;
    ?>
; }
if (MAX_ns4) { window.captureEvents(Event.MOUSEMOVE); onmousemove = MAX_storePos_<?php 
    echo $uniqid;
    ?>
; }


if (MAX_ie4)
	window.setInterval('MAX_followMouse_<?php 
    echo $uniqid;
    ?>
()',1);
else
	window.setInterval('MAX_followMouse_<?php 
    echo $uniqid;
    ?>
()',50);


function MAX_storePos_<?php 
    echo $uniqid;
    ?>
(e) {

	if (MAX_ie4)
	{
		MAX_<?php 
    echo $uniqid;
    ?>
_posX_new = window.event.x;
		MAX_<?php 
    echo $uniqid;
    ?>
_posY_new = window.event.y + document.body.scrollTop;
	}
	else if (MAX_ns4)
	{
		MAX_<?php 
    echo $uniqid;
    ?>
_posX_new = e.pageX;
		MAX_<?php 
    echo $uniqid;
    ?>
_posY_new = e.pageY;
	}
	else if (MAX_ns6)
	{
		MAX_<?php 
    echo $uniqid;
    ?>
_posX_new = e.clientX;
		MAX_<?php 
    echo $uniqid;
    ?>
_posY_new = e.clientY;
	}
}


function MAX_setVisibility_<?php 
    echo $uniqid;
    ?>
(transparancy)
{
	if (transparancy >= <?php 
    echo $transparancy;
    ?>
)
	{
		if (MAX_ie4 && !window.opera)
		{
			document.all['MAX_<?php 
    echo $uniqid;
    ?>
'].style.filter = "DXImageTransform.Microsoft.Alpha(opacity="+transparancy+")";
		}
		else if( document.getElementById )
		{
		    document.getElementById( 'MAX_<?php 
    echo $uniqid;
    ?>
' ).style.opacity=transparancy/100;
		}
		else transparancy = <?php 
    echo $transparancy;
    ?>
;

	}

	if (transparancy > 0)
	{
		if (MAX_ie4)        	{ document.all.MAX_<?php 
    echo $uniqid;
    ?>
.style.visibility = 'visible'; }
		else if (MAX_ns4)   	{ document.layers['MAX_<?php 
    echo $uniqid;
    ?>
'].visibility = 'show'; }
		else if (MAX_ns6) 	{ document.getElementById('MAX_<?php 
    echo $uniqid;
    ?>
').style.visibility='visible'; }
	}
	else
	{
		if (MAX_ie4)        	{ document.all.MAX_<?php 
    echo $uniqid;
    ?>
.style.visibility = 'hidden'; }
		else if (MAX_ns4)   	{ document.layers['MAX_<?php 
    echo $uniqid;
    ?>
'].visibility = 'hide'; }
		else if (MAX_ns6) 	{ document.getElementById('MAX_<?php 
    echo $uniqid;
    ?>
').style.visibility='hidden'; };
	}

	MAX_<?php 
    echo $uniqid;
    ?>
_transparancy = transparancy;
}


function MAX_setPos_<?php 
    echo $uniqid;
    ?>
(x, y)
{
	if (MAX_ie4)
	{
		document.all.MAX_<?php 
    echo $uniqid;
    ?>
.style.left = x;
		document.all.MAX_<?php 
    echo $uniqid;
    ?>
.style.top = y;
	}
 	else if (MAX_ns4)
	{
		document.MAX_<?php 
    echo $uniqid;
    ?>
.moveTo (x, y);
  	}
  	else if (MAX_ns6)
	{
  		var elm = document.getElementById('MAX_<?php 
    echo $uniqid;
    ?>
');
  		elm.style.left = x+'px';
  		elm.style.top = y+'px';
  	}
}


function MAX_followMouse_<?php 
    echo $uniqid;
    ?>
() {

	if (Math.abs(MAX_<?php 
    echo $uniqid;
    ?>
_posX_new - MAX_<?php 
    echo $uniqid;
    ?>
_posX_old) < 3 &&
		Math.abs(MAX_<?php 
    echo $uniqid;
    ?>
_posY_new - MAX_<?php 
    echo $uniqid;
    ?>
_posY_old) < 3)
	{
		MAX_<?php 
    echo $uniqid;
    ?>
_NoMove = MAX_<?php 
    echo $uniqid;
    ?>
_NoMove + 1;
	}
	else
	{
		MAX_<?php 
    echo $uniqid;
    ?>
_NoMove = 0;
	}


<?php 
    if ($hide == 1) {
        ?>
	var transparancy = 100;

	if (MAX_<?php 
        echo $uniqid;
        ?>
_NoMove > <?php 
        echo $delay;
        ?>
)
	{
		// Cursor is still, hide banner
		if (MAX_<?php 
        echo $uniqid;
        ?>
_NoMove <= 10 + <?php 
        echo $delay;
        ?>
)
			transparancy = 100 - ((MAX_<?php 
        echo $uniqid;
        ?>
_NoMove - <?php 
        echo $delay;
        ?>
) * 10);
		else
			transparancy = 0;
	}

	if (transparancy != MAX_<?php 
        echo $uniqid;
        ?>
_transparancy)
		MAX_setVisibility_<?php 
        echo $uniqid;
        ?>
(transparancy);

	<?php 
    } else {
        ?>
	MAX_setVisibility_<?php 
        echo $uniqid;
        ?>
(100);
	<?php 
    }
    ?>
	if (MAX_<?php 
    echo $uniqid;
    ?>
_NoMove < <?php 
    echo $delay;
    ?>
)
	{
	<?php 
    if ($trail == 1) {
        ?>
		// Calculate new position
		MAX_<?php 
        echo $uniqid;
        ?>
_speedX = MAX_<?php 
        echo $uniqid;
        ?>
_speedX * (<?php 
        echo $stickyness;
        ?>
 / 10) + (MAX_<?php 
        echo $uniqid;
        ?>
_posX_new - MAX_<?php 
        echo $uniqid;
        ?>
_posX_old) / 30;
		MAX_<?php 
        echo $uniqid;
        ?>
_speedY = MAX_<?php 
        echo $uniqid;
        ?>
_speedY * (<?php 
        echo $stickyness;
        ?>
 / 10) + (MAX_<?php 
        echo $uniqid;
        ?>
_posY_new - MAX_<?php 
        echo $uniqid;
        ?>
_posY_old) / 30;
		MAX_<?php 
        echo $uniqid;
        ?>
_posX_old = MAX_<?php 
        echo $uniqid;
        ?>
_posX_old + MAX_<?php 
        echo $uniqid;
        ?>
_speedX;
		MAX_<?php 
        echo $uniqid;
        ?>
_posY_old = MAX_<?php 
        echo $uniqid;
        ?>
_posY_old + MAX_<?php 
        echo $uniqid;
        ?>
_speedY;
	<?php 
    } else {
        ?>
		MAX_<?php 
        echo $uniqid;
        ?>
_posX_old = MAX_<?php 
        echo $uniqid;
        ?>
_posX_new;
		MAX_<?php 
        echo $uniqid;
        ?>
_posY_old = MAX_<?php 
        echo $uniqid;
        ?>
_posY_new;
	<?php 
    }
    ?>
		// Set position of banner
		MAX_setPos_<?php 
    echo $uniqid;
    ?>
 (
			MAX_<?php 
    echo $uniqid;
    ?>
_posX_old + <?php 
    echo $offsetx;
    ?>
,
			MAX_<?php 
    echo $uniqid;
    ?>
_posY_old + <?php 
    echo $offsety;
    ?>
		);
	}
}

<?php 
}
Example #29
0
function MAX_commonInitVariables()
{
    MAX_commonRegisterGlobalsArray(array('context', 'source', 'target', 'withText', 'withtext', 'ct0', 'what', 'loc', 'referer', 'zoneid', 'campaignid', 'bannerid', 'clientid', 'charset'));
    global $context, $source, $target, $withText, $withtext, $ct0, $what, $loc, $referer, $zoneid, $campaignid, $bannerid, $clientid, $charset;
    if (isset($withText) && !isset($withtext)) {
        $withtext = $withText;
    }
    $withtext = isset($withtext) && is_numeric($withtext) ? $withtext : 0;
    $ct0 = isset($ct0) ? $ct0 : '';
    $context = isset($context) ? $context : array();
    $target = isset($target) && !empty($target) && !strpos($target, chr(32)) ? $target : '';
    $charset = isset($charset) && !empty($charset) && !strpos($charset, chr(32)) ? $charset : 'UTF-8';
    $bannerid = isset($bannerid) && is_numeric($bannerid) ? $bannerid : '';
    $campaignid = isset($campaignid) && is_numeric($campaignid) ? $campaignid : '';
    $clientid = isset($clientid) && is_numeric($clientid) ? $clientid : '';
    $zoneid = isset($zoneid) && is_numeric($zoneid) ? $zoneid : '';
    if (!isset($what)) {
        if (!empty($bannerid)) {
            $what = 'bannerid:' . $bannerid;
        } elseif (!empty($campaignid)) {
            $what = 'campaignid:' . $campaignid;
        } elseif (!empty($zoneid)) {
            $what = 'zone:' . $zoneid;
        } else {
            $what = '';
        }
    } elseif (preg_match('/^([a-z]+):(\\d+)$/', $what, $matches)) {
        switch ($matches[1]) {
            case 'zoneid':
            case 'zone':
                $zoneid = $matches[2];
                break;
            case 'bannerid':
                $bannerid = $matches[2];
                break;
            case 'campaignid':
                $campaignid = $matches[2];
                break;
            case 'clientid':
                $clientid = $matches[2];
                break;
        }
    }
    if (!isset($clientid)) {
        $clientid = '';
    }
    if (empty($campaignid)) {
        $campaignid = $clientid;
    }
    $source = MAX_commonDeriveSource($source);
    if (!empty($loc)) {
        $loc = stripslashes($loc);
    } elseif (!empty($_SERVER['HTTP_REFERER'])) {
        $loc = $_SERVER['HTTP_REFERER'];
    } else {
        $loc = '';
    }
    if (!empty($referer)) {
        $_SERVER['HTTP_REFERER'] = stripslashes($referer);
    } else {
        if (isset($_SERVER['HTTP_REFERER'])) {
            unset($_SERVER['HTTP_REFERER']);
        }
    }
    $GLOBALS['_MAX']['COOKIE']['LIMITATIONS']['arrCappingCookieNames'] = array($GLOBALS['_MAX']['CONF']['var']['blockAd'], $GLOBALS['_MAX']['CONF']['var']['capAd'], $GLOBALS['_MAX']['CONF']['var']['sessionCapAd'], $GLOBALS['_MAX']['CONF']['var']['blockCampaign'], $GLOBALS['_MAX']['CONF']['var']['capCampaign'], $GLOBALS['_MAX']['CONF']['var']['sessionCapCampaign'], $GLOBALS['_MAX']['CONF']['var']['blockZone'], $GLOBALS['_MAX']['CONF']['var']['capZone'], $GLOBALS['_MAX']['CONF']['var']['sessionCapZone'], $GLOBALS['_MAX']['CONF']['var']['lastClick'], $GLOBALS['_MAX']['CONF']['var']['lastView'], $GLOBALS['_MAX']['CONF']['var']['blockLoggingClick']);
    if (strtolower($charset) == 'unicode') {
        $charset = 'utf-8';
    }
}
Example #30
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';
// No Caching
MAX_commonSetNoCacheHeaders();
//Register any script specific input variables
MAX_commonRegisterGlobalsArray(array('refresh', 'resize', 'rewrite', 'n'));
// Initialise any afr.php specific variables
if (!isset($rewrite)) {
    $rewrite = 1;
}
if (!isset($refresh)) {
    $refresh = 0;
}
if (!isset($resize)) {
    $resize = 0;
}
// Get the banner
$banner = MAX_adSelect($what, $campaignid, $target, $source, $withtext, $charset, $context, true, $ct0, $loc, $referer);
// Send cookie if needed
if (!empty($banner['html']) && !empty($n)) {
    // Send bannerid headers