Several code cleanups:
[mailer.git] / inc / template-functions.php
index 4280695bdb50a2dea032859caaa2f98b63e66343..db267b113768e33b7e34ef9cd580f6a2b3e7226c 100644 (file)
@@ -447,24 +447,24 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0', $loadU
        } // END - if
 
        // Load user's data
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UID={$userid},template={$template},content[]=".gettype($content));
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UID=' . $userid . ',template=' . $template . ',content[]=' . gettype($content));
        if ((isValidUserId($userid)) && (is_array($content))) {
                // If nickname extension is installed, fetch nickname as well
                if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) {
                        // Load by nickname
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NICKNAME!<br />");
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - NICKNAME!');
                        fetchUserData($userid, 'nickname');
                } elseif (isNicknameUsed($userid)) {
                        // Non-number characters entered but no ext-nickname found
                        debug_report_bug(__FUNCTION__, __LINE__, 'userid=' . $userid . ': is no id number and ext-nickname is gone.');
                } else {
                        // Load by userid
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NO-NICK!<br />");
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - USERID!');
                        fetchUserData($userid);
                }
 
                // Merge data if valid
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - PRE<br />");
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'content()=' . count($content) . ' - PRE!');
                if ((isUserDataValid()) && ($loadUserData === true)) {
                        // It is valid
                        $content = merge_array($content, getUserDataArray());
@@ -473,7 +473,7 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0', $loadU
                        unset($content['password']);
                } // END - if
 
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - AFTER<br />");
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'content()=' . count($content) . ' - AFTER!');
        } // END - if
 
        // Base directory
@@ -634,10 +634,10 @@ function compileRawCode ($code, $simple = false, $constants = true, $full = true
                                $test = substr($found, 0, strlen($match));
 
                                // Does this entry exist?
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "found={$found},match={$match},set={$set}<br />");
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'found=' . $found . ',match=' . $match . ',set=' . $set);
                                if ($test == $match) {
                                        // Match found
-                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "fuzzyFound!<br />");
+                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'fuzzyFound!');
                                        $fuzzyFound = true;
                                        break;
                                } // END - if
@@ -649,14 +649,14 @@ function compileRawCode ($code, $simple = false, $constants = true, $full = true
                        // Take all string elements
                        if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key.'_' . $matches[4][$key]]))) {
                                // Replace it in the code
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "key={$key},match={$match}<br />");
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',match=' . $match);
                                $newMatch = str_replace('[', "['", str_replace(']', "']", $match));
                                $code = str_replace($match, '".' . $newMatch . '."', $code);
                                $matchesFound[$key . '_' . $matches[4][$key]] = 1;
                                $matchesFound[$match] = 1;
                        } elseif (!isset($matchesFound[$match])) {
                                // Not yet replaced!
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "match={$match}<br />");
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'match=' . $match);
                                $code = str_replace($match, '".' . $match . '."', $code);
                                $matchesFound[$match] = 1;
                        }
@@ -1428,7 +1428,10 @@ function determinePageTitle () {
                $pageTitle = '{--NO_CONFIG_FOUND_TITLE--}';
 
                // Do not add the fatal message in installation mode
-               if ((!isInstalling()) && (!isConfigurationLoaded())) addFatalMessage(__FUNCTION__, __LINE__, '{--NO_CONFIG_FOUND--}');
+               if ((!isInstalling()) && (!isConfigurationLoaded())) {
+                       // Please report this
+                       debug_report_bug(__FUNCTION__, __LINE__, 'No configuration data found!');
+               } // END - if
        }
 
        // Return title