Version: 1.00, by Erwin
Developer Last Online: May 2013
Version: 2.2.x
Rating:
Released: 09-10-2002
Last Update: Never
Installs: 30
No support by the author.
NOTE: This hack is now included as standard from vB 2.2.8 upwards.
This is really a mini-hack.
As some of you may have come to realize, one of the shortcomings of vB is that after we have banned a member, that member still receives email notification, even when we have banned the member from viewing the forum or any threads.
Obviously a banned member cannot access his or her user control panel to unsubscribe to threads or switch off email notification. We as admins cannot access the member's user control panel to unsubscribe him from threads since we don't have his password, and we cannot do it from the Admin CP.
We can run a db query to unsubscribe the member manually:
PHP Code:
DELETE FROM subscribethread WHERE userid=XX
Where XX is the userid of the member. It's very easy to add this to the Admin CP by the way. However, this is cumbersome, as the process is not automated. And once you unban the member, he has to remember to subscribe himself to the right threads again.
I wanted to make this automatic. With this mini-hack, once you ban a member (or make a member unregistered, awaiting email confirmation or a COPPA member), his email notification stops automatically. When you unban the member (or make the member registered etc.), his email notification automatically restarts again. No need to manually run that db query.
It's easy to install and is a matter of ADDING ONE line in functions.php
In functions.php:
Find:
PHP Code:
AND user.userid<>'$userid'
BELOW IT ADD:
PHP Code:
AND user.usergroupid NOT IN (1,3,4,8)
That's it! So when you ban a member or make them unregistered, or awaiting email confirmation, they will stop receiving email notifications. No more emails from irate banned members!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
This is almost like bug fix really... it's silly that banned members still get subscribed thread email notifications... I was sick of getting emails from banned members complaining about the emails.
Good addition, but I probably wont install.
I find it amusing that banned members still get email notifications and not be able to see the actual threads
Originally posted by cessna140 Actually this would be great for membership types sites. When a member expires this could make sure their subscriptions are deleted too!
True. Just add or remove the usergroupid's from the line that you add to choose which usergroups can or cannot receive email subscriptions.
Are you sure you put that line in the right place? This hack cannot cause a parse error, since all it does is add another "AND" requirement to the query that gets all the emails to be sent to when a new reply is made.
Without my hack, the query looks like this:
PHP Code:
$useremails=$DB_site->query("SELECT user.*
FROM subscribethread,user
WHERE subscribethread.threadid='$threadid'
AND subscribethread.userid=user.userid
AND user.userid<>'$userid'
AND user.lastactivity>'$lastposttime[dateline]'");
After my hack, the query looks like this:
PHP Code:
$useremails=$DB_site->query("SELECT user.*
FROM subscribethread,user
WHERE subscribethread.threadid='$threadid'
AND subscribethread.userid=user.userid
AND user.userid<>'$userid'
AND user.usergroupid NOT IN (1,3,4,8,17)
AND user.lastactivity>'$lastposttime[dateline]'");
Go and install the hack again, and make sure that you are putting that extra line in the right place in functions.php - this hack does NOT and can NOT interfere with any other hack. It just adds another requirement to that specific query.