]> git.mxchange.org Git - mailer.git/commitdiff
Several fixes for guest menu system and template engine
authorRoland Häder <roland@mxchange.org>
Tue, 27 Oct 2009 22:42:59 +0000 (22:42 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 27 Oct 2009 22:42:59 +0000 (22:42 +0000)
inc/filter-functions.php
inc/functions.php
inc/modules/guest/action-
inc/modules/guest/action-admin.php
inc/modules/guest/action-online.php
inc/modules/guest/action-sponsor.php
inc/modules/guest/action-themes.php
inc/mysql-manager.php

index ce4d30276ed5cd0a489b22483ba7da8fde0d818a..792e335c611be244e6deb3ed2b493482115c39f6 100644 (file)
@@ -69,9 +69,6 @@ function initFilterSystem () {
                        $filterArray['chains'][$filterName][$filterFunction]  = $GLOBALS['cache_array']['filter']['filter_active'][$idx];
                } // END - foreach
 
-               // Mark filters as loaded
-               $GLOBALS['cache_array']['filter'] = true;
-
                // Remove the cache
                $GLOBALS['cache_array']['filter'] = $filterArray;
        } elseif ((!isInstallationPhase()) && (isExtensionInstalledAndNewer('sql_patches', '0.5.9'))) {
index 4c5ca96fa50f0e41fc16d68381efe35fccb8dd1d..ee2d1b41adb73c6ebc67b3dd1069bd01b73cc6a8 100644 (file)
@@ -363,8 +363,9 @@ function loadTemplate ($template, $return=false, $content=array()) {
                                        $eval = '$ret = "' . compileCode(smartAddSlashes($GLOBALS['tpl_content'])) . '";';
                                }
                        } else {
-                               // Simply return loaded code
-                               $eval = '$ret = $GLOBALS[\'tpl_content\'];';
+                               // Add surrounding HTML comments to help finding bugs faster
+                               $ret = "<!-- Template " . $template . " - Start -->\n" . $GLOBALS['tpl_content'] . "<!-- Template " . $template . " - End -->\n";
+                               $eval = '$ret = "' . smartAddSlashes($ret) . '";';
                        } // END - if
 
                        // Cache the eval() command here
index c865842667308ebd66a5bf45bd379286a6b8d0e6..3a71404735fe12c6201485be5694e0327bd56d4a 100644 (file)
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-} // END - if
+} elseif (isBlockModeEnabled()) {
+       // Block mode detected
+       return;
+}
 
 // Add description as navigation point
 addMenuDescription('guest', __FILE__);
@@ -47,9 +50,6 @@ addMenuDescription('guest', __FILE__);
 if ((!isExtensionActive('')) && (!isAdmin())) {
        loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage(''));
        return;
-} elseif (isBlockModeEnabled()) {
-       // Block mode detected
-       return;
 }
 
 // Load the include file
index 246108d811bb9977eec199a9a041dd6eb5d0cd56..26dd5cc40b406e6db7211f0eed821ce1a5cf423f 100644 (file)
@@ -44,6 +44,9 @@ if (!defined('__SECURITY')) {
        return;
 }
 
+// Add description as navigation point
+addMenuDescription('guest', __FILE__);
+
 // Only when one admin link is clicked...
 $inc = sprintf("inc/modules/guest/what-%s.php", getWhat());
 if (isIncludeReadable($inc)) {
index f2f36dec20bd850634926896b5df92b16c71fc28..a01eb37653b35ae04bbbdca2bb6e92ca9f06d3cd 100644 (file)
@@ -42,6 +42,9 @@ if (!defined('__SECURITY')) {
 } elseif ((!isExtensionActive('online')) && (!isAdmin())) {
        // Just skip this extension
        return;
+} elseif (!isBlockModeEnabled()) {
+       // Block mode detected
+       return;
 }
 
 // Total visitors online
index 6cffad8374f114624c7e91f1b75c80284f20e4ee..5252f61feafde8702368d615fa2cb689c5f320fc 100644 (file)
@@ -43,9 +43,6 @@ if (!defined('__SECURITY')) {
        return;
 }
 
-// Add description as navigation point
-addMenuDescription('guest', __FILE__);
-
 // Load the include file
 $inc = sprintf("inc/modules/guest/what-%s.php", getWhat());
 if (isIncludeReadable($inc)) {
index 8b4ee7ff02b5afa0c2c73ed33a1e127329ddac73..00b6bf45f5685e14790427b412cc5ecbbdfaa10c 100644 (file)
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-} // END - if
-
-// Add description as navigation point
-addMenuDescription('guest', __FILE__);
+} elseif (!isBlockModeEnabled()) {
+       // Block mode detected
+       return;
+}
 
 if ((!isExtensionActive('theme')) && (!isAdmin())) {
        loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('theme'));
@@ -58,6 +58,7 @@ if (isAdmin()) {
        $num_themes = countSumTotalData('', 'themes', 'id', '', true);
 }
 
+$OUT = '';
 if ($num_themes > 1) {
        // If more than 1 is installed output selection box
        $OUT = generateThemeSelectionBox();
index 754ca58d903baf831c74568228c15f7b0462d87e..7c4d4a8960442429842e99e838d0b08ca2914b45 100644 (file)
@@ -513,21 +513,21 @@ function addMenu ($mode, $action, $what) {
                                enableBlockMode();
 
                                // Load menu block
-                               $inc_BLOCK = sprintf("inc/modules/%s/action-%s.php", $mode, $content['action']);
-                               if (isFileReadable($inc_BLOCK)) {
+                               $INC = sprintf("inc/modules/%s/action-%s.php", $mode, $content['action']);
+                               if (isFileReadable($INC)) {
                                        // Load include file
                                        if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_begin', true, $mode);
-                                       //* DEBUG: */ outputHtml(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
-                                       loadInclude($inc_BLOCK);
-                                       //* DEBUG: */ outputHtml(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
-                                       if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_end', true);
+                                       //* DEBUG: */ outputHtml(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.getWhat()."*<br />");
+                                       loadInclude($INC);
+                                       //* DEBUG: */ outputHtml(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.getWhat()."*<br />");
+                                       if ((!isExtensionActive($content['action'])) || ($content['action'] == 'online')) $GLOBALS['rows'] .= loadTemplate('menu_what_end', true, $mode);
                                }
                                //* DEBUG: */ outputHtml(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
                        }
 
                        $main_cnt++;
 
-                       //* DEBUG: */ outputHtml(__LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.getWhat()."*<br />");
+                       //* DEBUG: */ outputHtml(__LINE__.'/'.$main_cnt.':'.getWhat()."*<br />");
                        if (SQL_NUMROWS($result_main) > $main_cnt) {
                                // Add seperator
                                $GLOBALS['rows'] .= loadTemplate('menu_seperator', true, $mode);