diff options
author | Hari Sankar R <hsr@theinglorio.us> | 2012-04-06 14:09:56 +0530 |
---|---|---|
committer | Hari Sankar R <hsr@theinglorio.us> | 2012-04-06 14:09:56 +0530 |
commit | ea5ae09c7d899bd0daa2b8b18371d6c4fbba4c5e (patch) | |
tree | 24510f5bce250fee3f3f53b4654cbaca2c851caf /phpBB/install/database_update.php | |
parent | 018419b36cf4d81cf2fa3f82d85f9bc8580c9c19 (diff) | |
download | forums-ea5ae09c7d899bd0daa2b8b18371d6c4fbba4c5e.tar forums-ea5ae09c7d899bd0daa2b8b18371d6c4fbba4c5e.tar.gz forums-ea5ae09c7d899bd0daa2b8b18371d6c4fbba4c5e.tar.bz2 forums-ea5ae09c7d899bd0daa2b8b18371d6c4fbba4c5e.tar.xz forums-ea5ae09c7d899bd0daa2b8b18371d6c4fbba4c5e.zip |
[ticket/10561] Added section in database_update.php
Added section to check for existing users using a
deactivated style, and revert it to default style.
PHPBB3-10561
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r-- | phpBB/install/database_update.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a1b7dcd47f..91016273e6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1871,6 +1871,24 @@ 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; |