From ea5ae09c7d899bd0daa2b8b18371d6c4fbba4c5e Mon Sep 17 00:00:00 2001 From: Hari Sankar R <hsr@theinglorio.us> Date: Fri, 6 Apr 2012 14:09:56 +0530 Subject: [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 --- phpBB/install/database_update.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'phpBB/install/database_update.php') 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; -- cgit v1.2.1