function compress_out ($input) { //Based on old YaBBSE code (c) //Open-Source Project by Zef Hemel (zef@zefnet.com ) //Copyright (c) 2001-2002 The YaBB Development Team if((function_exists("gzcompress")) && (function_exists("crc32"))){ if(strpos(" " . $_SERVER['HTTP_ACCEPT_ENCODING'], "x-gzip")){ $encode = "x-gzip"; } elseif(strpos(" " . $_SERVER['HTTP_ACCEPT_ENCODING'], "gzip")){ $encode = "gzip"; } if (isset($encode)){ header("Content-Encoding: $encode"); $encode_size = strlen($input); $encode_crc = crc32($input); $out = "\x1f\x8b\x08\x00\x00\x00\x00\x00"; $out .= substr(gzcompress($input, 1), 0, -4); $out .= pack("V", $encode_crc); $out .= pack("V", $encode_size); } else{ $out = $input; } } else{ $out = $input; } return ($out); }