Erwin
09-10-2002, 10:00 PM
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:
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:
AND user.userid<>'$userid'
BELOW IT ADD:
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! :)
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:
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:
AND user.userid<>'$userid'
BELOW IT ADD:
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! :)