aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-03-01 16:57:00 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2011-03-01 16:57:00 -0500
commit448df1cdf5d06e9457397ae439c04ad44084c2a9 (patch)
treee69a986e6910157ff8c1d1b51a267494e263c053 /phpBB/install/database_update.php
parent6c49f95b01c812144b16fdea74cc0841f354e810 (diff)
parent4ac8eaf9e3421f394136dc722542198b3048f4f8 (diff)
downloadforums-448df1cdf5d06e9457397ae439c04ad44084c2a9.tar
forums-448df1cdf5d06e9457397ae439c04ad44084c2a9.tar.gz
forums-448df1cdf5d06e9457397ae439c04ad44084c2a9.tar.bz2
forums-448df1cdf5d06e9457397ae439c04ad44084c2a9.tar.xz
forums-448df1cdf5d06e9457397ae439c04ad44084c2a9.zip
Merge branch 'ticket/9549' into develop
* ticket/9549: [ticket/9549] Display users in their primary group instead of their first group [ticket/9549] Change default value of "sort legend by group name" to false. [ticket/9549] Fix displaying empty groups [ticket/9549] Fix language strings. [ticket/9549] Only add group to legend/teampage when the checkbox is checked. [ticket/9549] New method move() to move a group more than 1 up/down. [ticket/9549] Fix some minor issues with descriptions and coding-guidelines. [ticket/9549] Throw an error when the given field-name is invalid. [ticket/9549] Make the class non static and extend delete_group function. [ticket/9549] Add template changes for subsilver2. [ticket/9549] Enhance teampage and legend functionality [ticket/9549] Add the module and files for the ACP. [ticket/9549] Update database with the new config values and columns [ticket/9549] Enhance teampage functionality with a new class, group_positions. Conflicts: phpBB/install/database_update.php
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php65
1 files changed, 63 insertions, 2 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index fab79e6dc1..cf611ca951 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -930,8 +930,19 @@ function database_update_info()
),
),
- // No changes from 3.1.0-dev to 3.1.0-A1
- '3.1.0-dev' => array(),
+ // Changes from 3.1.0-dev to 3.1.0-A1
+ '3.1.0-dev' => array(
+ 'add_columns' => array(
+ GROUPS_TABLE => array(
+ 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'),
+ ),
+ ),
+ 'change_columns' => array(
+ GROUPS_TABLE => array(
+ 'group_legend' => array('UINT', 0),
+ ),
+ ),
+ ),
);
}
@@ -1902,6 +1913,56 @@ function change_database_data(&$no_updates, $version)
// Changes from 3.1.0-dev to 3.1.0-A1
case '3.1.0-dev':
set_config('use_system_cron', 0);
+
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_teampage = 1
+ WHERE group_type = ' . GROUP_SPECIAL . "
+ AND group_name = 'ADMINISTRATORS'";
+ _sql($sql, $errored, $error_ary);
+
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_teampage = 2
+ WHERE group_type = ' . GROUP_SPECIAL . "
+ AND group_name = 'GLOBAL_MODERATORS'";
+ _sql($sql, $errored, $error_ary);
+
+ set_config('legend_sort_groupname', '0');
+ set_config('teampage_multiple', '1');
+ set_config('teampage_forums', '1');
+
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . '
+ WHERE group_legend = 1
+ ORDER BY group_name ASC';
+ $result = $db->sql_query($sql);
+
+ $next_legend = 1;
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $sql = 'UPDATE ' . GROUPS_TABLE . '
+ SET group_legend = ' . $next_legend . '
+ WHERE group_id = ' . (int) $row['group_id'];
+ _sql($sql, $errored, $error_ary);
+
+ $next_legend++;
+ }
+ $db->sql_freeresult($result);
+ unset($next_legend);
+
+ // Install modules
+ $modules_to_install = array(
+ 'position' => array(
+ 'base' => 'groups',
+ 'class' => 'acp',
+ 'title' => 'ACP_GROUPS_POSITION',
+ 'auth' => 'acl_a_group',
+ 'cat' => 'ACP_GROUPS',
+ ),
+ );
+
+ _add_modules($modules_to_install);
+
+ $no_updates = false;
break;
}
}