// Use it again
$code = $newContent;
+ // Compile the final code
+ $code = compileRawCode($code);
+
// Count round
$count++;
} // END - while
+ // Add debugging data in HTML code, if mode is enabled
+ if ((isDebugModeEnabled()) && ($insertComments === true)) {
+ // Add loop count
+ $code .= '<!-- Total compilation loop=' . $count . ' //-->';
+ } // END - if
+
// Return the compiled code
return $code;
}
// Loads an email template and compiles it
function loadEmailTemplate ($template, $content = array(), $userid = '0', $loadUserData = true) {
+ // @TODO $DATA is deprecated and should be avoided and replaced with $content
global $DATA;
// Make sure all template names are lowercase!
$code = str_replace($secChars['to'], $secChars['from'], $code);
// Find $content[bla][blub] entries
- // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
- preg_match_all('/\$(content|GLOBALS|DATA)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches);
+ // @TODO Do only use $content and deprecate $DATA in templates
+ preg_match_all('/\$(content|DATA)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches);
// Are some matches found?
if ((count($matches) > 0) && (count($matches[0]) > 0)) {
} // END - foreach
// Skip this entry?
- if ($fuzzyFound === true) continue;
+ if ($fuzzyFound === true) {
+ continue;
+ } // END - if
// Take all string elements
if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key.'_' . $matches[4][$key]]))) {
$newMatch = str_replace('[', "['", str_replace(']', "']", $match));
$code = str_replace($match, '".' . $newMatch . '."', $code);
$matchesFound[$key . '_' . $matches[4][$key]] = 1;
- $matchesFound[$match] = 1;
+ $matchesFound[$match] = true;
} elseif (!isset($matchesFound[$match])) {
// Not yet replaced!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'match=' . $match);
$code = str_replace($match, '".' . $match . '."', $code);
$matchesFound[$match] = 1;
+ } else {
+ // Everthing else should be a least logged
+ logDebugMessage(__FUNCTION__, __LINE__, 'match=' . $match . ',key=' . $key);
}
} // END - foreach
} // END - if
$EMAIL = generateSponsorEmailLink($email);
}
- // Shall I close the link when there is no admin?
- if ((!isAdmin()) && ($EMAIL == $email)) $EMAIL = '#'; // Closed!
-
// Return email link
return $EMAIL;
}
$GLOBALS['page_header'] .= '<meta name="description" content="' . $DESCR . '" />';
} // END - if
- // Remove depth
- unset($GLOBALS['ref_level']);
+ // Initialize referal system
+ initReferalSystem();
}
// Generates an FQFN for template cache from the given template name