...

View Full Version : Help understanding this function



Jacobb123
08-20-2007, 04:19 AM
I am working with OPENADS and see this bit of code lying around on almost every page but I can't see it defined anywhere and I 'm wondering if this is a predefined variable in PHP if it is I cannot find anything about it. I was hoping that someone could help me out trying to understand this. Here is the code that I am talking about.


$conf = $GLOBALS['_MAX']['CONF'];

Here is the whole code that I am working with or at least this particular page


function MAX_commonGetDeliveryUrl($file = null)
{
$conf = $GLOBALS['_MAX']['CONF'];
if (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == $conf['openads']['sslPort']) {
$url = MAX_commonConstructSecureDeliveryUrl($file);
} else {
$url = MAX_commonConstructDeliveryUrl($file);
}
return $url;
}

/**
* A function to generate the URL for delivery scripts.
*
* @param string $file The file name of the delivery script.
* @return string The URL to the delivery script.
*/
function MAX_commonConstructDeliveryUrl($file)
{
$conf = $GLOBALS['_MAX']['CONF'];
return 'http://' . $conf['webpath']['delivery'] . '/' . $file;
}

Inigoesdr
08-20-2007, 04:33 AM
http://www.php.net/manual/en/language.variables.predefined.php

Jacobb123
08-20-2007, 04:54 AM
I understand the Superglobals but can't figure out what _max is. I'm sorry but I am still learning PHP and don't understand this

Inigoesdr
08-20-2007, 05:35 AM
_MAX is an index being set by the script somewhere. It's in the code, and if it's on every page like you say it's likely set in a config file or something that is included with every page.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum