MOD可以增快論壇速度phpBB2 Fast Hack
發表於 : 2006-05-27 , 12:02
MOD可以增快論壇速度phpBB2 Fast Hack
http://phpbb-tw.net/phpbb/viewtopic.php ... es&start=0
OPEN
FIND
REPLACE WITH
http://phpbb-tw.net/phpbb/viewtopic.php ... es&start=0
代碼: 選擇全部
###############################################
## Hack Title: phpBB2 Fast Hack
## Hack Version: 1.0.0
## Author: dwing <dwing> (Dimitri Seitz) http://www.weingarten-net.de
## Description: This makes your phpBB 2 forum faster.
##
## Updated to phpBB 2.0.6 Compatibility by: James Wong <james>
## Updated with permission from the original author.
##
## Compatibility: 2.0.0 - 2.0.6
##
## Installation Level: Easy
## Installation Time: 1 minute
## Files To Edit: <1>
## page_header.php
## file.php
##
## Included Files: <0>
## N/A
##
## History:
## <Version> : 2.0.6 Compliant
## <Version> : Initial Release :)
##
## Author Notes:
## If you have questions or suggestions just mail me @
## dwing@weingarten-net.de?subject=FASTandFURIOUS.
##
## Support: http://www.phpbbhacks.com/forums
##
##
###############################################
## You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
## Please visit http://www.phpbbhacks.com/forums for support.
###############################################
##
###############################################
## This hack is released under the GPL License.
## This hack can be freely used, but not distributed, without permission.
## Intellectual Property is retained by the hack author(s) listed above.
###############################################
OPEN
代碼: 選擇全部
includes/page_header.php
FIND
代碼: 選擇全部
//
// gzip_compression
//
$do_gzip_compress = FALSE;
if ( $board_config['gzip_compress'] )
{
$phpver = phpversion();
$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
{
if ( extension_loaded('zlib') )
{
ob_start('ob_gzhandler');
}
}
else if ( $phpver > '4.0' )
{
if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
{
if ( extension_loaded('zlib') )
{
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);
header('Content-Encoding: gzip');
}
}
}
}
REPLACE WITH
代碼: 選擇全部
//
// gzip_compression
//
$do_gzip_compress = FALSE;
if($board_config['gzip_compress'])
{
$phpver = phpversion();
if($phpver >= "4.0.4pl1")
{
if(extension_loaded("zlib"))
{
if (headers_sent() != TRUE)
{
$gz_possible = isset($HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]) && eregi("gzip, deflate",$HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"]);
if ($gz_possible) ob_start("ob_gzhandler");
}
}
}
else if($phpver > "4.0")
{
if(strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip'))
{
if(extension_loaded("zlib"))
{
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);
header("Content-Encoding: gzip");
}
}
}
}