Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Banned members automatically stop receiving email notification on subscribed threads Details »»
Banned members automatically stop receiving email notification on subscribed threads
Version: 1.00, by Erwin Erwin is offline
Developer Last Online: May 2013 Show Printable Version Email this Page

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.

Comments
  #12  
Old 09-24-2002, 10:48 AM
8ball's Avatar
8ball 8ball is offline
 
Join Date: Sep 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for this Erwin !!

i keep it and will try it as soon as possible
Reply With Quote
  #13  
Old 09-25-2002, 05:31 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 10-16-2002, 01:37 PM
Talisman's Avatar
Talisman Talisman is offline
 
Join Date: Aug 2002
Location: USA/West Coast
Posts: 371
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the fix, Erwin. We're still using 2.2.6.
Reply With Quote
  #15  
Old 10-16-2002, 08:32 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're welcome. Glad people still find this useful.
Reply With Quote
  #16  
Old 01-09-2003, 05:15 AM
lalo landa lalo landa is offline
 
Join Date: Nov 2002
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

work in 2.2.4 too
Reply With Quote
  #17  
Old 02-01-2003, 03:15 AM
Kathy's Avatar
Kathy Kathy is offline
 
Join Date: Nov 2001
Location: Texas, ya'll
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

thanks!
Reply With Quote
  #18  
Old 02-01-2003, 04:11 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just add this line as part of that query:

AND user.usergroupid NOT IN (23,3,52)

Reply With Quote
  #19  
Old 02-01-2003, 04:17 AM
Kathy's Avatar
Kathy Kathy is offline
 
Join Date: Nov 2001
Location: Texas, ya'll
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks Erwin.

What is this line? I don't want to mess up the query by listing a usergroupid twice:
AND user.usergroupid<>'3'
Reply With Quote
  #20  
Old 02-01-2003, 04:32 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can take that line out.
Reply With Quote
  #21  
Old 05-01-2005, 02:14 AM
oldengine oldengine is offline
 
Join Date: Mar 2004
Posts: 257
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can we get this for use in 3.0.7 ?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:11 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05913 seconds
  • Memory Usage 2,308KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete