diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2009-06-23 10:48:53 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-06-23 10:48:53 +0000 |
commit | c32f49679f635175d43de7264ee09782c56c628e (patch) | |
tree | be5368798e1bf839e42b6c28ffa5d126dd5fbc96 /phpBB/install | |
parent | 926640fc750ad2d90d4c86b234350dbdd0cc938c (diff) | |
download | forums-c32f49679f635175d43de7264ee09782c56c628e.tar forums-c32f49679f635175d43de7264ee09782c56c628e.tar.gz forums-c32f49679f635175d43de7264ee09782c56c628e.tar.bz2 forums-c32f49679f635175d43de7264ee09782c56c628e.tar.xz forums-c32f49679f635175d43de7264ee09782c56c628e.zip |
- add options for quick reply (forum-based and board-wide)
- add option for minimum post chars (which is a required setting for quick reply, therefore we introduce it here)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9656 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
-rw-r--r-- | phpBB/install/convertors/convert_phpbb20.php | 2 | ||||
-rw-r--r-- | phpBB/install/database_update.php | 38 | ||||
-rw-r--r-- | phpBB/install/install_convert.php | 4 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 2 |
4 files changed, 37 insertions, 9 deletions
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 805c67b92d..f4fc466ac7 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -611,6 +611,7 @@ if (!$get_info) 'query_first' => array('target', $convert->truncate_statement . POSTS_TABLE), 'execute_first' => ' $config["max_post_chars"] = 0; + $config["min_post_chars"] = 0; $config["max_quote_depth"] = 0; ', @@ -660,6 +661,7 @@ if (!$get_info) 'execute_first' => ' $config["max_post_chars"] = 0; + $config["min_post_chars"] = 0; $config["max_quote_depth"] = 0; ', diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 44bcf2a112..c3f8b40de6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1200,9 +1200,19 @@ function change_database_data(&$no_updates, $version) } } - // Set every members user_new column to 0 (old users) - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new = 0'; - _sql($sql, $errored, $error_ary); + // Set every members user_new column to 0 (old users) only if there is no one yet (this makes sure we do not execute this more than once) + $sql = 'SELECT 1 + FROM ' . USERS_TABLE . ' + WHERE user_new = 0'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$row) + { + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new = 0'; + _sql($sql, $errored, $error_ary); + } // Newly registered users limit if (!isset($config['new_member_post_limit'])) @@ -1246,13 +1256,27 @@ function change_database_data(&$no_updates, $version) $auth_admin = new auth_admin(); $auth_admin->acl_clear_prefetch(); - if ($config['allow_avatar_upload'] || $config['allow_avatar_local'] || $config['allow_avatar_remote']) + if (!isset($config['allow_avatar'])) + { + if ($config['allow_avatar_upload'] || $config['allow_avatar_local'] || $config['allow_avatar_remote']) + { + set_config('allow_avatar', '1'); + } + else + { + set_config('allow_avatar', '0'); + } + } + + // Minimum number of characters + if (!isset($config['min_post_chars'])) { - set_config('allow_avatar', '1'); + set_config('min_post_chars', '1'); } - else + + if (!isset($config['allow_quick_reply'])) { - set_config('allow_avatar', '0'); + set_config('allow_quick_reply', '1'); } $no_updates = false; diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 7a4155e09d..38bfe96fcd 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -611,7 +611,7 @@ class install_convert extends module $config['max_quote_depth'] = 0; // @todo Need to confirm that max post length in source is <= max post length in destination or there may be interesting formatting issues - $config['max_post_chars'] = 0; + $config['max_post_chars'] = $config['min_post_chars'] = 0; // Set up a user as well. We _should_ have enough of a database here at this point to do this // and it helps for any core code we call @@ -989,7 +989,7 @@ class install_convert extends module $config['max_quote_depth'] = 0; // @todo Need to confirm that max post length in source is <= max post length in destination or there may be interesting formatting issues - $config['max_post_chars'] = 0; + $config['max_post_chars'] = $config['min_post_chars'] = 0; } $template->assign_block_vars('checks', array( diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 100809ec24..86432a3084 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -25,6 +25,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_pm_attach', INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_flash', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_links', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_privmsg', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_quick_reply', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_bbcode', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_flash', '0'); @@ -191,6 +192,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_smilies', INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_urls', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_name_chars', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_pass_chars', '6'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_post_chars', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_author_chars', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('new_member_post_limit', '3'); |