diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2011-02-09 21:05:10 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2011-02-16 18:21:48 +0100 |
commit | 4f2b0d9d42869d743a04e6e2b2541383ffeff16c (patch) | |
tree | d43022a28c8281d09adee2fa5afc1bd23ce6b5b7 /phpBB/includes/functions_user.php | |
parent | 023a10208216a78c32994a5d7997299cf3b5fdae (diff) | |
download | forums-4f2b0d9d42869d743a04e6e2b2541383ffeff16c.tar forums-4f2b0d9d42869d743a04e6e2b2541383ffeff16c.tar.gz forums-4f2b0d9d42869d743a04e6e2b2541383ffeff16c.tar.bz2 forums-4f2b0d9d42869d743a04e6e2b2541383ffeff16c.tar.xz forums-4f2b0d9d42869d743a04e6e2b2541383ffeff16c.zip |
[ticket/9549] Add the module and files for the ACP.
PHPBB3-9549
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 317578cd54..fba96f93e9 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2495,6 +2495,69 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow if (!sizeof($error)) { + + $current_legend = phpbb_group_positions::GROUP_DISABLED; + $current_teampage = phpbb_group_positions::GROUP_DISABLED; + if ($group_id) + { + $current_legend = phpbb_group_positions::get_group_value('legend', $group_id); + $current_teampage = phpbb_group_positions::get_group_value('teampage', $group_id); + } + + if (isset($group_attributes['group_legend'])) + { + if (($group_id && ($current_legend == phpbb_group_positions::GROUP_DISABLED)) || !$group_id) + { + // Old group currently not in the legend or new group, add at the end. + $group_attributes['group_legend'] = 1 + phpbb_group_positions::get_group_count('legend'); + } + else + { + // Group stayes in the legend + $group_attributes['group_legend'] = $current_legend; + } + } + else if ($group_id && ($current_legend > phpbb_group_positions::GROUP_DISABLED)) + { + // Group is removed from the legend + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_teampage = group_teampage - 1 + WHERE group_teampage > ' . $current_legend; + $db->sql_query($sql); + $group_attributes['group_legend'] = phpbb_group_positions::GROUP_DISABLED; + } + else + { + $group_attributes['group_legend'] = phpbb_group_positions::GROUP_DISABLED; + } + + if (isset($group_attributes['group_teampage'])) + { + if (($group_id && ($current_teampage == phpbb_group_positions::GROUP_DISABLED)) || !$group_id) + { + // Old group currently not on the teampage or new group, add at the end. + $group_attributes['group_teampage'] = 1 + phpbb_group_positions::get_group_count('teampage'); + } + else + { + // Group stayes on the teampage + $group_attributes['group_teampage'] = $current_teampage; + } + } + else if ($group_id && ($current_teampage > phpbb_group_positions::GROUP_DISABLED)) + { + // Group is removed from the teampage + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET group_teampage = group_teampage - 1 + WHERE group_teampage > ' . $current_teampage; + $db->sql_query($sql); + $group_attributes['group_teampage'] = phpbb_group_positions::GROUP_DISABLED; + } + else + { + $group_attributes['group_teampage'] = phpbb_group_positions::GROUP_DISABLED; + } + $user_ary = array(); $sql_ary = array( 'group_name' => (string) $name, @@ -2719,6 +2782,10 @@ function group_delete($group_id, $group_name = false) } while ($start); + // Delete group from legend and teampage + phpbb_group_positions::delete_group('legend', $group_id); + phpbb_group_positions::delete_group('teampage', $group_id); + // Delete group $sql = 'DELETE FROM ' . GROUPS_TABLE . " WHERE group_id = $group_id"; |