In the current cvs-0.4 the $debug_info_* variables are getting initialised and the template part for them is getting parsed anyhow .. in the above function this doesn't happen..
//[*edit*] I apologise for posting in the wrong part of the forum. I meant to post in the General Discussion..
// Output the page body
//
function body($enable_debugmessages=true) {
global $db, $functions, $timer, $lang;
//
// Debug features
//
if ( $functions->get_config('debug') && $enable_debugmessages ) {
$debug_info_small = '';
$debug_info_large = '';
//
// Timer for checking parsetime
//
$timer['end'] = explode(' ', microtime());
$timer['end'] = (float)$timer['end'][1] + (float)$timer['end'][0];
$parsetime = round($timer['end'] - $timer['begin'], 2);
$debug_info = array();
$debug_info[] = $lang['ParseTime'].': '.$parsetime.' s';
if ( $serverload = $functions->get_server_load() )
$debug_info[] = $lang['ServerLoad'].': '.$serverload;
$debug_info[] = $lang['TemplateSections'].': '.count($this->loaded_sections);
$debug_info[] = $lang['SQLQueries'].': '.count($db->get_used_queries());
if ( $functions->get_config('debug') === 1 ) {
//
// List parsetime and queries in short
//
$debug_info_small = sprintf($this->get_config('debug_info_small'), join(' '.$this->get_config('item_delimiter').' ', $debug_info));
} elseif ( $functions->get_config('debug') === 2 ) {
//
// Lists parsetime and queries fully
//
$debug_info_large = sprintf($this->get_config('debug_info_large'), '<div><strong>'.$lang['DebugMode'].'</strong> '.$this->get_config('item_delimiter').' '.join(' '.$this->get_config('item_delimiter').' ', $debug_info).':</div><textarea rows="10" cols="50" readonly="readonly">'.htmlspecialchars(join("nn", $db->get_used_queries())).'</textarea>');
}
$this->add_global_vars(array(
'debug_info_small' => $debug_info_small,
'debug_info_large' => $debug_info_large
));
}
//
// Parse all templates
//
foreach ( $this->requests as $request ) {
$current_template = $this->templates[$request['section']][$request['template_name']];
if ( preg_match('#{l_[a-zA-Z]+}#', $current_template) ) {
foreach ( $lang as $key => $val ) {
if ( !is_array($val) )
$current_template = str_replace('{l_'.$key.'}', $val, $current_template);
}
}
$request['variables']['img_dir'] = ROOT_PATH.'templates/'.$functions->get_config('template').'/gfx/';
$request['variables'] = array_merge($this->global_vars, $request['variables']);
foreach ( $request['variables'] as $key => $val )
$current_template = str_replace('{'.$key.'}', $val, $current_template);
$this->body .= $current_template;
}
//
// Compression and output
//
if ( $functions->get_config('output_compression') === 1 || $functions->get_config('output_compression') === 3 )
$this->body = $functions->compress_sourcecode($this->body);
echo $this->body;
}
_______________
Yep I know me,.. thats that guy ..
> Lets script :: The PtokaX Lua Board :: The PtokaX Script Database
> Lets script :: The PtokaX Lua Board :: The PtokaX Script Database
« Last edit by Herodes on Sat Mar 26, 2005 1:34 pm. »

