diff --git a/phpBB/includes/page_tail.php b/phpBB/includes/page_tail.php
index d49195fed7..c2507bac8b 100644
--- a/phpBB/includes/page_tail.php
+++ b/phpBB/includes/page_tail.php
@@ -34,10 +34,22 @@ $template->set_filenames(array(
'overall_footer' => ( empty($gen_simple_header) ) ? 'overall_footer.tpl' : 'simple_footer.tpl')
);
+//
+// Output page creation time
+//
+if ( DEBUG )
+{
+ $mtime = microtime();
+ $mtime = explode(' ', $mtime);
+ $totaltime = ( $mtime[1] + $mtime[0] ) - $starttime;
+ $gzip_text = ( $board_config['gzip_compress'] ) ? 'GZIP compression enabled' : 'GZIP compression disabled';
+}
+
$template->assign_vars(array(
'PHPBB_VERSION' => '2' . $board_config['version'],
'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '',
- 'ADMIN_LINK' => $admin_link)
+ 'ADMIN_LINK' => $admin_link,
+ 'DEBUG_OUTPUT' => ( DEBUG ) ? sprintf('
phpBB Created this page in %f seconds : ' . $db->sql_num_queries() . ' queries executed : ' . $gzip_text, $totaltime) : '')
);
$template->pparse('overall_footer');
@@ -47,20 +59,6 @@ $template->pparse('overall_footer');
//
$db->sql_close();
-//
-// Output page creation time
-//
-$mtime = microtime();
-$mtime = explode(' ',$mtime);
-$mtime = $mtime[1] + $mtime[0];
-$endtime = $mtime;
-$totaltime = ($endtime - $starttime);
-
-$gzip_text = ($board_config['gzip_compress']) ? "GZIP compression enabled" : "GZIP compression disabled";
-$debug_mode = (DEBUG) ? " : Debug Mode" : "";
-
-printf("