function atThemeExit() { $runningconfig = atGetRunningConfig(); extract($runningconfig); $display = ob_get_contents(); list($junk, $display) = atTemplateSplit($display, "#AUTOTHEME_START#"); $display = atThemeAddHeader() . $display; $display = str_replace('$', '\\$', $display); //atRunningSetVar('display', $display); //atCommandAdd('display', 'echo $display;'); $template = $template['dtd']; if (!$template) { $template = "HTML401_Transitional.html"; } if (@file_exists($themepath . $template)) { $file = $themepath . $template; } elseif (@file_exists($atdir . "templates/{$platform}/{$template}")) { $file = $atdir . "templates/{$platform}/{$template}"; } else { $file = $atdir . "templates/HTML.html"; } $HTML = atTemplateRead($file); $HTML = eregi_replace('\\<\\/head\\>', '', $HTML); $HTML = preg_replace('/(\\<\\!--[ ]*\\[|{)display(}|\\][ ]*--\\>)/', $display, $HTML); $output = atCommandReplace($HTML); ob_end_clean(); atTemplateDisplay($output); return die; }
function atCompileRead($filename, $modifier = "") { $globalconfig = atGetGlobalConfig(); extract($globalconfig); $oldmask = umask(0); $filetime = @filemtime($incdir . "atCommands.php") + @filemtime($platformdir . "atCommands.php") + @filemtime($atdir . "autotheme.cfg") + @filemtime($themepath . "theme.cfg") + @filemtime($filename); $filepre = atGetCompileFilename($filename, $modifier); $filename = $filepre . "_" . $filetime; if ($output = atTemplateRead($compiledir . $filename)) { return $output; } else { return false; } }