1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 08:17:47 +02:00

Merge branch 'develop' into feature/extension-manager

* develop: (93 commits)
  [ticket/10157] Add notification to update cpfs when installing a language.
  [ticket/10185] Always set board startdate on conversion
  [ticket/10419] Reword the language strings
  [ticket/9361] View correct error messages when editing account information
  [ticket/10457] Undefined variable $request, when print-viewing PMs
  [ticket/10452] Fix xHTML errors when print-viewing PMs
  [ticket/9066] Move regex into get_preg_expression function and add tests
  [ticket/10254] Add "phpBB Group" to "Modified by" in prosilver stylesheet.css
  [ticket/10254] Removing the subsilver2 NOTE, incompatible with phpBB.com.
  [ticket/10254] Removing the NOTE as it is incompatible with phpBB.com.
  [ticket/10254] Remove subsilver2 as default style on theme.
  [ticket/10254] Remove style names from themes and fix some informations on it.
  [ticket/7138] Allow simple header and footer for trigger_error() messages
  [ticket/9066] Disallow some database prefix to prevent same errors and problems
  [ticket/10365] Fix up S_POST_UNAPPROVED check, make it easier to read
  [ticket/10437] Do not display announcements that are waiting for approval
  [ticket/10087] Organize bans in acp_baninto optgroups
  [ticket/8616] Include old U_INBOX var for BC
  [ticket/10435] Remove global announcement from forums total topic count
  [ticket/10435] Readd local announcements to total topic count in viewforum
  ...

Conflicts:
	phpBB/install/database_update.php
This commit is contained in:
Nils Adermann
2011-11-18 19:14:06 +01:00
98 changed files with 1182 additions and 711 deletions

View File

@@ -2113,6 +2113,11 @@ function change_database_data(&$no_updates, $version)
case '3.0.9-RC4':
break;
// Changes from 3.0.9 to 3.0.10-RC1
case '3.0.9':
set_config('email_max_chunk_size', '50');
break;
// Changes from 3.1.0-dev to 3.1.0-A1
case '3.1.0-dev':
@@ -2146,46 +2151,80 @@ function change_database_data(&$no_updates, $version)
$db->sql_freeresult($result);
// try to guess the new auto loaded search class name
// works for native and mysql fulltext
set_config('search_type', 'phpbb_search_' . $config['search_type']);
if (substr($config['search_type'], 0, 6) !== 'phpbb_')
{
// try to guess the new auto loaded search class name
// works for native and mysql fulltext
set_config('search_type', 'phpbb_search_' . $config['search_type']);
}
set_config('use_system_cron', 0);
if (!isset($config['load_jquery_cdn']))
{
set_config('load_jquery_cdn', 0);
set_config('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');
}
$sql = 'UPDATE ' . GROUPS_TABLE . '
SET group_teampage = 1
WHERE group_type = ' . GROUP_SPECIAL . "
AND group_name = 'ADMINISTRATORS'";
_sql($sql, $errored, $error_ary);
if (!isset($config['use_system_cron']))
{
set_config('use_system_cron', 0);
}
$sql = 'UPDATE ' . GROUPS_TABLE . '
SET group_teampage = 2
WHERE group_type = ' . GROUP_SPECIAL . "
AND group_name = 'GLOBAL_MODERATORS'";
_sql($sql, $errored, $error_ary);
set_config('legend_sort_groupname', '0');
set_config('teampage_multiple', '1');
set_config('teampage_forums', '1');
$sql = 'SELECT group_id
$sql = 'SELECT group_teampage
FROM ' . GROUPS_TABLE . '
WHERE group_legend = 1
ORDER BY group_name ASC';
$result = $db->sql_query($sql);
WHERE group_teampage > 0';
$result = $db->sql_query_limit($sql, 1);
$added_groups_teampage = (bool) $db->sql_fetchfield('group_teampage');
$db->sql_freeresult($result);
$next_legend = 1;
while ($row = $db->sql_fetchrow($result))
if (!$added_groups_teampage)
{
$sql = 'UPDATE ' . GROUPS_TABLE . '
SET group_legend = ' . $next_legend . '
WHERE group_id = ' . (int) $row['group_id'];
SET group_teampage = 1
WHERE group_type = ' . GROUP_SPECIAL . "
AND group_name = 'ADMINISTRATORS'";
_sql($sql, $errored, $error_ary);
$next_legend++;
$sql = 'UPDATE ' . GROUPS_TABLE . '
SET group_teampage = 2
WHERE group_type = ' . GROUP_SPECIAL . "
AND group_name = 'GLOBAL_MODERATORS'";
_sql($sql, $errored, $error_ary);
}
if (!isset($config['legend_sort_groupname']))
{
set_config('legend_sort_groupname', '0');
set_config('teampage_forums', '1');
}
$sql = 'SELECT group_legend
FROM ' . GROUPS_TABLE . '
WHERE group_teampage > 1';
$result = $db->sql_query_limit($sql, 1);
$updated_group_legend = (bool) $db->sql_fetchfield('group_teampage');
$db->sql_freeresult($result);
unset($next_legend);
if (!$updated_group_legend)
{
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . '
WHERE group_legend = 1
ORDER BY group_name ASC';
$result = $db->sql_query($sql);
$next_legend = 1;
while ($row = $db->sql_fetchrow($result))
{
$sql = 'UPDATE ' . GROUPS_TABLE . '
SET group_legend = ' . $next_legend . '
WHERE group_id = ' . (int) $row['group_id'];
_sql($sql, $errored, $error_ary);
$next_legend++;
}
$db->sql_freeresult($result);
unset($next_legend);
}
// Install modules
$modules_to_install = array(
@@ -2206,7 +2245,7 @@ function change_database_data(&$no_updates, $version)
);
_add_modules($modules_to_install);
$sql = 'DELETE FROM ' . MODULES_TABLE . "
WHERE module_basename = 'styles' AND module_mode = 'imageset'";
_sql($sql, $errored, $error_ary);
@@ -2289,7 +2328,15 @@ function change_database_data(&$no_updates, $version)
}
// Allow custom profile fields in pm templates
set_config('load_cpf_pm', '0');
if (!isset($config['load_cpf_pm']))
{
set_config('load_cpf_pm', '0');
}
if (!isset($config['teampage_memberships']))
{
set_config('teampage_memberships', '1');
}
$no_updates = false;
break;

View File

@@ -1697,19 +1697,16 @@ class install_convert extends module
fix_empty_primary_groups();
if (!isset($config['board_startdate']))
{
$sql = 'SELECT MIN(user_regdate) AS board_startdate
FROM ' . USERS_TABLE;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$sql = 'SELECT MIN(user_regdate) AS board_startdate
FROM ' . USERS_TABLE;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (($row['board_startdate'] < $config['board_startdate'] && $row['board_startdate'] > 0) || !isset($config['board_startdate']))
{
set_config('board_startdate', $row['board_startdate']);
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_regdate = ' . $row['board_startdate'] . ' WHERE user_id = ' . ANONYMOUS);
}
if (!isset($config['board_startdate']) || ($row['board_startdate'] < $config['board_startdate'] && $row['board_startdate'] > 0))
{
set_config('board_startdate', $row['board_startdate']);
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_regdate = ' . $row['board_startdate'] . ' WHERE user_id = ' . ANONYMOUS);
}
update_dynamic_config();

View File

@@ -546,6 +546,11 @@ class install_install extends module
$error[] = $lang['INST_ERR_NO_DB'];
$connect_test = false;
}
else if (!preg_match(get_preg_expression('table_prefix'), $data['table_prefix']))
{
$error[] = $lang['INST_ERR_DB_INVALID_PREFIX'];
$connect_test = false;
}
else
{
$connect_test = connect_check_db(true, $error, $available_dbms[$data['dbms']], $data['table_prefix'], $data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport']);
@@ -876,33 +881,8 @@ class install_install extends module
@chmod($phpbb_root_path . 'cache/install_lock', 0777);
$load_extensions = implode(',', $load_extensions);
// Time to convert the data provided into a config file
$config_data = "<?php\n";
$config_data .= "// phpBB 3.0.x auto-generated configuration file\n// Do not change anything in this file!\n";
$config_data_array = array(
'dbms' => $available_dbms[$data['dbms']]['DRIVER'],
'dbhost' => $data['dbhost'],
'dbport' => $data['dbport'],
'dbname' => $data['dbname'],
'dbuser' => $data['dbuser'],
'dbpasswd' => htmlspecialchars_decode($data['dbpasswd']),
'table_prefix' => $data['table_prefix'],
'acm_type' => 'file',
'load_extensions' => $load_extensions,
);
foreach ($config_data_array as $key => $value)
{
$config_data .= "\${$key} = '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $value)) . "';\n";
}
unset($config_data_array);
$config_data .= "\n@define('PHPBB_INSTALLED', true);\n";
$config_data .= "// @define('DEBUG', true);\n";
$config_data .= "// @define('DEBUG_EXTRA', true);\n";
$config_data = phpbb_create_config_file_data($data, $available_dbms[$data['dbms']]['DRIVER'], $load_extensions);
// Attempt to write out the config file directly. If it works, this is the easiest way to do it ...
if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) || phpbb_is_writable($phpbb_root_path))
@@ -1947,7 +1927,7 @@ class install_install extends module
'dbname' => array('lang' => 'DB_NAME', 'type' => 'text:25:100', 'explain' => false),
'dbuser' => array('lang' => 'DB_USERNAME', 'type' => 'text:25:100', 'explain' => false),
'dbpasswd' => array('lang' => 'DB_PASSWORD', 'type' => 'password:25:100', 'explain' => false),
'table_prefix' => array('lang' => 'TABLE_PREFIX', 'type' => 'text:25:100', 'explain' => false),
'table_prefix' => array('lang' => 'TABLE_PREFIX', 'type' => 'text:25:100', 'explain' => true),
);
var $admin_config_options = array(
'legend1' => 'ADMIN_CONFIG',

View File

@@ -1,7 +1,8 @@
# DO NOT EDIT THIS FILE, IT IS GENERATED
#
# $Id: $
#
# To change the contents of this file, edit
# phpBB/develop/create_schema_files.php and
# run it.
# Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments (

View File

@@ -1,8 +1,10 @@
/*
$Id: $
*/
* DO NOT EDIT THIS FILE, IT IS GENERATED
*
* To change the contents of this file, edit
* phpBB/develop/create_schema_files.php and
* run it.
*/
/*
Table: 'phpbb_attachments'
@@ -1321,7 +1323,7 @@ CREATE TABLE [phpbb_styles] (
[style_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
[style_active] [int] DEFAULT (1) NOT NULL ,
[template_id] [int] DEFAULT (0) NOT NULL ,
[theme_id] [int] DEFAULT (0) NOT NULL
[theme_id] [int] DEFAULT (0) NOT NULL
) ON [PRIMARY]
GO

View File

@@ -1,7 +1,8 @@
# DO NOT EDIT THIS FILE, IT IS GENERATED
#
# $Id: $
#
# To change the contents of this file, edit
# phpBB/develop/create_schema_files.php and
# run it.
# Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments (
attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,

View File

@@ -1,7 +1,8 @@
# DO NOT EDIT THIS FILE, IT IS GENERATED
#
# $Id: $
#
# To change the contents of this file, edit
# phpBB/develop/create_schema_files.php and
# run it.
# Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments (
attach_id mediumint(8) UNSIGNED NOT NULL auto_increment,

View File

@@ -1,8 +1,10 @@
/*
$Id: $
*/
* DO NOT EDIT THIS FILE, IT IS GENERATED
*
* To change the contents of this file, edit
* phpBB/develop/create_schema_files.php and
* run it.
*/
/*
This first section is optional, however its probably the best method

View File

@@ -1,8 +1,10 @@
/*
$Id: $
*/
* DO NOT EDIT THIS FILE, IT IS GENERATED
*
* To change the contents of this file, edit
* phpBB/develop/create_schema_files.php and
* run it.
*/
BEGIN;

View File

@@ -94,6 +94,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0')
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_name', 'mail');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_max_chunk_size', '50');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '20');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1');
@@ -165,6 +166,8 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewprofi
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewtopic', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_lastread', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_track', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jquery_cdn', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jumpbox', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_moderators', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online', '1');
@@ -243,7 +246,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_multiple', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_memberships', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_forums', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0');

View File

@@ -1,7 +1,8 @@
# DO NOT EDIT THIS FILE, IT IS GENERATED
#
# $Id: $
#
# To change the contents of this file, edit
# phpBB/develop/create_schema_files.php and
# run it.
BEGIN TRANSACTION;
# Table: 'phpbb_attachments'