]> git.mxchange.org Git - mailer.git/blobdiff - inc/template-functions.php
Some code cosmetics and fixes
[mailer.git] / inc / template-functions.php
index d520c5f0b83c595f886b2574fe7d236db49293c8..4f1ad6f8e579e628c059c798fbcd3054698332f3 100644 (file)
@@ -56,7 +56,7 @@ function enableTemplateHtml ($enable = true) {
 // Default: true
 function isTemplateHtml () {
        // Is the output_mode other than 0 (HTML), then no comments are enabled
-       if (getOutputMode() != 0) {
+       if (getScriptOutputMode() != 0) {
                // No HTML
                return false;
        } else {
@@ -126,7 +126,7 @@ function outputHtml ($htmlCode, $newLine = true) {
        // Do we have HTML-Code here?
        if (!empty($htmlCode)) {
                // Yes, so we handle it as you have configured
-               switch (getCachedOutputMode()) {
+               switch (getOutputMode()) {
                        case 'render':
                                // That's why you don't need any \n at the end of your HTML code... :-)
                                if (getPhpCaching() == 'on') {
@@ -175,7 +175,7 @@ function outputHtml ($htmlCode, $newLine = true) {
 
                // Output code here, DO NOT REMOVE! ;-)
                outputRawCode($GLOBALS['output']);
-       } elseif ((getCachedOutputMode() == 'render') && (!empty($GLOBALS['output']))) {
+       } elseif ((getOutputMode() == 'render') && (!empty($GLOBALS['output']))) {
                // Send all HTTP headers
                sendHttpHeaders();
 
@@ -199,7 +199,7 @@ function compileFinalOutput () {
        $GLOBALS['output'] = doFinalCompilation($GLOBALS['output']);
 
        // Extension 'rewrite' installed?
-       if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) {
+       if ((isExtensionActive('rewrite')) && (getScriptOutputMode() != 1)) {
                $GLOBALS['output'] = rewriteLinksInCode($GLOBALS['output']);
        } // END - if
 
@@ -322,7 +322,7 @@ function loadTemplate ($template, $return = false, $content = array()) {
                        $ret = '';
                        if ((strpos($GLOBALS['tpl_content'], '$') !== false) || (strpos($GLOBALS['tpl_content'], '{--') !== false) || (strpos($GLOBALS['tpl_content'], '{?') !== false) || (strpos($GLOBALS['tpl_content'], '{%') !== false)) {
                                // Normal HTML output?
-                               if (getOutputMode() == '0') {
+                               if (getScriptOutputMode() == '0') {
                                        // Add surrounding HTML comments to help finding bugs faster
                                        $ret = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['tpl_content'] . '<!-- Template ' . $template . ' - End //-->';
 
@@ -458,7 +458,7 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0') {
 
        // Load user's data
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UID={$userid},template={$template},content[]=".gettype($content));
-       if (($userid > 0) && (is_array($content))) {
+       if ((isValidUserId($userid)) && (is_array($content))) {
                // If nickname extension is installed, fetch nickname as well
                if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) {
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NICKNAME!<br />");
@@ -1165,7 +1165,7 @@ function debug_report_bug ($F, $L, $message = '', $sendEmail = true) {
        // Is this already called?
        if (isset($GLOBALS[__FUNCTION__])) {
                // Other backtrace
-               print 'Message:'.$message.'<br />Backtrace:<pre>';
+               print 'Message:' . $message . '<br />Backtrace:<pre>';
                debug_print_backtrace();
                die('</pre>');
        } // END - if