]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
Deprecated variables for templates removed, mor EL-rewrites, getMessage() rewritten:
[mailer.git] / inc / functions.php
index 7838ec88620947b87d2cc7c6bb17e64386358bf7..7dfee36d0ba653e7cd9aeeef957d0f33faafcaf1 100644 (file)
@@ -178,7 +178,7 @@ function doFinalCompilation ($code, $insertComments = true) {
        $cnt = 0;
 
        // Compile all out
-       while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 3)) {
+       while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 4)) {
                // Init common variables
                $content = array();
                $newContent = '';
@@ -432,12 +432,6 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0') {
        // Make sure all template names are lowercase!
        $template = strtolower($template);
 
-       // Default 'nickname' if extension is not installed
-       $nick = '---';
-
-       // Neutral email address is default
-       $email = getConfig('WEBMASTER');
-
        // Is content an array?
        if (is_array($content)) {
                // Add expiration to array
@@ -2058,13 +2052,16 @@ function isUrlValid ($URL, $compile=true) {
 }
 
 // Generate a list of administrative links to a given userid
-function generateMemberAdminActionLinks ($userid, $status = '') {
+function generateMemberAdminActionLinks ($userid) {
        // Make sure userid is a number
        if ($userid != bigintval($userid)) debug_report_bug(__FUNCTION__, __LINE__, 'userid is not a number!');
 
        // Define all main targets
        $targetArray = array('del_user', 'edit_user', 'lock_user', 'add_points', 'sub_points');
 
+       // Get user status
+       $status = getFetchedUserData('userid', $userid, 'status');
+
        // Begin of navigation links
        $OUT = '[';
 
@@ -2087,10 +2084,10 @@ function generateMemberAdminActionLinks ($userid, $status = '') {
                        $OUT .= strtoupper($tar);
                }
                $OUT .= '--}</a></span>|';
-       }
+       } // END - foreach
 
        // Finish navigation link
-       $OUT = substr($OUT, 0, -7) . ']';
+       $OUT = substr($OUT, 0, -1) . ']';
 
        // Return string
        return $OUT;
@@ -3042,10 +3039,10 @@ function addNewBonusMail ($data, $mode = '', $output=true) {
                );
 
                // Mail inserted into bonus pool
-               if ($output) loadTemplate('admin_settings_saved', false, getMessage('ADMIN_BONUS_SEND'));
+               if ($output) loadTemplate('admin_settings_saved', false, '{--ADMIN_BONUS_SEND--}');
        } elseif ($output) {
                // More entered than can be reached!
-               loadTemplate('admin_settings_saved', false, getMessage('ADMIN_MORE_SELECTED'));
+               loadTemplate('admin_settings_saved', false, '{--ADMIN_MORE_SELECTED--}');
        } else {
                // Debug log
                logDebugMessage(__FUNCTION__, __LINE__, "cat={$data['cat']},receiver={$data['receiver']},data=".base64_encode(serialize($data))." More selected, than available!");
@@ -3876,11 +3873,16 @@ function generateMetaDescriptionCode () {
 }
 
 // Generates an FQFN for template cache from the given template name
-function generateCacheFqfn ($template) {
+function generateCacheFqfn ($template, $mode = 'html') {
        // Is this cached?
        if (!isset($GLOBALS['template_cache_fqfn'][$template])) {
                // Generate the FQFN
-               $GLOBALS['template_cache_fqfn'][$template] = sprintf("%s_compiled/html/%s.tpl.cache", getConfig('CACHE_PATH'), $template);
+               $GLOBALS['template_cache_fqfn'][$template] = sprintf(
+                       "%s_compiled/%s/%s.tpl.cache",
+                       getConfig('CACHE_PATH'),
+                       $mode,
+                       $template
+               );
        } // END - if
 
        // Return it