mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-11 01:55:24 +02:00
Merge branch 'ticket/erikfrerejean/9581' into develop-olympus
* ticket/erikfrerejean/9581: [ticket/9581] Fix missing index [ticket/9581] Slightly tweaked queries [ticket/9581] Make banlist table select optional [ticket/9581] Mass e-mail to banned users
This commit is contained in:
commit
d3b5df2548
@ -38,6 +38,10 @@
|
|||||||
<dt><label for="priority">{L_MAIL_PRIORITY}:</label></dt>
|
<dt><label for="priority">{L_MAIL_PRIORITY}:</label></dt>
|
||||||
<dd><select id="priority" name="mail_priority_flag">{S_PRIORITY_OPTIONS}</select></dd>
|
<dd><select id="priority" name="mail_priority_flag">{S_PRIORITY_OPTIONS}</select></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt><label for="banned">{L_MAIL_BANNED}:</label><br /><span>{L_MAIL_BANNED_EXPLAIN}</span></dt>
|
||||||
|
<dd><input id="banned" name="mail_banned_flag" type="checkbox" class="radio" /></dd>
|
||||||
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label for="send">{L_SEND_IMMEDIATELY}:</label></dt>
|
<dt><label for="send">{L_SEND_IMMEDIATELY}:</label></dt>
|
||||||
<dd><input id="send" type="checkbox" class="radio" name="send_immediately" checked="checked" /></dd>
|
<dd><input id="send" type="checkbox" class="radio" name="send_immediately" checked="checked" /></dd>
|
||||||
|
@ -82,23 +82,48 @@ class acp_email
|
|||||||
{
|
{
|
||||||
if ($group_id)
|
if ($group_id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT u.user_email, u.username, u.username_clean, u.user_lang, u.user_jabber, u.user_notify_type
|
$sql_ary = array(
|
||||||
FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug
|
'SELECT' => 'u.user_email, u.username, u.username_clean, u.user_lang, u.user_jabber, u.user_notify_type',
|
||||||
WHERE ug.group_id = ' . $group_id . '
|
'FROM' => array(
|
||||||
|
USERS_TABLE => 'u',
|
||||||
|
USER_GROUP_TABLE => 'ug',
|
||||||
|
),
|
||||||
|
'WHERE' => 'ug.group_id = ' . $group_id . '
|
||||||
AND ug.user_pending = 0
|
AND ug.user_pending = 0
|
||||||
AND u.user_id = ug.user_id
|
AND u.user_id = ug.user_id
|
||||||
AND u.user_allow_massemail = 1
|
AND u.user_allow_massemail = 1
|
||||||
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
|
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')',
|
||||||
ORDER BY u.user_lang, u.user_notify_type';
|
'ORDER_BY' => 'u.user_lang, u.user_notify_type',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql = 'SELECT username, username_clean, user_email, user_jabber, user_notify_type, user_lang
|
$sql_ary = array(
|
||||||
FROM ' . USERS_TABLE . '
|
'SELECT' => 'u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type',
|
||||||
WHERE user_allow_massemail = 1
|
'FROM' => array(
|
||||||
AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
|
USERS_TABLE => 'u',
|
||||||
ORDER BY user_lang, user_notify_type';
|
),
|
||||||
|
'WHERE' => 'u.user_allow_massemail = 1
|
||||||
|
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')',
|
||||||
|
'ORDER_BY' => 'u.user_lang, u.user_notify_type',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mail banned or not
|
||||||
|
if (!isset($_REQUEST['mail_banned_flag']))
|
||||||
|
{
|
||||||
|
$sql_ary['WHERE'] .= ' AND (b.ban_id IS NULL
|
||||||
|
OR b.ban_exclude = 1)';
|
||||||
|
$sql_ary['LEFT_JOIN'] = array(
|
||||||
|
array(
|
||||||
|
'FROM' => array(
|
||||||
|
BANLIST_TABLE => 'b',
|
||||||
|
),
|
||||||
|
'ON' => 'u.user_id = b.ban_userid',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$sql = $db->sql_build_query('SELECT', $sql_ary);
|
||||||
}
|
}
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
|
@ -52,14 +52,16 @@ $lang = array_merge($lang, array(
|
|||||||
'SEND_TO_GROUP' => 'Send to group',
|
'SEND_TO_GROUP' => 'Send to group',
|
||||||
'SEND_TO_USERS' => 'Send to users',
|
'SEND_TO_USERS' => 'Send to users',
|
||||||
'SEND_TO_USERS_EXPLAIN' => 'Entering names here will override any group selected above. Enter each username on a new line.',
|
'SEND_TO_USERS_EXPLAIN' => 'Entering names here will override any group selected above. Enter each username on a new line.',
|
||||||
|
|
||||||
|
'MAIL_BANNED' => 'Mail banned users',
|
||||||
|
'MAIL_BANNED_EXPLAIN' => 'When sending a mass e-mail to a group you can select here whether banned users will also receive the e-mail.',
|
||||||
'MAIL_HIGH_PRIORITY' => 'High',
|
'MAIL_HIGH_PRIORITY' => 'High',
|
||||||
'MAIL_LOW_PRIORITY' => 'Low',
|
'MAIL_LOW_PRIORITY' => 'Low',
|
||||||
'MAIL_NORMAL_PRIORITY' => 'Normal',
|
'MAIL_NORMAL_PRIORITY' => 'Normal',
|
||||||
'MAIL_PRIORITY' => 'Mail priority',
|
'MAIL_PRIORITY' => 'Mail priority',
|
||||||
'MASS_MESSAGE' => 'Your message',
|
'MASS_MESSAGE' => 'Your message',
|
||||||
'MASS_MESSAGE_EXPLAIN' => 'Please note that you may enter only plain text. All markup will be removed before sending.',
|
'MASS_MESSAGE_EXPLAIN' => 'Please note that you may enter only plain text. All markup will be removed before sending.',
|
||||||
|
|
||||||
'NO_EMAIL_MESSAGE' => 'You must enter a message.',
|
'NO_EMAIL_MESSAGE' => 'You must enter a message.',
|
||||||
'NO_EMAIL_SUBJECT' => 'You must specify a subject for your message.',
|
'NO_EMAIL_SUBJECT' => 'You must specify a subject for your message.',
|
||||||
));
|
));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user