PDA

View Full Version : how to stop banned users receiving email from the forums


kevinh
10-27-2011, 04:16 AM
The title says it all really.

On a site running 3.8.2 how do we stop banned users from getting new post/thread notifications?

I would like to do this automatically on banning. I'm sure this issue has cropped up before but tried a search and couldn't find anything recent.

kh99
10-27-2011, 05:42 PM
In file includes/functions_newpost.php around line 1387 or so is this:


//If the target user's location is the same as the current user, then don't send them
//a notification.
$useremails = $vbulletin->db->query_read_slave("
SELECT user.*, subscribethread.emailupdate, subscribethread.subscribethreadid
FROM " . TABLE_PREFIX . "subscribethread AS subscribethread
INNER JOIN " . TABLE_PREFIX . "user AS user ON (subscribethread.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (usergroup.usergroupid = user.usergroupid)
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (usertextfield.userid = user.userid)
WHERE subscribethread.threadid = $threadid AND
subscribethread.emailupdate IN (1, 4) AND
subscribethread.canview = 1 AND
" . ($userid ? "CONCAT(' ', IF(usertextfield.ignorelist IS NULL, '', usertextfield.ignorelist), ' ') NOT LIKE '% " . intval($userid) . " %' AND" : '') . "
user.usergroupid <> 3 AND
user.usergroupid <> 8 AND
user.userid <> " . intval($userid) . " AND
user.lastactivity >= " . intval($lastposttime['dateline']) . " AND
(usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['isnotbannedgroup'] . ")
");


I think if you add the line in red it will eliminate banned users from notification emails.