This code is adapted from the reference script at zend.com, but with the addition of the ability to set the zip compression level. You can alter the line $gziplevel = 1; to use any number between 0-9 (0 is no compression), but i've found that for my site, a level of 1-3 gives the best balance of speed against CPU loading.
Once you have installed the code snippet, you can test that it's working by a) trying to access your forums b) inputting your URL here (you need to specify the .php file, rather than just the directory) http://leknor.com/code/gziped.php
Of course, you will need to have PHP built with zlib support for this to work. Find out by running a phpinfo() script...