Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Aug 2006
    Posts
    311
    Thanks
    0
    Thanked 1 Time in 1 Post

    Help understanding this function

    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.

    PHP Code:
      $conf $GLOBALS['_MAX']['CONF']; 
    Here is the whole code that I am working with or at least this particular page

    PHP Code:
    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;


  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts

  • #3
    Regular Coder
    Join Date
    Aug 2006
    Posts
    311
    Thanks
    0
    Thanked 1 Time in 1 Post
    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

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    _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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •