incrementConfigEntry('num_templates');
// The local file does exists so we load it. :)
- $GLOBALS['tpl_content'] = readFromFile($FQFN);
+ $GLOBALS['tpl_content'][$template] = readFromFile($FQFN);
// Do we have to compile the code?
$ret = '';
- if ((strpos($GLOBALS['tpl_content'], '$') !== false) || (strpos($GLOBALS['tpl_content'], '{--') !== false) || (strpos($GLOBALS['tpl_content'], '{?') !== false) || (strpos($GLOBALS['tpl_content'], '{%') !== false)) {
+ if ((strpos($GLOBALS['tpl_content'][$template], '$') !== false) || (strpos($GLOBALS['tpl_content'][$template], '{--') !== false) || (strpos($GLOBALS['tpl_content'][$template], '{?') !== false) || (strpos($GLOBALS['tpl_content'][$template], '{%') !== false)) {
// Normal HTML output?
if (isHtmlOutputMode()) {
// Add surrounding HTML comments to help finding bugs faster
- $ret = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['tpl_content'] . '<!-- Template ' . $template . ' - End //-->';
+ $ret = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['tpl_content'][$template] . '<!-- Template ' . $template . ' - End //-->';
// Prepare eval() command
$GLOBALS['template_eval'][$template] = '$ret = "' . getColorSwitchCode($template) . compileCode(escapeQuotes($ret)) . '";';
} elseif (substr($template, 0, 3) == 'js_') {
// JavaScripts don't like entities and timings
- $GLOBALS['template_eval'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['tpl_content'])) . '");';
+ $GLOBALS['template_eval'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['tpl_content'][$template])) . '");';
} else {
// Prepare eval() command, other output doesn't like entities, maybe
- $GLOBALS['template_eval'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'])) . '");';
+ $GLOBALS['template_eval'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'][$template])) . '");';
}
} else {
// Add surrounding HTML comments to help finding bugs faster
- $ret = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['tpl_content'] . '<!-- Template ' . $template . ' - End //-->';
+ $ret = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['tpl_content'][$template] . '<!-- Template ' . $template . ' - End //-->';
$GLOBALS['template_eval'][$template] = '$ret = "' . getColorSwitchCode($template) . compileRawCode(escapeQuotes($ret)) . '";';
} // END - if
} elseif ((isAdmin()) || ((isInstalling()) && (!isInstalled()))) {
$newContent = '';
if (isFileReadable($FQFN)) {
// The local file does exists so we load it. :)
- $GLOBALS['tpl_content'] = readFromFile($FQFN);
+ $GLOBALS['tpl_content'][$template] = readFromFile($FQFN);
// Run code
- $GLOBALS['tpl_content'] = '$newContent = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'])) . '");';
- eval($GLOBALS['tpl_content']);
+ $GLOBALS['tpl_content'][$template] = '$newContent = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'][$template])) . '");';
+ eval($GLOBALS['tpl_content'][$template]);
} elseif (!empty($template)) {
// Template file not found!
$newContent = '<div class="para">
</div>';
// Debug mode not active? Then remove the HTML tags
- if (!isDebugModeEnabled()) $newContent = secureString($newContent);
+ if (!isDebugModeEnabled()) {
+ // Remove HTML tags
+ $newContent = secureString($newContent);
+ } // END - if
} else {
// No template name supplied!
$newContent = '{--NO_TEMPLATE_SUPPLIED--}';
// Is there some content?
if (empty($newContent)) {
// Compiling failed
- $newContent = "Compiler error for template " . $template . " !\nUncompiled content:\n" . $GLOBALS['tpl_content'];
+ $newContent = "Compiler error for template " . $template . " !\nUncompiled content:\n" . $GLOBALS['tpl_content'][$template];
// Add last error if the required function exists
if (function_exists('error_get_last')) $newContent .= "\n--------------------------------------\nDebug:\n".print_r(error_get_last(), true)."--------------------------------------\nPlease don't alter these informations!\nThanx.";