vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   SQL Query to turn off admin email for specific usergroup (https://vborg.vbsupport.ru/showthread.php?t=302985)

Magle 10-05-2013 10:05 AM

SQL Query to turn off admin email for specific usergroup
 
Hello,

As I can't seem to find a vb 4.x mod that allows turning off Admin Emails for a specific usergroup, I would like to ask if anyone knows what SQL query I could use for that.

I know there is an automatic pre-made query "No - Receive Admin Emails", but that turns it off for all users. I would like to only turn it off for a specific group.

Thank you in advance for any help

-Frederik

ozzy47 10-05-2013 10:21 AM

Run this query.

Code:

UPDATE user SET options = options - 16 WHERE options & 16 AND usergroupid = X
Change the X to the usergroup id that you want to do that to.

Magle 10-05-2013 11:10 AM

Thank you very much!!

ozzy47 10-05-2013 11:25 AM

Not a problem, glad to help. :)

Magle 10-05-2013 12:42 PM

:)

I hope you don't mind me asking another question. What variable would I use to delete subscriptions for all members of a usergroup?

The reason I'm asking these questions, is that I have many old inactive members, and the forum keeps sending them birthday greetings and emails with updates of threads they have subscribed to, but many of these emails bounce back (and I fear they are flagged as spam). So, I have installed This mod, which enables me to put them all in one group, so I can delete all their subscriptions and turn off admin emails (if people hasn't visited for more than 2 years, I see no reason to keep sending them updates and birthday greetings).

ozzy47 10-05-2013 01:08 PM

This should do the trick.

Code:

DELETE `subscribethread` FROM `subscribethread`
LEFT JOIN `user` ON `subscribethread`.`userid` = `user`.`userid`
WHERE `subscribethread`.`emailupdate` <> '0' AND `user`.`usergroupid` = 'X'

Change X to the usergroup ID

That query will delete all the threads users in the usergroup X are subscribed to.

Magle 10-05-2013 01:20 PM

Awesome, thank you! I just tested it on a test user/usergroup and it worked like a charm! :)

Thanks again!

ozzy47 10-05-2013 01:33 PM

Not a problem, glad it worked how you wanted. :)


All times are GMT. The time now is 03:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01081 seconds
  • Memory Usage 1,721KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete