aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
authorHari Sankar R <hsr@theinglorio.us>2012-04-07 19:42:42 +0530
committerHari Sankar R <hsr@theinglorio.us>2012-04-07 19:42:42 +0530
commit1808a61fe3e89399aec4ecced36e270faa7d0beb (patch)
tree494b25c81fa3868f6bbfedd9844b8ead79e5f3ec /phpBB/install/database_update.php
parentea5ae09c7d899bd0daa2b8b18371d6c4fbba4c5e (diff)
downloadforums-1808a61fe3e89399aec4ecced36e270faa7d0beb.tar
forums-1808a61fe3e89399aec4ecced36e270faa7d0beb.tar.gz
forums-1808a61fe3e89399aec4ecced36e270faa7d0beb.tar.bz2
forums-1808a61fe3e89399aec4ecced36e270faa7d0beb.tar.xz
forums-1808a61fe3e89399aec4ecced36e270faa7d0beb.zip
[ticket/10561] Added to database_update:database_update_info()
Updates made to database_update.php PHPBB3-10561
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php45
1 files changed, 27 insertions, 18 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 91016273e6..096d90219b 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -993,6 +993,8 @@ function database_update_info()
'3.0.10-RC2' => array(),
// No changes from 3.0.10-RC3 to 3.0.10
'3.0.10-RC3' => array(),
+ // No changes from 3.0.10 to 3.0.11-RC1
+ '3.0.10' => array(),
/** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.11-RC1 */
);
@@ -1871,24 +1873,6 @@ function change_database_data(&$no_updates, $version)
}
// end Bing Bot addition
- // Updates users having current style a deactivated one
- $sql = 'SELECT style_id
- FROM ' . STYLES_TABLE . '
- WHERE style_active = 0';
- $result = $db->sql_query($sql);
-
- while($temp = $db->sql_fetchfield('style_id', false, $result))
- {
- $styles[] = $temp;
- }
-
- $db->sql_freeresult($result);
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET user_style = ' . $config['default_style'] .'
- WHERE ' . $db->sql_in_set('user_style', $styles);
- $result = $db->sql_query($sql);
- $db->sql_freeresult($result);
-
// Delete shadow topics pointing to not existing topics
$batch_size = 500;
@@ -2042,6 +2026,31 @@ function change_database_data(&$no_updates, $version)
// No changes from 3.0.10-RC3 to 3.0.10
case '3.0.10-RC3':
break;
+
+ // Changes from 3.0.10 to 3.0.11-RC1
+ case '3.0.10':
+ // Updates users having current style a deactivated one
+ $deactivated_style_ids = array();
+ $sql = 'SELECT style_id
+ FROM ' . STYLES_TABLE . '
+ WHERE style_active = 0';
+ $result = $db->sql_query($sql);
+
+ while ($temp_style_id = $db->sql_fetchfield('style_id', false, $result))
+ {
+ $deactivated_style_ids[] = (int) $temp_style_id;
+ }
+
+ $db->sql_freeresult($result);
+ if (!empty($deactivated_style_ids))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_style = ' . $config['default_style'] .'
+ WHERE ' . $db->sql_in_set('user_style', $deactivated_style_ids);
+ $result = $db->sql_query($sql);
+ }
+ $no_updates = false;
+ break;
}
}