GZip Compression Mod 0.1 This mod adds gzip page compression to your forum. It can dramatically decrease a bandwith of your board! :) NOTE: You can disable this mod in the Admin Center or by setting '$gzcomp = 0' in your Settings.pl This mod works on Gold SP1. Andrey Chesnackov http://virus.mega.net.kg Sources/AdminEdit.pl my($snfchecked, $fls1, $fls2, $fls3, $utfchecked, $truncchecked, $mts1, $mts2, $mts3, $tsl6, $tsl5, $tsl4, $tsl3, $tsl2, $tsl1); my($gzc1, $gzc2, $gzc3, $gzchecked); if ($timeselected == 6) { $tsl6 = " selected" } elsif ($timeselected == 5) { $tsl5 = " selected" } elsif ($timeselected == 4) { $tsl4 = " selected" } elsif ($timeselected == 3) { $tsl3 = " selected" } elsif ($timeselected == 2) { $tsl2 = " selected" } else { $tsl1 = " selected" } if ($gzcomp == 0) { $gzc1 = ' selected'; } elsif ($gzcomp == 1) { $gzc2 = ' selected'; } elsif( $gzcomp == 2 ) { $gzc3 = ' selected'; } $gzchecked = $gzforce ? ' checked' : '';
$gztxt{'1'} $gztxt{'2'}
$userpic_limits =~ s/\"/\'/g; $gzcomp = $FORM{'gzcomp'} || 0; $gzforce = $FORM{'gzforce'} || 0; # "truncate() function not supported on this platform." # 0 to disable, 1 to enable. \$gzcomp = $gzcomp; # GZip compression: 0 = No Compression, 1 = External gzip, 2 = Zlib::Compress \$gzforce = $gzforce; # Don't try to check whether browser supports GZip Sources/Subs.pl sub template { my $gzaccept= $ENV{'HTTP_ACCEPT_ENCODING'}=~/\bgzip\b/ || $gzforce; if ($gzcomp && $gzaccept) { if($yySetCookies1 || $yySetCookies2) { print header(-cookie=>[$yySetCookies1, $yySetCookies2] , 'Content-Encoding' => 'gzip' ); } else { print header(-status=>'200 OK' , 'Content-Encoding' => 'gzip' ); } } else { else { print header(-status=>'200 OK'); } } $yyboardname = $mbname; $yytime = &timeformat($date, 1); my $output=''; $curline =~ s~~${"yy$1"}~g; print $curline; $curline =~ s~~${"yy$1"}~g; $output .= $curline; print q~
Sorry, the copyright tag must be in the template.
Please notify this forum's administrator that this site is using an ILLEGAL copy of YaBB!
~; } }
$output .= q~
Sorry, the copyright tag must be in the template.
Please notify this forum's administrator that this site is using an ILLEGAL copy of YaBB!
~; } if ($gzcomp && $gzaccept) { if ($gzcomp==1) { $| = 1; open(GZIP, "| gzip -f"); print GZIP $output; close(GZIP); } else { require Compress::Zlib; print Compress::Zlib::memGzip($output); } } else { print $output; } }
english.lng if($MenuType == 1) { $gztxt{'1'} = "Use GZip-compression?
Make sure that selectet method is available!"; $gztxt{'2'} = "Don't try to check whether browser supports GZip";
Settings.pl # "truncate() function not supported on this platform." # 0 to disable, 1 to enable. $gzcomp = 0; # GZip compression: 0 = No Compression, 1 = External gzip, 2 = Zlib::Compress $gzforce = 0; # Don't try to check whether browser supports GZip