Hotfix
[mailer.git] / surfbar.php
index ae3fd6fd8c6bb60f5513bbd6ba705f7363846a48..2c29e256912e536f57870f1a5edad723706d9f87 100644 (file)
@@ -17,7 +17,7 @@
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -41,7 +41,7 @@ require('inc/libs/security_functions.php');
 // Init start time
 $GLOBALS['startTime'] = microtime(true);
 
-// Set module
+// Set module output mode
 $GLOBALS['module'] = 'surfbar';
 $GLOBALS['output_mode'] = '0';
 $GLOBALS['header_sent'] = 3;
@@ -53,7 +53,7 @@ require('inc/config-global.php');
 setContentType('text/html');
 
 // Is a frame active?
-if (isGetRequestParameterSet('frame')) {
+if (isGetRequestElementSet('frame')) {
        // Then we need to set header_sent to 0
        $GLOBALS['header_sent'] = '0';
 } // END - if
@@ -66,9 +66,9 @@ if (!isMember()) {
        // Should we display login window or redirect to main page?
        if ((getConfig('surfbar_guest_login_form') == 'Y') && (isExtensionActive('user'))) {
                // Is the form sent?
-               if ((isFormSent()) && (isPostRequestParameterSet('id')) && (isPostRequestParameterSet('password'))) {
+               if ((isFormSent()) && (isPostRequestElementSet('id')) && (isPostRequestElementSet('password'))) {
                        // Do the login procedure
-                       $url = doUserLogin(postRequestParameter('id'), postRequestParameter('password'), basename(__FILE__), basename(__FILE__) . '?code=');
+                       $url = doUserLogin(postRequestElement('id'), postRequestElement('password'), basename(__FILE__), basename(__FILE__) . '?code=');
 
                        // And redirect to the URL
                        redirectToUrl($url);
@@ -77,9 +77,9 @@ if (!isMember()) {
                        loadIncludeOnce('inc/header.php');
 
                        // Is there a 'code' provided?
-                       if (isGetRequestParameterSet('code')) {
+                       if (isGetRequestElementSet('code')) {
                                // Then generate an error message
-                               displayMessage(getMessageFromErrorCode(getRequestParameter('code')));
+                               displayMessage(getMessageFromErrorCode(getRequestElement('code')));
                        } // END - if
 
                        // Display login form
@@ -104,13 +104,13 @@ SURFBAR_INIT();
 SURFBAR_HANDLE_SELF_MAINTENANCE();
 
 // Is there a check value?
-if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isGetRequestParameterSet('frame')) && (in_array(getRequestParameter('frame'), array('stop', 'stop2', 'stats', 'textlinks'))))) {
+if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isGetRequestElementSet('frame')) && (in_array(getRequestElement('frame'), array('stop', 'stop2', 'stats', 'textlinks'))))) {
        // Reload-lock is full, surfbar stopped so...
        // Load header
        loadIncludeOnce('inc/header.php');
 
        // Load template
-       if (((isGetRequestParameterSet('frame')) && (getRequestParameter('frame') == 'stop2')) || (!isGetRequestParameterSet('frame'))) {
+       if (((isGetRequestElementSet('frame')) && (getRequestElement('frame') == 'stop2')) || (!isGetRequestElementSet('frame'))) {
                // Load template for "start" page
                loadTemplate('surfbar_frame_start');
 
@@ -118,8 +118,8 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isGetRequestParameterSet('frame')) && (in
                loadTemplate('surfbar_start_banner');
 
                // This makes the footer appear again
-               unsetGetRequestParameter('frame');
-       } elseif ((isGetRequestParameterSet('frame')) && (getRequestParameter('frame') == 'stats')) {
+               unsetGetRequestElement('frame');
+       } elseif ((isGetRequestElementSet('frame')) && (getRequestElement('frame') == 'stats')) {
                // Prepare content
                $content = array(
                        'points' => getTotalPoints(getMemberId()),
@@ -128,7 +128,7 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isGetRequestParameterSet('frame')) && (in
 
                // Load template for "stats" page
                loadTemplate('surfbar_frame_stats', false, $content);
-       } elseif ((isGetRequestParameterSet('frame')) && (getRequestParameter('frame') == 'textlinks')) {
+       } elseif ((isGetRequestElementSet('frame')) && (getRequestElement('frame') == 'textlinks')) {
                // Prepare content
                $content = array(
                        'reload' => (getConfig('surfbar_stats_reload') * 1000)
@@ -146,14 +146,14 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isGetRequestParameterSet('frame')) && (in
                // Load template for stopped surfbar
                loadTemplate('surfbar_stopped', false, $content);
        }
-} elseif ((isGetRequestParameterSet('check')) && (isGetRequestParameterSet('id')) && (isGetRequestParameterSet('salt'))) {
+} elseif ((isGetRequestElementSet('check')) && (isGetRequestElementSet('id')) && (isGetRequestElementSet('salt'))) {
        // Dummy next id get
-       SURFBAR_DETERMINE_NEXT_ID(getRequestParameter('id'));
+       SURFBAR_DETERMINE_NEXT_ID(getRequestElement('id'));
 
        // Check reload lock and validation code
-       if ((!SURFBAR_CHECK_RELOAD_LOCK(getRequestParameter('id'))) && (SURFBAR_CHECK_VALIDATION_CODE(getRequestParameter('id'), getRequestParameter('check'), getRequestParameter('salt')))) {
+       if ((!SURFBAR_CHECK_RELOAD_LOCK(getRequestElement('id'))) && (SURFBAR_CHECK_VALIDATION_CODE(getRequestElement('id'), getRequestElement('check'), getRequestElement('salt')))) {
                // Lock the URL (id) down
-               SURFBAR_LOCKDOWN_ID(getRequestParameter('id'));
+               SURFBAR_LOCKDOWN_ID(getRequestElement('id'));
 
                // Code is valid so pay points here
                SURFBAR_PAY_POINTS();
@@ -163,6 +163,9 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isGetRequestParameterSet('frame')) && (in
                        // Then load waiting page
                        SURFBAR_RELOAD_TO_STOP_PAGE();
                } // END - if
+
+               // Load header to avoid a bug
+               loadIncludeOnce('inc/header.php');
        } else {
                // Reload to stop frame!
                SURFBAR_RELOAD_TO_STOP_PAGE();
@@ -175,7 +178,7 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isGetRequestParameterSet('frame')) && (in
        $content = '';
 
        // Frame "top" set?
-       if ((isGetRequestParameterSet('frame')) && (getRequestParameter('frame') == 'top')) {
+       if ((isGetRequestElementSet('frame')) && (getRequestElement('frame') == 'top')) {
                // Determine next id
                $nextId = SURFBAR_DETERMINE_NEXT_ID();
                //* DEBUG: */ die('nextId='.$nextId);
@@ -194,9 +197,9 @@ if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isGetRequestParameterSet('frame')) && (in
                        // Load new URL
                        SURFBAR_RELOAD_TO_STOP_PAGE('stop');
                }
-       } elseif ((isGetRequestParameterSet('frame')) && (getRequestParameter('frame') == 'start')) {
+       } elseif ((isGetRequestElementSet('frame')) && (getRequestElement('frame') == 'start')) {
                // Starter frame found so let the footer display
-               unsetGetRequestParameter('frame');
+               unsetGetRequestElement('frame');
        }
 
        // Load header