more fixes

git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3211 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-12-18 23:09:01 +00:00
parent 16547d41d7
commit ef0141b050
5 changed files with 57 additions and 44 deletions

View file

@ -147,6 +147,9 @@ p,ul,td {font-size:10pt;}
<li>Fixed missing template var {L_PM} for memberslist - <b>Daz</b></li>
<li>Fixed wrong key name for $images['Topic_un_watch'] - <b>Daz</b></li>
<li>Fixed missing template var {S_WATCH_TOPIC_IMG} for viewtopic - <b>Daz</b></li>
<li>Fixed missing default constraints for post table under MSSQL</li>
<li>Fixed incorrect field size for forum pruning - preventing days > 256</li>
<li>Fixed continuing redirect issues for broken web servers, e.g. IIS+CGI PHP</li>
<li></li>
<li></li>
</ul>

View file

@ -701,18 +701,15 @@ function redirect($url)
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) . '/' : '/';
$url = preg_replace('/^\/?(.*?\/)?$/', '\1', trim($url));
// If redirects don't work for you, first make sure you've entered your server (domain) name,
// script path, protocol (insecure (http://) or secure (https://) cookie) and port
// correctly in admin -> general -> configuration ... if they are fine, uncomment the following
// line and replace 'Location: ' . with $header_location . in the line following it.
// $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
// Redirect via an HTML form for PITA webservers
if (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')))
{
header('HTTP/1.0 302 Redirect');
header('Refresh: 0; URL=' . $server_protocol . $server_name . $script_name . $server_port . $url);
echo '<html><meta http-equiv="refresh" content="0; url=' . $server_protocol . $server_name . $script_name . $server_port . $url . '"></html>';
exit;
}
// Behave as per HTTP/1.1 spec for others
header('Location: ' . $server_protocol . $server_name . $script_name . $server_port . $url);
exit;
}

View file

@ -553,6 +553,14 @@ ALTER TABLE [phpbb_forums] WITH NOCHECK ADD
CONSTRAINT [DF_phpbb_forums_auth_attachments] DEFAULT (0) FOR [auth_attachments]
GO
ALTER TABLE [phpbb_posts] WITH NOCHECK ADD
CONSTRAINT [DF_phpbb_posts_enable_bbcode] DEFAULT (1) FOR [enable_bbcode]
CONSTRAINT [DF_phpbb_posts_enable_html] DEFAULT (0) FOR [enable_html]
CONSTRAINT [DF_phpbb_posts_enable_smilies] DEFAULT (1) FOR [enable_smilies]
CONSTRAINT [DF_phpbb_posts_enable_sig] DEFAULT (1) FOR [enable_sig]
CONSTRAINT [DF_phpbb_posts_post_edit_count] DEFAULT (0) FOR [post_edit_count]
GO
ALTER TABLE [phpbb_search_wordlist] WITH NOCHECK ADD
CONSTRAINT [DF_phpbb_search_wordlist_word_common] DEFAULT (0) FOR [word_common]
GO

View file

@ -109,8 +109,8 @@ CREATE TABLE phpbb_disallow (
CREATE TABLE phpbb_forum_prune (
prune_id mediumint(8) UNSIGNED NOT NULL auto_increment,
forum_id smallint(5) UNSIGNED NOT NULL,
prune_days tinyint(4) UNSIGNED NOT NULL,
prune_freq tinyint(4) UNSIGNED NOT NULL,
prune_days smallint(5) UNSIGNED NOT NULL,
prune_freq smallint(5) UNSIGNED NOT NULL,
PRIMARY KEY(prune_id),
KEY forum_id (forum_id)
);

View file

@ -456,57 +456,62 @@ switch ($row['config_value'])
case '.0.3':
// Add indexes to post_id in search match table (+ word_id for MS Access)
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
$sql[] = "ALTER TABLE " . SEARCH_MATCH_TABLE . " ADD INDEX post_id (post_id)";
break;
// Add indexes to post_id in search match table (+ word_id for MS Access)
$sql[] = "ALTER TABLE " . SEARCH_MATCH_TABLE . "
ADD INDEX post_id (post_id)";
case 'postgresql':
$sql[] = "CREATE INDEX post_id_" . SEARCH_MATCH_TABLE . " ON " . SEARCH_MATCH_TABLE . " (post_id)";
break;
case 'msaccess':
$sql[] = "CREATE INDEX " . SEARCH_MATCH_TABLE . " ON " . SEARCH_MATCH_TABLE . " ([post_id])";
$sql[] = "CREATE INDEX " . SEARCH_MATCH_TABLE . "_1 ON " . SEARCH_MATCH_TABLE . " ([word_id])";
break;
}
// Regenerate groups table with incremented group_id for pgsql
// ... missing in 2.0.3 ...
switch (SQL_LAYER)
{
case 'postgresql':
$sql[] = "CREATE SEQUENCE " . GROUPS_TABLE . "_id_seq start 3 increment 1 maxvalue 2147483647 minvalue 1 cache 1";
$sql[] = "CREATE TABLE tmp_" . GROUPS_TABLE . " AS SELECT group_id, group_name, group_type, group_description, group_moderator, group_single_user FROM " . GROUPS_TABLE;
$sql[] = "DROP TABLE " . GROUPS_TABLE;
$sql[] = "CREATE TABLE phpbb_groups (group_id int DEFAULT nextval('" . GROUPS_TABLE . "_id_seq'::text) NOT NULL, group_name varchar(40) NOT NULL, group_type int2 DEFAULT '1' NOT NULL, group_description varchar(255) NOT NULL, group_moderator int4 DEFAULT '0' NOT NULL, group_single_user int2 DEFAULT '0' NOT NULL, CONSTRAINT phpbb_groups_pkey PRIMARY KEY (group_id))";
$sql[] = "INSERT INTO " . GROUPS_TABLE . " (group_id, group_name, group_type, group_description, group_moderator, group_single_user) SELECT group_id, group_name, group_type, group_description, group_moderator, group_single_user FROM tmp_" . GROUPS_TABLE;
$sql[] = "DROP TABLE tmp_" . GROUPS_TABLE;
break;
}
// Modify user_timezone to decimal(5,2) for mysql ... mysql4/mssql/pgsql/msaccess
// should be completely unaffected
// Change default user_notify to 0
switch (SQL_LAYER)
{
case 'mysql':
// Modify user_timezone to decimal(5,2) for mysql ... mysql4/mssql/pgsql/msaccess
// should be completely unaffected
// Change default user_notify to 0
$sql[] = "ALTER TABLE " . USERS_TABLE . "
MODIFY COLUMN user_timezone decimal(5,2) DEFAULT '0' NOT NULL,
MODIFY COLUMN user_notify tinyint(1) DEFAULT '0' NOT NULL";
// Adjust field type for prune_days, prune_freq ... was too small
$sql[] = "ALTER TABLE " . PRUNE_TABLE . "
MODIFY COLUMN prune_days smallint(5) UNSIGNED NOT NULL,
MODIFY COLUMN prune_freq smallint(5) UNSIGNED NOT NULL";
break;
case 'mssql':
case 'mssql-odbc':
break;
// Add missing defaults to MSSQL post table schema
$sql[] = "ALTER TABLE [" . POSTS_TABLE . "] WITH NOCHECK ADD
CONSTRAINT [DF_" . POSTS_TABLE . "_enable_bbcode] DEFAULT (1) FOR [enable_bbcode]
CONSTRAINT [DF_" . POSTS_TABLE . "_enable_html] DEFAULT (0) FOR [enable_html]
CONSTRAINT [DF_" . POSTS_TABLE . "_enable_smilies] DEFAULT (1) FOR [enable_smilies]
CONSTRAINT [DF_" . POSTS_TABLE . "_enable_sig] DEFAULT (1) FOR [enable_sig]
CONSTRAINT [DF_" . POSTS_TABLE . "_post_edit_count] DEFAULT (0) FOR [post_edit_count]";
case 'msaccess':
// Add indexes to post_id in search match table (+ word_id for MS Access)
$sql[] = "CREATE INDEX " . SEARCH_MATCH_TABLE . "
ON " . SEARCH_MATCH_TABLE . " ([post_id])";
$sql[] = "CREATE INDEX " . SEARCH_MATCH_TABLE . "_1
ON " . SEARCH_MATCH_TABLE . " ([word_id])";
break;
case 'postgresql':
// Add indexes to post_id in search match table (+ word_id for MS Access)
$sql[] = "CREATE INDEX post_id_" . SEARCH_MATCH_TABLE . "
ON " . SEARCH_MATCH_TABLE . " (post_id)";
// Regenerate groups table with incremented group_id for pgsql
// ... missing in 2.0.3 ...
$sql[] = "CREATE SEQUENCE " . GROUPS_TABLE . "_id_seq start 3 increment 1 maxvalue 2147483647 minvalue 1 cache 1";
$sql[] = "CREATE TABLE tmp_" . GROUPS_TABLE . "
AS SELECT group_id, group_name, group_type, group_description, group_moderator, group_single_user
FROM " . GROUPS_TABLE;
$sql[] = "DROP TABLE " . GROUPS_TABLE;
$sql[] = "CREATE TABLE phpbb_groups (group_id int DEFAULT nextval('" . GROUPS_TABLE . "_id_seq'::text) NOT NULL, group_name varchar(40) NOT NULL, group_type int2 DEFAULT '1' NOT NULL, group_description varchar(255) NOT NULL, group_moderator int4 DEFAULT '0' NOT NULL, group_single_user int2 DEFAULT '0' NOT NULL, CONSTRAINT phpbb_groups_pkey PRIMARY KEY (group_id))";
$sql[] = "INSERT INTO " . GROUPS_TABLE . " (group_id, group_name, group_type, group_description, group_moderator, group_single_user)
SELECT group_id, group_name, group_type, group_description, group_moderator, group_single_user
FROM tmp_" . GROUPS_TABLE;
$sql[] = "DROP TABLE tmp_" . GROUPS_TABLE;
break;
}
}