' . $_compiled); $result = @ob_get_contents(); @ob_end_clean(); } // now parse the default content block. $html = $smarty->fetch('template:notemplate') . "\n"; } else { //$smarty->caching = false; // $smarty->compile_check = true; // we allow backward compatibility (for a while) // for people that have hacks for setting page title // or header variables by capturing a modules output // to a smarty variable, and then displaying it later. if( isset($config['process_whole_template']) && $config['process_whole_template'] === false ) { $top = $smarty->fetch('tpl_top:'.$contentobj->TemplateId()); $body = $smarty->fetch('tpl_body:'.$contentobj->TemplateId()); $head = $smarty->fetch('tpl_head:'.$contentobj->TemplateId()); $html = $top.$head.$body; } else { $html = $smarty->fetch('template:'.$contentobj->TemplateId()); } } } Events::SendEvent('Core', 'ContentPostRender', array('content' => &$html)); $ct = cmsms()->get_variable['content-type']; if( !$ct ) $ct = 'text/html'; header("Content-Type: $ct; charset=" . get_encoding()); echo $html; @ob_flush(); $endtime = microtime(); $db =& cmsms()->GetDb(); $memory = (function_exists('memory_get_usage')?memory_get_usage():0); $memory = $memory - $orig_memory; $memory_peak = (function_exists('memory_get_peak_usage')?memory_get_peak_usage():0); if ( !is_sitedown() && $config["debug"] == true) { echo "
Generated in ".microtime_diff($starttime,$endtime)." seconds by CMS Made Simple using ".(isset($db->query_count)?$db->query_count:'')." SQL queries and {$memory} bytes of memory (peak memory usage was {$memory_peak})
"; } else if( isset($config['show_performance_info']) && ($showtemplate == true) ) { debug_to_log('performance info: '.microtime_diff($starttime,$endtime)." / ".(isset($db->query_count)?$db->query_count:'')." / {$memory} / {$memory_peak}"); echo "\n"; } if( is_sitedown() || $config['debug'] == true) { $smarty->clear_compiled_tpl(); #$smarty->clear_all_cache(); } if ( !is_sitedown() && $config["debug"] == true) { #$db->LogSQL(false); // turn off logging # output summary of SQL logging results #$perf = NewPerfMonitor($db); #echo $perf->SuspiciousSQL(); #echo $perf->ExpensiveSQL(); #echo $sql_queries; foreach ($gCms->errors as $error) { echo $error; } } if( $page == '__CMS_PREVIEW_PAGE__' && isset($_SESSION['cms_preview']) ) // temporary { unset($_SESSION['cms_preview']); } # vim:ts=4 sw=4 noet ?>