diff options
-rw-r--r-- | phpBB/admin/admin_groups.php | 276 | ||||
-rw-r--r-- | phpBB/language/en/lang_admin.php | 15 | ||||
-rw-r--r-- | phpBB/language/en/lang_main.php | 6 |
3 files changed, 252 insertions, 45 deletions
diff --git a/phpBB/admin/admin_groups.php b/phpBB/admin/admin_groups.php index 01c42955f4..0411c32959 100644 --- a/phpBB/admin/admin_groups.php +++ b/phpBB/admin/admin_groups.php @@ -45,8 +45,9 @@ if (!$auth->acl_get('a_group') ) // Check and set some common vars -$action = (isset($_REQUEST['action']))? $_REQUEST['action'] : ((isset($_POST['addgroup'])) ? 'addgroup' : ''); -$group_id = (isset($_REQUEST['g']))? intval($_REQUEST['g']) : ''; +$action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : ((isset($_POST['addgroup'])) ? 'addgroup' : ''); +$group_id = (isset($_REQUEST['g'])) ? intval($_REQUEST['g']) : ''; +$start = (isset($_GET['start'])) ? intval($_GET['start']) : 0; // Which page? page_header($user->lang['MANAGE']); @@ -70,6 +71,7 @@ switch ($action) { trigger_error($user->lang['NO_GROUP']); } + $db->sql_freeresult($result); } // Did we submit? @@ -214,6 +216,7 @@ switch ($action) } while ($row = $db->sql_fetchrow($result)); } + $db->sql_freeresult($result); $type_open = ($group_type == GROUP_OPEN) ? ' checked="checked"' : ''; $type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : ''; @@ -240,8 +243,8 @@ function swatch() </tr> <?php - if ($error != '') - { + if ($error != '') + { ?> <tr> @@ -249,25 +252,25 @@ function swatch() </tr> <?php - } + } ?> <tr> <td class="row2"><?php echo $user->lang['GROUP_NAME']; ?>:</td> <td class="row1"><?php - if ($group_type != GROUP_SPECIAL) - { + if ($group_type != GROUP_SPECIAL) + { ?><input type="text" name="group_name" value="<?php echo (!empty($group_name)) ? $group_name : ''; ?>" size="40" maxlength="40" /><?php - } - else - { + } + else + { ?><b><?php echo (!empty($user->lang['G_' . $group_name])) ? $user->lang['G_' . $group_name] : $group_name; ?></b><?php - } + } ?></td> </tr> @@ -277,8 +280,8 @@ function swatch() </tr> <?php - if ($group_type != GROUP_SPECIAL) - { + if ($group_type != GROUP_SPECIAL) + { ?> <tr> @@ -287,7 +290,7 @@ function swatch() </tr> <?php - } + } ?> <tr> @@ -310,6 +313,12 @@ function swatch() </tr> </table></form> +<?php + + if ($action != 'addgroup') + { + +?> <h1><?php echo $user->lang['GROUP_SETTINGS']; ?></h1> <p><?php echo $user->lang['GROUP_SETTINGS_EXPLAIN']; ?></p> @@ -333,12 +342,12 @@ function swatch() <tr> <td class="cat" colspan="2" align="center"><?php - if ($group_type == GROUP_SPECIAL) - { + if ($group_type == GROUP_SPECIAL) + { ?><input type="hidden" name="group_type" value="<?php echo GROUP_SPECIAL; ?>" /><?php - } + } ?><input class="mainoption" type="submit" name="submitprefs" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input class="liteoption" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td> </tr> @@ -346,30 +355,220 @@ function swatch() <?php + } + break; case 'add': break; case 'delete': + case 'deletegroup': break; case 'list': + $sql = "SELECT * + FROM " . GROUPS_TABLE . " + WHERE group_id = $group_id"; + $result = $db->sql_query($sql); + + if (!extract($db->sql_fetchrow($result))) + { + trigger_error($user->lang['NO_GROUP']); + } + $db->sql_freeresult($result); + ?> <h1><?php echo $user->lang['GROUP_MEMBERS']; ?></h1> +<p><?php echo $user->lang['GROUP_MEMBERS_EXPLAIN']; ?></p> + +<?php + + if ($group_type != GROUP_SPECIAL) + { + +?> +<h1><?php echo $user->lang['GROUP_MODS']; ?></h1> + +<p><?php echo $user->lang['GROUP_MODS_EXPLAIN']; ?></p> + +<form name="mods" method="post" action="admin_groups.<?php echo "$phpEx$SID&action=list"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center"> + <tr> + <th><?php echo $user->lang['USERNAME']; ?></th> + <th><?php echo $user->lang['JOINED']; ?></th> + <th><?php echo $user->lang['POSTS']; ?></th> + <th width="2%"><?php echo $user->lang['MARK']; ?></th> + </tr> +<?php + + // Group moderators + $sql = "SELECT u.user_id, u.username + FROM " . USERS_TABLE . " u, " . GROUPS_MODERATOR_TABLE . " gm + WHERE gm.group_id = $group_id + ORDER BY u.user_id"; + $result = $db->sql_query($sql); + + $db->sql_freeresult($result); + + if ($row = $db->sql_fetchrow($result) ) + { + do + { + + + } + while ($row = $db->sql_fetchrow($result) ); + +?> + +<?php + + } + else + { + +?> + <tr> + <td class="row3" colspan="4" align="center"><?php echo $user->lang['GROUPS_NO_MODS']; ?></td> + </tr> +<?php + + } + +?> + <tr> + <td class="cat" colspan="4" align="right"></td> + </tr> +</table></form> + +<?php + + // Pending users + $sql = "SELECT u.user_id, u.username + FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g + WHERE ug.user_pending = 1 + AND u.user_id = ug.user_id + ORDER BY ug.group_id, u.user_id"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result) ) + { + +?> +<h1><?php echo $user->lang['GROUP_PENDING']; ?></h1> + +<p><?php echo $user->lang['GROUP_PENDING_EXPLAIN']; ?></p> + +<form name="pending" method="post" action="admin_groups.<?php echo "$phpEx$SID&action=list"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center"> + <tr> + <th><?php echo $user->lang['USERNAME']; ?></th> + <th><?php echo $user->lang['JOINED']; ?></th> + <th><?php echo $user->lang['POSTS']; ?></th> + <th width="2%"><?php echo $user->lang['MARK']; ?></th> + </tr> +<?php + + do + { + +?> + <tr> + <td class="<?php echo $row_class; ?>"><a href="../ucp.<?php echo "$phpEx$SID&mode=viewprofile&u=" . $row['user_id']; ?>" target="_profile"><?php echo $row['username']; ?></a></td> + <td class="<?php echo $row_class; ?>" align="center"><?php echo $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']); ?></td> + <td class="<?php echo $row_class; ?>" align="center"><?php echo $row['user_posts']; ?></td> + <td class="<?php echo $row_class; ?>" align="center"><input type="checkbox" name="mark[<?php echo $row['user_id']; ?>]" /></td> + </tr> +<?php + + } + while ($row = $db->sql_fetchrow($result) ); + +?> +</table></form> + +<?php + + } + $db->sql_freeresult($result); + } + + $sql = "SELECT COUNT(user_id) AS total_members + FROM " . USER_GROUP_TABLE . " + WHERE group_id = $group_id"; + $result = $db->sql_query($sql); + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + $total_members = $row['total_members']; + + // Existing members + $sql = "SELECT u.user_id, u.username, u.user_regdate, u.user_posts + FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug + WHERE ug.group_id = $group_id + AND ug.user_pending = 0 + AND u.user_id = ug.user_id + ORDER BY u.username + LIMIT $start, " . $config['topics_per_page']; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result) ) + { + +?> +<h1><?php echo $user->lang['GROUP_LIST']; ?></h1> + <p><?php echo $user->lang['GROUP_LIST_EXPLAIN']; ?></p> -<form method="post" action="admin_groups.<?php echo "$phpEx$SID&action=list"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center"> +<?php + +?> +<form name="list" method="post" action="admin_groups.<?php echo "$phpEx$SID&action=list"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center"> <tr> - <th colspan="2"><?php echo $user->lang['']; ?></th> + <th><?php echo $user->lang['USERNAME']; ?></th> + <th><?php echo $user->lang['JOINED']; ?></th> + <th><?php echo $user->lang['POSTS']; ?></th> + <th width="2%"><?php echo $user->lang['MARK']; ?></th> + </tr> +<?php + + do + { + + $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; + +?> + <tr> + <td class="<?php echo $row_class; ?>"><a href="../ucp.<?php echo "$phpEx$SID&mode=viewprofile&u=" . $row['user_id']; ?>" target="_profile"><?php echo $row['username']; ?></a></td> + <td class="<?php echo $row_class; ?>" align="center"><?php echo $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']); ?></td> + <td class="<?php echo $row_class; ?>" align="center"><?php echo $row['user_posts']; ?></td> + <td class="<?php echo $row_class; ?>" align="center"><input type="checkbox" name="mark[<?php echo $row['user_id']; ?>]" /></td> + </tr> +<?php + + } + while ($row = $db->sql_fetchrow($result)); + +?> + <tr> + <td class="cat" colspan="4" align="right"><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE_MARKED']; ?>" /> </td> + </tr> +</table> + +<table width="80%" cellspacing="1" cellpadding="0" border="0" align="center"> + <tr> + <td valign="top"><?php echo on_page($total_members, $config['topics_per_page'], $start); ?></td> + <td align="right"><b><span class="gensmall"><a href="javascript:marklist('list', true);" class="gensmall"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist('list', false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></span></b> <br /><span class="nav"><?php echo generate_pagination("admin_groups.$phpEx$SID&action=list&g=$group_id", $total_members, $config['topics_per_page'], $start); ?></span></td> </tr> </table></form> <?php + } + $db->sql_freeresult($result); + break; default: @@ -393,25 +592,6 @@ function swatch() </tr> <?php - $sql = "SELECT ug.group_id, u.user_id, u.username - FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g - WHERE ug.user_pending = 1 - AND g.group_type = " . GROUP_SPECIAL . " - AND u.user_id = ug.user_id - ORDER BY ug.group_id, u.user_id"; - $result = $db->sql_query($sql); - - $pending = array(); - if ($row = $db->sql_fetchrow($result) ) - { - do - { - $pending[$row['group_id']][] = $row; - } - while ($row = $db->sql_fetchrow($result) ); - } - $db->sql_freeresult($result); - $sql = "SELECT group_id, group_name, group_type FROM " . GROUPS_TABLE . " ORDER BY group_type ASC, group_name"; @@ -488,6 +668,9 @@ function swatch() $db->sql_freeresult($result); ?> + <tr> + <td class="cat" colspan="2"> </td> + </tr> </table></form> <?php @@ -496,6 +679,23 @@ function swatch() } +?> + +<script language="Javascript" type="text/javascript"> +<!-- +function marklist(match, status) +{ + len = eval('document.' + match + '.length'); + for (i = 0; i < len; i++) + { + eval('document.' + match + '.elements[i].checked = ' + status); + } +} +//--> +</script> + +<?php + page_footer(); ?>
\ No newline at end of file diff --git a/phpBB/language/en/lang_admin.php b/phpBB/language/en/lang_admin.php index 074a741324..58704b4f10 100644 --- a/phpBB/language/en/lang_admin.php +++ b/phpBB/language/en/lang_admin.php @@ -619,13 +619,19 @@ $lang = array_merge($lang, array( 'USER_DEF_GROUPS_EXPLAIN' => 'These are groups created by you or another admin on this board. You can modify, delete or otherwise alter these. You can also define group wide settings which affect each and every member of the group.', 'SPECIAL_GROUPS' => 'Special groups', 'SPECIAL_GROUPS_EXPLAIN' => 'These are pre-defined groups, they cannot be deleted or directly modified. However you can still add users and alter settings which affect all members of each group.', - 'GROUP_MEMBERS' => 'Group members', - 'GROUP_MEMBERS_EXPLAIN' => 'This is a complete listing of all the members of this usergroup. You can delete, approve or disprove of existing and new members.', 'GROUP_EDIT_EXPLAIN' => 'Here you can edit an existing group. You can change its name, description and type (open, closed, etc.). You can also set certain groupwide options such as colouration, rank, etc. Please note that colours can be altered by individual users if they have appropriate permissions. Changes made here override users current settings.', - 'ADD_NEW_GROUP' => 'Create new group', - 'GROUP_SETTINGS_SAVE' => 'Groupwide settings', 'GROUP_SETTINGS' => 'Set user preferences', 'GROUP_SETTINGS_EXPLAIN' => 'Here you can force changes in users current preferences. Please note these settings are not saved for the group itself. They are intended as a quick method of altering the preferences of all users in this group.', + 'GROUP_MEMBERS' => 'Group members', + 'GROUP_MEMBERS_EXPLAIN' => 'This is a complete listing of all the members of this usergroup. It includes seperate sections for moderators, pending and existing members. From here you can manage all aspects of who has membership of this group and what their role is.', + 'GROUP_MODS' => 'Group moderators', + 'GROUP_MODS_EXPLAIN' => 'This is a list of users assigned group moderator roles. Group moderators can add, approve and remove members of their group.', + 'GROUP_PENDING' => 'Pending Users', + 'GROUP_PENDING_EXPLAIN' => 'These users have requested to join the group but have yet to be approved. You can approve or decline their request, or contact the user for further information.', + 'ADD_NEW_GROUP' => 'Create new group', + 'GROUP_LIST' => 'Current members', + 'GROUP_LIST_EXPLAIN' => 'This is a complete list of all the current users with membership of this group. You can delete members (except in certain special groups) or add new ones as you see fit.', + 'GROUP_SETTINGS_SAVE' => 'Groupwide settings', 'GROUP_DETAILS' => 'Group details', 'GROUP_NAME' => 'Group name', 'GROUP_DESC' => 'Group description', @@ -646,6 +652,7 @@ $lang = array_merge($lang, array( 'GROUP_TIMEZONE' => 'Group timezone', 'GROUP_DST' => 'Group daylight savings', 'USER_DEFAULT' => 'User default', + 'GROUPS_NO_MODS' => 'No group moderators defined', 'GROUP_ERR_USERNAME' => 'No group name specified.', 'GROUP_ERR_USER_LONG' => 'Group name too long.', 'GROUP_ERR_DESC_LONG' => 'Group description too long.', diff --git a/phpBB/language/en/lang_main.php b/phpBB/language/en/lang_main.php index dca1ae543c..6b29376e5a 100644 --- a/phpBB/language/en/lang_main.php +++ b/phpBB/language/en/lang_main.php @@ -395,7 +395,7 @@ $lang = array_merge($lang, array( 'Mark' => 'Mark', 'Sent' => 'Sent', 'Saved' => 'Saved', - 'Delete_marked' => 'Delete Marked', + 'DELETE_MARKED' => 'Delete Marked', 'Delete_all' => 'Delete All', 'Save_marked' => 'Save Marked', 'Save_message' => 'Save Message', @@ -422,8 +422,8 @@ $lang = array_merge($lang, array( 'No_match' => 'No matches found', 'No_such_folder' => 'No such folder exists', 'No_folder' => 'No folder specified', - 'Mark_all' => 'Mark all', - 'Unmark_all' => 'Unmark all', + 'MARK_ALL' => 'Mark all', + 'UNMARK_ALL' => 'Unmark all', 'Confirm_delete_pm' => 'Are you sure you want to delete this message?', 'Confirm_delete_pms' => 'Are you sure you want to delete these messages?', 'Inbox_size' => 'Your Inbox is %d%% full', |