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.
There's no need to install this hack anymore. vB has included this hack as standard in 2.2.8 which is now out. Thanks to PPN who listened to me when I posted about this on vB.com.
Sorry for bringing this back up...but I'd like clarification. My current functions.php has this section but I don't think it is stopping the "banned" and "email awaiting confiramtion" from getting email notifications.. Of course I have a very hacked up file so perhaps I've missed getting the right upgraded bit in my 2.2.8:
Code:
$useremails=$DB_site->query("SELECT user.*
FROM subscribethread,user,usergroup
WHERE subscribethread.threadid='$threadid'
AND subscribethread.userid=user.userid
AND usergroup.usergroupid=user.usergroupid
AND user.userid<>'$userid'
AND user.usergroupid<>'3'
AND usergroup.canview = 1
AND user.lastactivity>'$lastposttime[dateline]'");
Is there someplace I can make it so that banned, email awaiting, and another usergroup (bad email) can be unsubscribed?
Banned =usergroupid=23
users awaiting confirmation=usergroupid=3
Bad email =usergroupid=52