Fixes for POST setter, template and others
authorRoland Häder <roland@mxchange.org>
Wed, 28 Oct 2009 21:48:07 +0000 (21:48 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 28 Oct 2009 21:48:07 +0000 (21:48 +0000)
inc/functions.php
inc/header.php
inc/js/js-order_send.php
inc/modules/frametester.php
inc/modules/order.php
inc/request-functions.php
templates/de/emails/order-admin.tpl
templates/de/html/member/member_order_send.tpl

index de59b2e..c55b421 100644 (file)
@@ -889,7 +889,7 @@ function generateDerefererUrl ($URL) {
        // Don't de-refer our own links!
        if (substr($URL, 0, strlen(getConfig('URL'))) != getConfig('URL')) {
                // De-refer this link
-               $URL = 'modules.php?module=loader&amp;url=' . encodeString(compileUriCode($URL));
+               $URL = '{?URL?}/modules.php?module=loader&amp;url=' . encodeString(compileUriCode($URL));
        } // END - if
 
        // Return link
index cd22a87..3ea5b4a 100644 (file)
@@ -46,12 +46,12 @@ if (!defined('__SECURITY')) {
 // Is the header already sent?
 if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) {
        // If not in CSS mode generate the header
-       if ((getOutputMode() != '1')) {
-               // Generate header
-               $TITLE = '';
-
+       if (getOutputMode() != '1') {
                // Config and database connection valid?
                if ((isConfigLocalLoaded()) && (isConfigLoaded()) && (SQL_IS_LINK_UP()) && (isExtensionActive('sql_patches'))) {
+                       // Init title
+                       $TITLE = '';
+
                        // Title decoration enabled?
                        if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_left') != '')) $TITLE .= trim(getConfig('title_left'))." ";
 
@@ -128,7 +128,7 @@ if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) {
 } // END - if
 
 // Add BODY tag or not?
-if ((getOutputMode() != '1') && ($GLOBALS['header_sent'] == 1)) {
+if ((getOutputMode() != '1') && ($GLOBALS['header_sent'] == 1) && ((getModule() != 'frametester') || (isGetRequestElementSet('frame')))) {
        loadTemplate('page_body');
        $GLOBALS['header_sent'] = 2;
 } // END - if
index 916faab..1898110 100644 (file)
@@ -35,7 +35,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
  * MA  02110-1301  USA                                                  *
  ************************************************************************/
-
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
@@ -44,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Simply load the JavaScript here
-loadTemplate('js_order_sent');
+loadTemplate('js_order_send');
 
 // [EOF]
 ?>
index 5779deb..6bf2108 100644 (file)
@@ -77,20 +77,21 @@ if ((isPostRequestElementSet('url')) || (isGetRequestElementSet('url')) || (isGe
        // Default URL is ours
        $url = getConfig('URL');
 
-       // Decode URL if set in GET parameters
-       if (isGetRequestElementSet('url'))  $url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(getRequestElement('url')))));
-
-       // Use URL from POST data if set
-       if (isPostRequestElementSet('url')) $url = postRequestElement('url');
+       // Use URL from POST or GET data if set
+       if (isPostRequestElementSet('url')) {
+               // POST data comes first
+               $url = postRequestElement('url');
+       } elseif (isGetRequestElementSet('url')) {
+               // Then GET data
+               $url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(getRequestElement('url')))));
+       }
 
        // Add missing element
        $frame = '';
        if (isGetRequestElementSet('frame')) $frame = getRequestElement('frame');
-       switch ($frame)
-       {
+       switch ($frame) {
                case '':
-                       switch ($mode)
-                       {
+                       switch ($mode) {
                                case 'member':
                                        // Build frameset
                                        $content['order'] = bigintval(getRequestElement('order'));
@@ -102,24 +103,25 @@ if ((isPostRequestElementSet('url')) || (isGetRequestElementSet('url')) || (isGe
                                        $content['url']   = generateDerefererUrl($url);
                                        loadTemplate('guest_frametester', false, $content);
                                        break;
-                       }
+                       } // END - switch
                        break;
 
-                               case 'test_top':
-                                       loadTemplate('admin_settings_saved', false, '<div class="guest_done">{--GUEST_FRAMETESTER_TOP--}</span>');
-                                       break;
+               case 'test_top':
+                       loadTemplate('admin_settings_saved', false, '<div class="guest_done">{--GUEST_FRAMETESTER_TOP--}</span>');
+                       break;
 
-                               case 'back': // Back buttom
-                                       loadTemplate('member_order_back', false, getRequestElement('order'));
-                                       break;
+               case 'back': // Back buttom
+                       loadTemplate('member_order_back', false, getRequestElement('order'));
+                       break;
 
-                               case 'send': // Send mail away
-                                       loadTemplate('member_order_send', false, getRequestElement('order'));
-                                       break;
-       }
+               case 'send': // Send mail away
+                       loadTemplate('member_order_send', false, getRequestElement('order'));
+                       break;
+       } // END - switch
 } else {
        // Go away...
        redirectToUrl('modules.php?module=login');
 }
-//
+
+// [EOF]
 ?>
index 6fca97e..b82fb34 100644 (file)
@@ -74,7 +74,7 @@ if (empty($URL)) {
        if (SQL_AFFECTEDROWS() == 1) {
                // @TODO Unused: 2,4
                // Load mail again...              0         1          2             3            4         5       6            7
-               $result = SQL_QUERY_ESC("SELECT `subject`, `text`, `receivers`, `payment_id`, `timestamp`, `url`, cat_id`, `target_send` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s AND `sender`=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `subject`, `text`, `receivers`, `payment_id`, `timestamp`, `url`, `cat_id`, `target_send` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s AND `sender`=%s LIMIT 1",
                        array(bigintval(getRequestElement('order')), getUserId()), __FILE__, __LINE__);
                $content = merge_array($content, SQL_FETCHARRAY($result));
                SQL_FREERESULT($result);
@@ -89,7 +89,6 @@ if (empty($URL)) {
                subtractPoints('order', getUserId(), $usedPoints);
 
                // Compile content
-               $content['block']    = getConfig('max_send');
                $content['payment']  = getPaymentTitlePrice($content['payment_id']);
                $content['category'] = getCategory($content['cat_id']);
 
index f67df00..f4486a5 100644 (file)
@@ -114,7 +114,7 @@ function setRequestGetElement ($element, $value) {
        $GLOBALS['raw_request']['get'][$element] = $value;
 
        // Update cache
-       $GLOBALS['cache_request']['request_get'][$element] = $value;
+       $GLOBALS['cache_request']['request_get'][$element][null] = $value;
 }
 
 // Wrapper for elements in $_POST
@@ -219,7 +219,7 @@ function setRequestPostElement ($element, $value) {
        }
 
        // Update cache
-       $GLOBALS['cache_request']['request_post'][$element] = $value;
+       $GLOBALS['cache_request']['request_post'][$element][null] = $value;
 }
 
 // Checks wether a form was sent. If so, the $_POST['ok'] element must be set
index b122222..339358f 100644 (file)
@@ -2,7 +2,7 @@ Hallo Administrator
 
 Ein Mitglied hat soeben eine Mailbuchung durchgef&uuml;hrt!
 
-Seine Buchung befindet sich nun im Sende-Pool und wird automatisch in $content[blocks] Mail-Bloecken versand.
+Seine Buchung befindet sich nun im Sende-Pool und wird automatisch in {?max_send?} Mail-Bloecken versand.
 
 Hier sind nochmals seine Daten, gebuchter Text und URL zur Verifizierung:
 ------------------------------------------------
index aa2f86f..08dadaf 100644 (file)
@@ -2,5 +2,5 @@
 {--MEMBER_ORDER_PLEASE_WAIT_1--}<span id="counter" style="font-weight:bold">10</span>{--MEMBER_ORDER_PLEASE_WAIT_2--}<br />
 <input type="submit" class="member_submit" id="ok" name="ok" value="{--MEMBER_DO_ORDER--}" />
 <script type="text/javascript"
- src="{?URL?}/js.php?js=member_order_send{%version=order%}"></script>
+ src="{?URL?}/js.php?js=order_send{%version=order%}"></script>
 </form>