aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/convertors/functions_phpbb20.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-10-25 12:09:09 +0200
committerJoas Schilling <nickvergessen@gmx.de>2013-10-25 12:09:09 +0200
commite9f4be9052c3f3874a79c1b68934fc6b256491f1 (patch)
tree5bb3bdc415b52ab9fed97bcab9b7cf8260da8fb7 /phpBB/install/convertors/functions_phpbb20.php
parent881ad935d55dd69876f9c5aee1a9d100242fbbaa (diff)
downloadforums-e9f4be9052c3f3874a79c1b68934fc6b256491f1.tar
forums-e9f4be9052c3f3874a79c1b68934fc6b256491f1.tar.gz
forums-e9f4be9052c3f3874a79c1b68934fc6b256491f1.tar.bz2
forums-e9f4be9052c3f3874a79c1b68934fc6b256491f1.tar.xz
forums-e9f4be9052c3f3874a79c1b68934fc6b256491f1.zip
[ticket/11031] Update extension group names after converting them
PHPBB3-11031
Diffstat (limited to 'phpBB/install/convertors/functions_phpbb20.php')
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index 136ca991ae..4cb9237daf 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -1415,6 +1415,54 @@ function phpbb_attachment_category($cat_id)
}
/**
+* Convert the attachment extension names
+* This is only used if the Attachment MOD was installed
+*/
+function phpbb_attachment_extension_group_name()
+{
+ global $db, $phpbb_root_path, $phpEx;
+
+ // Update file extension group names to use language strings.
+ $sql = 'SELECT lang_dir
+ FROM ' . LANG_TABLE;
+ $result = $db->sql_query($sql);
+
+ $extension_groups_updated = array();
+ while ($lang_dir = $db->sql_fetchfield('lang_dir'))
+ {
+ $lang_dir = basename($lang_dir);
+
+ if (!file_exists($phpbb_root_path . 'language/' . $lang_dir . '/acp/attachments.' . $phpEx))
+ {
+ continue;
+ }
+
+ $lang = array();
+ include($lang_file);
+
+ foreach ($lang as $lang_key => $lang_val)
+ {
+ if (isset($extension_groups_updated[$lang_key]) || strpos($lang_key, 'EXT_GROUP_') !== 0)
+ {
+ continue;
+ }
+
+ $sql_ary = array(
+ 'group_name' => substr($lang_key, 10), // Strip off 'EXT_GROUP_'
+ );
+
+ $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
+ WHERE group_name = '" . $db->sql_escape($lang_val) . "'";
+ $db->sql_query($sql);
+
+ $extension_groups_updated[$lang_key] = true;
+ }
+ }
+ $db->sql_freeresult($result);
+}
+
+/**
* Obtain list of forums in which different attachment categories can be used
*/
function phpbb_attachment_forum_perms($forum_permissions)