1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-15 21:44:56 +01:00

Some transfers from 2.0.x plus move debugging to template var which will please some people

git-svn-id: file:///svn/phpbb/trunk@2621 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-06-08 16:45:41 +00:00
parent d75291c5d2
commit 397e8ef31b
2 changed files with 17 additions and 19 deletions

View File

@ -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('<br /><br />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("<br /><center><font size=\"-2\">phpBB Created this page in %f seconds : " . $db->num_queries . " queries executed : $gzip_text".$debug_mode."</font></center>", $totaltime);
//
// Compress buffered output if required and send to browser
//
@ -78,10 +76,10 @@ if ( $do_gzip_compress )
$gzip_contents = gzcompress($gzip_contents, 9);
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
echo '\x1f\x8b\x08\x00\x00\x00\x00\x00';
echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
echo $gzip_contents;
echo pack('V', $gzip_crc);
echo pack('V', $gzip_size);
echo pack("V", $gzip_crc);
echo pack("V", $gzip_size);
}
exit;

View File

@ -10,7 +10,7 @@
The phpBB Group : 2002
// -->
Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> {PHPBB_VERSION} &copy; 2001 phpBB Group<br />{TRANSLATION_INFO}</span></div>
Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> {PHPBB_VERSION} &copy; 2001 phpBB Group<br />{TRANSLATION_INFO}{DEBUG_OUTPUT}</span></div>
</td>
</tr>
</table>