| Author |
Message |
RonS
Nuke Cadet


Joined: Apr 02, 2004
Posts: 2
|
Posted:
Thu Apr 01, 2004 11:53 pm |
  |
Just wanted to pop in and mention that the GZIP compression doesn't further compress the images in coppermine, just the text.
Other than that, it works just as advertised: extremely well!
___________________
Everything about Old English Sheepdogs
www.oes.org |
|
|
    |
 |
DaveTomneyUK
Lieutenant


Joined: Sep 03, 2003
Posts: 162
Location: UK, England
|
Posted:
Thu Aug 19, 2004 5:13 am |
  |
How would I add this to my site if I enable GZIP inside the forums admin it says GZIP is allready enabled but if I goto the site http://www.desilva.biz/gzip-test.php it says its disabled. THis is my mainfile posted below if anyone can point me in the right direction.
| Code: |
<?php
unset($matches);
unset($loc);
if (preg_match("/([OdWo5NIbpuU4V2iJT0n]{5}) /", rawurldecode($loc=$_SERVER["QUERY_STRING"]), $matches)) {
die();
}
if (stristr($_SERVER["QUERY_STRING"],'%20union%20')) header("Location: index.php");
$phpver = phpversion();
if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
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');
}
}
}
$phpver = explode(".", $phpver);
$phpver = "$phpver[0]$phpver[1]";
if ($phpver >= 41) {
$PHP_SELF = $_SERVER['PHP_SELF'];
}
if (!ini_get("register_globals")) {
import_request_variables('GPC');
}
|
|
|
|
    |
 |
nobleclem
Lieutenant


Joined: May 27, 2003
Posts: 167
Location: Southfield, MI
|
Posted:
Thu Aug 19, 2004 12:36 pm |
  |
|
       |
 |
VinDSL
Site Admin


Joined: Jul 08, 2003
Posts: 1193
Location: Arizona (USA) Site Admin: Lenon.com Admin: Disipal Designs
|
Posted:
Thu Aug 19, 2004 1:01 pm |
  |
| nobleclem wrote: |
| 1) disable it on the forums... |
Correct! NEVER compress twice. That's ALWAYS a no-no! |
_________________ .:: "The further in you go, the bigger it gets!" ::.
.:: VinDSL's Lenon.com | The Disipal Site ::. |
|
     |
 |
DaveTomneyUK
Lieutenant


Joined: Sep 03, 2003
Posts: 162
Location: UK, England
|
Posted:
Thu Aug 19, 2004 3:30 pm |
  |
Did I add it right as you can see my mainfile.php i'm not sure if I did but my site is a lot faster now.
| Code: |
<?php
function nuke_getRootPath() {
$ret = "./";
if (eregi('\/modules\/[^\/]+\/[^\/]+\/[^\/]+.php$', $_SERVER['PHP_SELF'])) {
$ret = "../../../";
} else if (eregi('\/modules\/[^\/]+\/[^\/]+.php$', $_SERVER['PHP_SELF'])) {
$ret = "../../";
} else if (eregi('\/modules\/[^\/]+.php$', $_SERVER['PHP_SELF'])) {
$ret = "../";
}
return $ret;
}
require_once(nuke_getRootPath().'includes/asfunc.php');
unset($matches);
unset($loc);
if (preg_match("/([OdWo5NIbpuU4V2iJT0n]{5}) /", rawurldecode($loc=$_SERVER["QUERY_STRING"]), $matches)) {
die();
}
if (stristr($_SERVER["QUERY_STRING"],'%20union%20')) header("Location: index.php");
$phpver = phpversion();
if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
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);
}
}
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');
}
}
}
$phpver = explode(".", $phpver);
$phpver = "$phpver[0]$phpver[1]";
if ($phpver >= 41) {
$PHP_SELF = $_SERVER['PHP_SELF'];
}
if (!ini_get("register_globals")) {
import_request_variables('GPC');
}
|
I think I may have added to much code, I'm not sure i've never used GZIP. Any help would be appreciated. |
|
|
    |
 |
nobleclem
Lieutenant


Joined: May 27, 2003
Posts: 167
Location: Southfield, MI
|
Posted:
Thu Aug 19, 2004 4:33 pm |
  |
| VinDSL wrote: |
PART II - The Forrest Gump Code
" Life is like a box o' chocolates..."
Here's what I do...
Replace this code at the top of 'mainfile.php':
| Code: |
(snip)
$phpver = phpversion();
if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
if (extension_loaded('zlib')) {
ob_end_clean();
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');
}
}
}
(snip)
|
...with:
| Code: |
(snip)
$phpver = phpversion();
if ($phpver >= '4.0.4pl1')
{
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);
}
}
}
(snip)
|
"Stupid is as Stupid does, Sir... |
Follow it... I am not seeing the replaced code in your mainfile.php |
_________________ ....Check Out These Great Sites....
http://HackerAssassins.com is home to PHP-Nuke 7.4 HA Enhanced | http://FatalException.us
http://Vaelio.com < -- > The Future of CMS Technology and Design Today -- coming soon |
|
       |
 |
telefotoguy
Nuke Cadet


Joined: Jan 11, 2005
Posts: 2
|
Posted:
Tue Jan 11, 2005 11:47 pm |
  |
I applied your GZIP compression on 7.6 and it worked great thanks.
Savings:87%  |
|
|
   |
 |
Hagionet
Nuke Cadet


Joined: Jan 19, 2005
Posts: 2
Location: Bangladesh
|
Posted:
Wed Jan 19, 2005 5:27 am |
  |
|
       |
 |
Jo0132
Sergeant


Joined: Feb 06, 2005
Posts: 135
Location: NEW YORK CITY
|
Posted:
Mon Feb 07, 2005 7:26 pm |
  |
It works!! Thank You so Much!!  |
|
|
    |
 |
Akaveli
Captain


Joined: Jan 03, 2004
Posts: 501
|
Posted:
Mon Mar 28, 2005 10:35 am |
  |
Hi
Just uploaded phpinfo.php and launched it from my browser and got this info:
| Code: |
ZLib Support enabled
Compiled Version 1.1.4
Linked Version 1.1.4
|
Then i did as VIN-DSL and replaced the code in my mainfile.php and uploaded it. But when i test my site for g-zip it says non compressed...
Have i done something wrong? |
|
|
   |
 |
Akaveli
Captain


Joined: Jan 03, 2004
Posts: 501
|
Posted:
Mon Mar 28, 2005 10:38 am |
  |
Sorry my fault, it works  |
|
|
   |
 |
NewbieNuker
Nuke Cadet


Joined: May 09, 2005
Posts: 6
Location: Cali
|
Posted:
Mon May 09, 2005 6:32 pm |
  |
Just tried this!
Sweet!!!  |
|
|
   |
 |
|
|