aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-04-08 21:45:51 +0200
committerIgor Wiedler <igor@wiedler.ch>2012-04-08 21:45:51 +0200
commita1132fc5c7e990d73cbc8ac7abf4502a1bbe7216 (patch)
tree1a095e1fe8155adfc572d411cbe74639274c3d6f /phpBB/install/database_update.php
parent3b71e81cfba726043063b05cb793e18186143252 (diff)
downloadforums-a1132fc5c7e990d73cbc8ac7abf4502a1bbe7216.tar
forums-a1132fc5c7e990d73cbc8ac7abf4502a1bbe7216.tar.gz
forums-a1132fc5c7e990d73cbc8ac7abf4502a1bbe7216.tar.bz2
forums-a1132fc5c7e990d73cbc8ac7abf4502a1bbe7216.tar.xz
forums-a1132fc5c7e990d73cbc8ac7abf4502a1bbe7216.zip
[feature/avatars] Update avatars in database_update
PHPBB3-10018
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php24
1 files changed, 22 insertions, 2 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index e85fe1810d..75f1ada749 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2391,13 +2391,33 @@ function change_database_data(&$no_updates, $version)
{
set_config('teampage_memberships', '1');
}
-
+
// Clear styles table and add prosilver entry
_sql('DELETE FROM ' . STYLES_TABLE, $errored, $error_ary);
$sql = 'INSERT INTO ' . STYLES_TABLE . " (style_name, style_copyright, style_active, style_path, bbcode_bitfield, style_parent_id, style_parent_tree) VALUES ('prosilver', '&copy; phpBB Group', 1, 'prosilver', 'kNg=', 0, '')";
_sql($sql, $errored, $error_ary);
-
+
+ // Update avatars to modular types
+ $avatar_type_map = array(
+ AVATAR_UPLOAD => 'upload',
+ AVATAR_GALLERY => 'local',
+ AVATAR_REMOTE => 'remote',
+ );
+
+ foreach ($avatar_type_map as $old => $new)
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_avatar_type = '" . $db->sql_escape($new) . "'
+ WHERE user_avatar_type = '" . $db->sql_escape($old) . "'";
+ _sql($sql, $errored, $error_ary);
+
+ $sql = 'UPDATE ' . GROUPS_TABLE . "
+ SET group_avatar_type = '" . $db->sql_escape($new) . "'
+ WHERE group_avatar_type = '" . $db->sql_escape($old) . "'";
+ _sql($sql, $errored, $error_ary);
+ }
+
$no_updates = false;
break;