mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-09 10:16:36 +02:00
- Automatically add users/groups to the PM recipient list, if entered or selected.
- Reply to PM now includes all previous recipients and not only the original sender. - Added 'max_recipients' setting for private messages. This setting allows admins to define the maximum number of recipients per private message with a board-wide setting and a group-specific setting. - Added new permission setting for sending private messages to groups. Now there are two permissions to define sending private messages to multiple recipients and private messages to groups. git-svn-id: file:///svn/phpbb/trunk@8914 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -126,6 +126,7 @@ class acp_board
|
||||
'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
|
||||
'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
|
||||
'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
|
||||
'pm_max_recipients' => array('lang' => 'PM_MAX_RECIPIENTS', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true),
|
||||
|
||||
'legend2' => 'GENERAL_OPTIONS',
|
||||
'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
|
@@ -302,6 +302,7 @@ class acp_groups
|
||||
'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
|
||||
'legend' => isset($_REQUEST['group_legend']) ? 1 : 0,
|
||||
'message_limit' => request_var('group_message_limit', 0),
|
||||
'max_recipients' => request_var('group_max_recipients', 0),
|
||||
'founder_manage' => 0,
|
||||
);
|
||||
|
||||
@@ -394,7 +395,7 @@ class acp_groups
|
||||
// were made.
|
||||
|
||||
$group_attributes = array();
|
||||
$test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'founder_manage');
|
||||
$test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients', 'founder_manage');
|
||||
foreach ($test_variables as $test)
|
||||
{
|
||||
if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
|
||||
@@ -554,6 +555,7 @@ class acp_groups
|
||||
'GROUP_FOUNDER_MANAGE' => (isset($group_row['group_founder_manage']) && $group_row['group_founder_manage']) ? ' checked="checked"' : '',
|
||||
'GROUP_LEGEND' => (isset($group_row['group_legend']) && $group_row['group_legend']) ? ' checked="checked"' : '',
|
||||
'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
|
||||
'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
|
||||
'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
|
||||
|
||||
|
||||
|
@@ -183,17 +183,40 @@ class acp_main
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$sql = 'SELECT COUNT(p.post_id) AS num_posts, u.user_id
|
||||
FROM ' . USERS_TABLE . ' u
|
||||
LEFT JOIN ' . POSTS_TABLE . ' p ON (u.user_id = p.poster_id AND p.post_postcount = 1 AND p.post_approved = 1)
|
||||
GROUP BY u.user_id';
|
||||
$result = $db->sql_query($sql);
|
||||
// Resync post counts
|
||||
$start = 0;
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
do
|
||||
{
|
||||
$db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['user_id']}");
|
||||
$sql = 'SELECT COUNT(p.post_id) AS num_posts, u.user_id
|
||||
FROM ' . USERS_TABLE . ' u
|
||||
LEFT JOIN ' . POSTS_TABLE . ' p ON (u.user_id = p.poster_id AND p.post_postcount = 1 AND p.post_approved = 1)
|
||||
GROUP BY u.user_id
|
||||
ORDER BY u.user_id ASC';
|
||||
$result = $db->sql_query_limit($sql, 200, $start);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$i = 0;
|
||||
|
||||
do
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['user_id']}";
|
||||
_sql($sql, $errored, $error_ary);
|
||||
|
||||
$i++;
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$start = ($i < 200) ? 0 : $start + 200;
|
||||
}
|
||||
else
|
||||
{
|
||||
$start = 0;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
while ($start);
|
||||
|
||||
add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
|
||||
|
||||
|
Reference in New Issue
Block a user