diff options
| author | Henry Sudhof <kellanved@phpbb.com> | 2007-05-23 15:05:46 +0000 |
|---|---|---|
| committer | Henry Sudhof <kellanved@phpbb.com> | 2007-05-23 15:05:46 +0000 |
| commit | 7cffec58d0db3cbed6f6e55785d3accd89efe8aa (patch) | |
| tree | 55bca06e1c8e13b7f57c5fa370bbfd1ca134df8a /phpBB/install/database_update.php | |
| parent | f34547cad7cab847c8ac6aa327573e7cf0b2005d (diff) | |
| download | forums-7cffec58d0db3cbed6f6e55785d3accd89efe8aa.tar forums-7cffec58d0db3cbed6f6e55785d3accd89efe8aa.tar.gz forums-7cffec58d0db3cbed6f6e55785d3accd89efe8aa.tar.bz2 forums-7cffec58d0db3cbed6f6e55785d3accd89efe8aa.tar.xz forums-7cffec58d0db3cbed6f6e55785d3accd89efe8aa.zip | |
This probably broke things :|
#10697
#11421
#11555
#11421
git-svn-id: file:///svn/phpbb/trunk@7666 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install/database_update.php')
| -rw-r--r-- | phpBB/install/database_update.php | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 194bb5600a..9996d0ce96 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.RC1'; +$updates_to_version = '3.0.RC2'; if (defined('IN_PHPBB') && defined('IN_INSTALL')) { @@ -1151,6 +1151,38 @@ if (version_compare($current_version, '3.0.b5', '<=')) $no_updates = false; } +if (version_compare($current_version, '3.0.RC1', '<=')) +{ + // we have to remove a few extra entries from converted boards. + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $db->sql_escape('BOTS') . "'"; + $result = $db->sql_query($sql); + $bot_group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + + $bots = array(); + $sql = 'SELECT u.user_id + FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug + WHERE ug.group_id = ' . $bot_group_id . ' + AND ug.user_id = u.user_id'; + $result = $db->sql_query($sql); + + + while ($row = $db->sql_fetchrow($result)) + { + $bots[] = (int)$row['user_id']; + } + $db->sql_freeresult($result); + + if (sizeof($bots)) + { + $sql = 'DELETE FROM ' . USER_GROUP_TABLE . " + WHERE group_id <> $bot_group_id + AND " . $db->sql_in_set('user_id', $bots); + $db->sql_query($sql); + } +} _write_result($no_updates, $errored, $error_ary); |
