From 8f55adbedbc6a4ea151baa4267ac61d60d85ac5a Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Sat, 3 Jun 2006 13:57:53 +0000 Subject: [PATCH] Watch me juggle with the tree! git-svn-id: file:///svn/phpbb/trunk@6003 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_install.php | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 233bfb391e..ea1a54c3f1 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1262,6 +1262,41 @@ class install_install extends module } } + // This is a one off move of a single ACP module since the sort algorithm puts it in the wrong place + // Manage Users should ideally be the first thing you see on the Users & groups tab + if ($module_class == 'acp') + { + $sql = 'SELECT module_id, left_id, right_id FROM ' . MODULES_TABLE . " + WHERE module_langname = 'ACP_CAT_USERS' + AND module_class = 'acp' + LIMIT 1"; + $result = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $sql = 'UPDATE ' . MODULES_TABLE . " + SET left_id = left_id + 3, right_id = right_id + 3 + WHERE module_class = 'acp' + AND left_id > {$row2['left_id']} + AND left_id < {$row2['right_id']}"; + $db->sql_query($sql); + + $sql = 'SELECT * FROM ' . MODULES_TABLE . " + WHERE module_langname = 'ACP_MANAGE_USERS' + AND module_class = 'acp' + LIMIT 1"; + $result = $db->sql_query($sql); + $module_data = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $module_data['left_id'] = $row2['left_id'] + 1; + $module_data['right_id'] = $row2['left_id'] + 2; + + $sql = 'UPDATE ' . MODULES_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $module_data) . " + WHERE module_id = {$module_data['module_id']}"; + $db->sql_query($sql); + } + // And now for the special ones // (these are modules which appear in multiple categories and thus get added manually to some for more control) if (isset($this->module_extras[$module_class]))