aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/ucp/ucp_groups.php53
-rw-r--r--phpBB/language/en/email/group_request.txt2
-rw-r--r--phpBB/memberlist.php30
-rw-r--r--phpBB/styles/prosilver/template/memberlist_body.html20
-rw-r--r--phpBB/styles/prosilver/template/ucp_groups_manage.html36
-rw-r--r--phpBB/styles/subsilver2/template/ucp_groups_manage.html8
6 files changed, 105 insertions, 44 deletions
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index d884e0d571..26bc8159e8 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -221,8 +221,9 @@ class ucp_groups
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
- 'USERNAME' => htmlspecialchars_decode($row['username']),
- 'GROUP_NAME' => htmlspecialchars_decode($group_row[$group_id]['group_name']),
+ 'USERNAME' => htmlspecialchars_decode($row['username']),
+ 'GROUP_NAME' => htmlspecialchars_decode($group_row[$group_id]['group_name']),
+ 'REQUEST_USERNAME' => $user->data['username'],
'U_PENDING' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=manage&action=list&g=$group_id",
'U_GROUP' => generate_board_url() . "/memberlist.$phpEx?mode=group&g=$group_id")
@@ -434,6 +435,23 @@ class ucp_groups
{
trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . $return_page, E_USER_WARNING);
}
+
+ $group_name = $group_row['group_name'];
+ $group_type = $group_row['group_type'];
+ $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_root_path . 'adm/images/no_avatar.gif" alt="" />';
+
+ $template->assign_vars(array(
+ 'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name,
+ 'GROUP_INTERNAL_NAME' => $group_name,
+ 'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
+ 'GROUP_DESC_DISP' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),
+ 'GROUP_TYPE' => $group_row['group_type'],
+
+ 'AVATAR' => $avatar_img,
+ 'AVATAR_IMAGE' => $avatar_img,
+ 'AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '',
+ 'AVATAR_HEIGHT' => (isset($group_row['group_avatar_height'])) ? $group_row['group_avatar_height'] : '',
+ ));
}
switch ($action)
@@ -629,9 +647,7 @@ class ucp_groups
}
else
{
- $group_name = $group_row['group_name'];
$group_desc_data = generate_text_for_edit($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_options']);
- $group_type = $group_row['group_type'];
$group_rank = $group_row['group_rank'];
}
@@ -654,8 +670,6 @@ class ucp_groups
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
- $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_root_path . 'adm/images/no_avatar.gif" alt="" />';
-
$display_gallery = (isset($_POST['display_gallery'])) ? true : false;
if ($config['allow_avatar_local'] && $display_gallery)
@@ -665,7 +679,6 @@ class ucp_groups
$avatars_enabled = ($can_upload || ($config['allow_avatar_local'] || $config['allow_avatar_remote'])) ? true : false;
-
$template->assign_vars(array(
'S_EDIT' => true,
'S_INCLUDE_SWATCH' => true,
@@ -678,23 +691,16 @@ class ucp_groups
'S_IN_GALLERY' => ($config['allow_avatar_local'] && $display_gallery) ? true : false,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name,
- 'GROUP_INTERNAL_NAME' => $group_name,
- 'GROUP_DESC' => $group_desc_data['text'],
'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '',
'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
- 'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
-
+
+ 'GROUP_DESC' => $group_desc_data['text'],
'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'],
'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'],
'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'],
'S_RANK_OPTIONS' => $rank_options,
- 'AVATAR' => $avatar_img,
- 'AVATAR_IMAGE' => $avatar_img,
'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'],
- 'AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '',
- 'AVATAR_HEIGHT' => (isset($group_row['group_avatar_height'])) ? $group_row['group_avatar_height'] : '',
'GROUP_TYPE_FREE' => GROUP_FREE,
'GROUP_TYPE_OPEN' => GROUP_OPEN,
@@ -741,7 +747,7 @@ class ucp_groups
WHERE ug.group_id = $group_id
AND u.user_id = ug.user_id
AND ug.group_leader = 1
- ORDER BY ug.group_leader DESC, ug.user_pending ASC, u.username_clean";
+ ORDER BY ug.user_pending DESC, u.username_clean";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -774,10 +780,11 @@ class ucp_groups
WHERE ug.group_id = $group_id
AND u.user_id = ug.user_id
AND ug.group_leader = 0
- ORDER BY ug.group_leader DESC, ug.user_pending ASC, u.username_clean";
+ ORDER BY ug.user_pending DESC, u.username_clean";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$pending = false;
+ $approved = false;
while ($row = $db->sql_fetchrow($result))
{
@@ -786,9 +793,19 @@ class ucp_groups
$template->assign_block_vars('member', array(
'S_PENDING' => true)
);
+ $template->assign_var('S_PENDING_SET', true);
$pending = true;
}
+ else if (!$row['user_pending'] && !$approved)
+ {
+ $template->assign_block_vars('member', array(
+ 'S_APPROVED' => true)
+ );
+ $template->assign_var('S_APPROVED_SET', true);
+
+ $approved = true;
+ }
$template->assign_block_vars('member', array(
'USERNAME' => $row['username'],
diff --git a/phpBB/language/en/email/group_request.txt b/phpBB/language/en/email/group_request.txt
index 85664857dd..75840831fb 100644
--- a/phpBB/language/en/email/group_request.txt
+++ b/phpBB/language/en/email/group_request.txt
@@ -2,7 +2,7 @@ Subject: A request to join your group has been made
Dear {USERNAME},
-A user has requested to join the group "{GROUP_NAME}" you moderate on "{SITENAME}".
+The user "{REQUEST_USERNAME}" has requested to join the group "{GROUP_NAME}" you moderate on "{SITENAME}".
To approve or deny this request for group membership please visit the following link:
{U_PENDING}
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index f33eac5bac..869777382e 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -1326,7 +1326,7 @@ switch ($mode)
$user_list[] = (int) $row['user_id'];
}
$db->sql_freeresult($result);
-
+ $leaders_set = false;
// So, did we get any users?
if (sizeof($user_list))
{
@@ -1386,15 +1386,16 @@ switch ($mode)
// If we sort by last active date we need to adjust the id cache due to user_lastvisit not being the last active date...
if ($sort_key == 'l')
{
- $lesser_than = ($sort_dir == 'a') ? -1 : 1;
// uasort($id_cache, create_function('$first, $second', "return (\$first['last_visit'] == \$second['last_visit']) ? 0 : ((\$first['last_visit'] < \$second['last_visit']) ? $lesser_than : ($lesser_than * -1));"));
- usort($user_list, create_function('$first, $second', "global \$id_cache; return (\$id_cache[\$first]['last_visit'] == \$id_cache[\$second]['last_visit']) ? 0 : ((\$id_cache[\$first]['last_visit'] < \$id_cache[\$second]['last_visit']) ? $lesser_than : ($lesser_than * -1));"));
+ usort($user_list, '_sort_last_active');
}
for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i)
{
$user_id = $user_list[$i];
$row =& $id_cache[$user_id];
+ $is_leader = (isset($row['group_leader']) && $row['group_leader']) ? true : false;
+ $leaders_set = ($leaders_set || $is_leader);
$cp_row = array();
if ($config['load_cpf_memberlist'])
@@ -1406,7 +1407,7 @@ switch ($mode)
'ROW_NUMBER' => $i + ($start + 1),
'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,
- 'S_GROUP_LEADER' => (isset($row['group_leader']) && $row['group_leader']) ? true : false,
+ 'S_GROUP_LEADER' => $is_leader,
'U_VIEW_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_id))
);
@@ -1466,6 +1467,7 @@ switch ($mode)
'S_SHOW_GROUP' => ($mode == 'group') ? true : false,
'S_VIEWONLINE' => $auth->acl_get('u_viewonline'),
+ 'S_LEADERS_SET' => $leaders_set,
'S_MODE_SELECT' => $s_sort_key,
'S_ORDER_SELECT' => $s_sort_dir,
'S_CHAR_OPTIONS' => $s_char_options,
@@ -1596,4 +1598,24 @@ function show_profile($data)
);
}
+function _sort_last_active($first, $second)
+{
+ global $id_cache, $sort_dir;
+
+ $lesser_than = ($sort_dir === 'a') ? -1 : 1;
+
+ if (isset($id_cache[$first]['group_leader']) && $id_cache[$first]['group_leader'] && (!isset($id_cache[$second]['group_leader']) || !$id_cache[$second]['group_leader']))
+ {
+ return 1;
+ }
+ else if (isset($id_cache[$second]['group_leader']) && (!isset($id_cache[$first]['group_leader']) || !$id_cache[$first]['group_leader']) && $id_cache[$second]['group_leader'])
+ {
+ return -1;
+ }
+ else
+ {
+ return $lesser_than * (int) ($id_cache[$first]['last_visit'] - $id_cache[$second]['last_visit']);
+ }
+}
+
?> \ No newline at end of file
diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html
index 6846432b2e..9d138b9cae 100644
--- a/phpBB/styles/prosilver/template/memberlist_body.html
+++ b/phpBB/styles/prosilver/template/memberlist_body.html
@@ -72,7 +72,7 @@
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
-
+ <!-- IF S_LEADERS_SET -->
<div class="forumbg forumbg-table">
<div class="inner"><span class="corners-top"><span></span></span>
@@ -87,6 +87,7 @@
</tr>
</thead>
<tbody>
+ <!-- ENDIF -->
<!-- BEGIN memberrow -->
<!-- IF S_SHOW_GROUP -->
<!-- IF not memberrow.S_GROUP_LEADER and not $S_MEMBER_HEADER -->
@@ -95,12 +96,13 @@
<td colspan="<!-- IF U_SORT_ACTIVE -->5<!-- ELSE -->4<!-- ENDIF -->">&nbsp;</td>
</tr>
<!-- ENDIF -->
+<!-- IF S_LEADERS_SET -->
</tbody>
</table>
<span class="corners-bottom"><span></span></span></div>
</div>
-
+<!-- ENDIF -->
<div class="forumbg">
<div class="inner"><span class="corners-top"><span></span></span>
@@ -127,6 +129,20 @@
<!-- IF S_VIEWONLINE --><td>{memberrow.VISITED}&nbsp;</td><!-- ENDIF -->
</tr>
<!-- BEGINELSE -->
+ <div class="forumbg">
+ <div class="inner"><span class="corners-top"><span></span></span>
+
+ <table class="table1" cellspacing="1">
+ <thead>
+ <tr>
+ <th class="name">{L_GROUP_MEMBERS}</th>
+ <th class="posts">&nbsp;</th>
+ <th class="info">&nbsp;</th>
+ <th class="joined">&nbsp;</th>
+ <!-- IF U_SORT_ACTIVE --><th class="active">&nbsp;</th><!-- ENDIF -->
+ </tr>
+ </thead>
+ <tbody>
<tr class="bg1">
<td colspan="<!-- IF S_VIEWONLINE -->5<!-- ELSE -->4<!-- ENDIF -->">{L_NO_MEMBERS}</td>
</tr>
diff --git a/phpBB/styles/prosilver/template/ucp_groups_manage.html b/phpBB/styles/prosilver/template/ucp_groups_manage.html
index b64a3f63ea..47a8acb13a 100644
--- a/phpBB/styles/prosilver/template/ucp_groups_manage.html
+++ b/phpBB/styles/prosilver/template/ucp_groups_manage.html
@@ -1,6 +1,6 @@
<!-- INCLUDE ucp_header.html -->
-<h2>{L_USERGROUPS}</h2>
+<h2<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR};"<!-- ENDIF -->>{L_USERGROUPS}<!-- IF GROUP_NAME --> :: {GROUP_NAME}<!-- ENDIF --></h2>
<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
@@ -79,6 +79,7 @@
<!-- ELSEIF S_LIST -->
+ <!-- IF .leader -->
<table class="table1" cellspacing="1">
<thead>
<tr>
@@ -101,23 +102,10 @@
<!-- END leader -->
</tbody>
</table>
+ <!-- ENDIF -->
- <table class="table1" cellspacing="1">
- <thead>
- <tr>
- <th class="name">{L_GROUP_APPROVED}</th>
- <th class="info">{L_GROUP_DEFAULT}</th>
- <th class="posts">{L_POSTS}</th>
- <th class="joined">{L_JOINED}</th>
- <th class="mark">{L_MARK}</th>
- </tr>
- </thead>
- <tbody>
<!-- BEGIN member -->
<!-- IF member.S_PENDING -->
- </tbody>
- </table>
-
<table class="table1" cellspacing="1">
<thead>
<tr>
@@ -128,7 +116,23 @@
<th class="mark">{L_MARK}</th>
</tr>
</thead>
- <tbody>
+ <tbody>
+ <!-- ELSEIF member.S_APPROVED -->
+ <!-- IF member.S_PENDING_SET -->
+ </tbody>
+ </table>
+ <!-- ENDIF -->
+ <table class="table1" cellspacing="1">
+ <thead>
+ <tr>
+ <th class="name">{L_GROUP_APPROVED}</th>
+ <th class="info">{L_GROUP_DEFAULT}</th>
+ <th class="posts">{L_POSTS}</th>
+ <th class="joined">{L_JOINED}</th>
+ <th class="mark">{L_MARK}</th>
+ </tr>
+ </thead>
+ <tbody>
<!-- ELSE -->
<tr class="<!-- IF member.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
<td class="name">{member.USERNAME_FULL}</td>
diff --git a/phpBB/styles/subsilver2/template/ucp_groups_manage.html b/phpBB/styles/subsilver2/template/ucp_groups_manage.html
index 4a3296d153..6ae9816ca8 100644
--- a/phpBB/styles/subsilver2/template/ucp_groups_manage.html
+++ b/phpBB/styles/subsilver2/template/ucp_groups_manage.html
@@ -151,14 +151,16 @@
<td style="text-align: center;"></td>
</tr>
<!-- END leader -->
- <tr>
- <td class="row3" colspan="5"><b>{L_GROUP_APPROVED}</b></td>
- </tr>
+
<!-- BEGIN member -->
<!-- IF member.S_PENDING -->
<tr>
<td class="row3" colspan="5"><b>{L_GROUP_PENDING}</b></td>
</tr>
+ <!-- ELSEIF member.S_APPROVED -->
+ <tr>
+ <td class="row3" colspan="5"><b>{L_GROUP_APPROVED}</b></td>
+ </tr>
<!-- ELSE -->
<!-- IF member.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td>{member.USERNAME_FULL}</td>