diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2010-04-11 20:42:49 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2010-05-14 02:42:21 +0200 |
commit | 58dc5a191c0203ea6d98c37df26b0830b3bf8203 (patch) | |
tree | 0e918ec6c53b59db2062531af6d4c68fad955c12 /phpBB/install/database_update.php | |
parent | 03d50a2e83cc631779a7574acd4db8b77f29d547 (diff) | |
download | forums-58dc5a191c0203ea6d98c37df26b0830b3bf8203.tar forums-58dc5a191c0203ea6d98c37df26b0830b3bf8203.tar.gz forums-58dc5a191c0203ea6d98c37df26b0830b3bf8203.tar.bz2 forums-58dc5a191c0203ea6d98c37df26b0830b3bf8203.tar.xz forums-58dc5a191c0203ea6d98c37df26b0830b3bf8203.zip |
[ticket/7717] Localise default extension groups for attachments
PHPBB3-7717
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r-- | phpBB/install/database_update.php | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 7af0c86314..47d261dc46 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -913,6 +913,8 @@ function database_update_info() '3.0.7-RC2' => array(), // No changes from 3.0.7 to 3.0.7-PL1 '3.0.7' => array(), + // No changes from 3.0.7-PL1 to 3.0.8-RC1 + '3.0.7-PL1' => array(), ); } @@ -923,7 +925,7 @@ function database_update_info() *****************************************************************************/ function change_database_data(&$no_updates, $version) { - global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx; + global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx, $user; switch ($version) { @@ -1648,6 +1650,43 @@ function change_database_data(&$no_updates, $version) // No changes from 3.0.7 to 3.0.7-PL1 case '3.0.7': break; + + // Changes from 3.0.7-PL1 to 3.0.8-RC1 + case '3.0.7-PL1': + $user->add_lang('acp/attachments'); + $extension_groups = array( + $user->lang['EXT_GROUP_ARCHIVES'] => 'ARCHIVES', + $user->lang['EXT_GROUP_DOCUMENTS'] => 'DOCUMENTS', + $user->lang['EXT_GROUP_DOWNLOADABLE_FILES'] => 'DOWNLOADABLE_FILES', + $user->lang['EXT_GROUP_FLASH_FILES'] => 'FLASH_FILES', + $user->lang['EXT_GROUP_IMAGES'] => 'IMAGES', + $user->lang['EXT_GROUP_PLAIN_TEXT'] => 'PLAIN_TEXT', + $user->lang['EXT_GROUP_QUICKTIME_MEDIA'] => 'QUICKTIME_MEDIA', + $user->lang['EXT_GROUP_REAL_MEDIA'] => 'REAL_MEDIA', + $user->lang['EXT_GROUP_WINDOWS_MEDIA'] => 'WINDOWS_MEDIA', + ); + + $sql = 'SELECT group_id, group_name + FROM ' . EXTENSION_GROUPS_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (isset($extension_groups[$row['group_name']])) + { + $sql_ary = array( + 'group_name' => $extension_groups[$row['group_name']], + ); + $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE group_id = ' . (int) $row['group_id']; + _sql($sql, $errored, $error_ary); + } + } + $db->sql_freeresult($result); + + + $no_updates = false; + break; } } |