mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-25 19:38:53 +00:00
[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
This commit is contained in:
parent
018419b36c
commit
ea5ae09c7d
1 changed files with 18 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue