diff options
-rw-r--r-- | phpBB/common.php | 7 | ||||
-rw-r--r-- | phpBB/db/mysql_schema.sql | 3 | ||||
-rw-r--r-- | phpBB/db/postgres_schema.sql | 3 | ||||
-rw-r--r-- | phpBB/includes/page_header.php | 34 |
4 files changed, 36 insertions, 11 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index b9e2d46cce..08bff322de 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -40,6 +40,7 @@ $url_images = "images"; $images['quote'] = "$url_images/quote.gif"; $images['edit'] = "$url_images/edit.gif"; $images['profile'] = "$url_images/profile.gif"; +$images['privmsg'] = "$url_images/icon_pm.gif"; $images['email'] = "$url_images/email.gif"; $images['pmsg'] = "$url_images/pm.gif"; $images['delpost'] = "$url_images/edit.gif"; @@ -86,6 +87,7 @@ if(!$result = $db->sql_query($sql)) $board_config['default_dateformat'] = "d M Y H:i"; $board_config['default_theme'] = 1; $board_config['default_lang'] = "english"; + $board_config['gzip_compress'] = 0; // Our template class hasn't been instantiated // so we do it here. @@ -96,7 +98,7 @@ if(!$result = $db->sql_query($sql)) else { $config = $db->sql_fetchrow($result); - + $board_config['sitename'] = stripslashes($config['sitename']); $board_config['allow_html'] = $config['allow_html']; $board_config['allow_bbcode'] = $config['allow_bbcode']; @@ -122,6 +124,9 @@ else $board_config['avatar_max_height'] = $config['avatar_max_height']; $board_config['avatar_path'] = $config['avatar_path']; $board_config['prune_enable'] = $config['prune_enable']; + $board_config['gzip_compress'] = $config['gzip_compress']; } + include('language/lang_'.$board_config['default_lang'].'.'.$phpEx); + ?> diff --git a/phpBB/db/mysql_schema.sql b/phpBB/db/mysql_schema.sql index b69129702a..2e1cd13eff 100644 --- a/phpBB/db/mysql_schema.sql +++ b/phpBB/db/mysql_schema.sql @@ -115,7 +115,8 @@ CREATE TABLE phpbb_config ( default_dateformat varchar(14) DEFAULT 'd M Y H:i' NOT NULL, system_timezone int(11) DEFAULT '0' NOT NULL, sys_template varchar(100) DEFAULT 'Default' NOT NULL, - prune_enable tinyint(1) DEFAULT '1' NOT NULL, + prune_enable tinyint(1) DEFAULT '1' NOT NULL, + gzip_compress tinyint(1) DEFAULT '0' NOT NULL, PRIMARY KEY (config_id), UNIQUE selected (selected) ); diff --git a/phpBB/db/postgres_schema.sql b/phpBB/db/postgres_schema.sql index b433a191da..00bc330057 100644 --- a/phpBB/db/postgres_schema.sql +++ b/phpBB/db/postgres_schema.sql @@ -112,7 +112,8 @@ CREATE TABLE phpbb_config ( avatar_path varchar(255) DEFAULT 'images/avatars' NOT NULL, override_themes int2 NOT NULL, flood_interval int NOT NULL, - prune_enable int2 DEFAULT '1' NOT NULL, + prune_enable int2 DEFAULT '1' NOT NULL, + gzip_compress int2 DEFAULT '0' NOT NULL, CONSTRAINT phpbb_config_pkey PRIMARY KEY (config_id) ); 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++) { |