diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-06-30 21:04:37 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-06-30 21:04:37 +0000 |
commit | 3c5311ccfa71c85a5897664b1ee4aa2c1dde7256 (patch) | |
tree | 02abb4ed453a298177b738d198b76f7b524719fd /phpBB/includes/page_header.php | |
parent | 7cd3c42c632d8b31977b8f3cf35eaa78af88ddd5 (diff) | |
download | forums-3c5311ccfa71c85a5897664b1ee4aa2c1dde7256.tar forums-3c5311ccfa71c85a5897664b1ee4aa2c1dde7256.tar.gz forums-3c5311ccfa71c85a5897664b1ee4aa2c1dde7256.tar.bz2 forums-3c5311ccfa71c85a5897664b1ee4aa2c1dde7256.tar.xz forums-3c5311ccfa71c85a5897664b1ee4aa2c1dde7256.zip |
Added some gzip compression capability
git-svn-id: file:///svn/phpbb/trunk@528 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/page_header.php')
-rw-r--r-- | phpBB/includes/page_header.php | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php index 0864aeeea3..165d5566de 100644 --- a/phpBB/includes/page_header.php +++ b/phpBB/includes/page_header.php @@ -25,6 +25,29 @@ define(HEADER_INC, TRUE); // +// gzip_compression +// +if($board_config['gzip_compress']) +{ + $phpver = phpversion(); + + if($phpver >= "4.0.4pl1") + { + if(extension_loaded("zlib")) + { + ob_start("ob_gzhandler"); + } + } + else if($phpver > "4.0") + { + // It would be nice if we + // used output buffering here + // to allow compression for + // versions < 4.0.4pl1 + } +} + +// // Parse and show the overall header. // $template->set_filenames(array( @@ -86,15 +109,11 @@ if(!$result) $logged_online = 0; $guests_online = 0; - -$row = $db->sql_fetchrowset($result); -$num_rows = $db->sql_numrows($result); -for($x = 0; $x < $num_rows; $x++) +while($row = $db->sql_fetchrow($result)) { - - if($row[$x]['session_logged_in']) + if($row['session_logged_in']) { - $userlist_ary[] = "<a href=\"".append_sid("profile." . $phpEx . "?mode=viewprofile&" . POST_USERS_URL . "=" . $row[$x]['user_id']) . "\">" . $row[$x]['username'] . "</a>"; + $userlist_ary[] = "<a href=\"".append_sid("profile." . $phpEx . "?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . "\">" . $row['username'] . "</a>"; $logged_online++; } else @@ -102,7 +121,6 @@ for($x = 0; $x < $num_rows; $x++) $guests_online++; } } - $userlist = ""; for($i = 0; $i < $logged_online; $i++) { |