vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   New Post Notification (https://vborg.vbsupport.ru/showthread.php?t=257255)

LNF 01-16-2011 09:26 PM

New Post Notification
 
I would like to notify certain usergroups via email when a new post is made in certain forums.

From what I see, I can type in individual email addresses followed by spaces in the admincp>forum manager>edit forum>Email Addresses to Notify When there is a New Post. This isn't favourable as members can change user groups and I would have to manually revise the list. Not to mention adding new users...

Is there a hack that would allow me to just type in the user group in the email address to notify in admin cp?

MoMan 01-16-2011 10:23 PM

I don't think there's a hack out for this, but it sounds pretty easy to code up if you have a comma-separated field in the forum editor. Here's some pseudo-code that you can put wherever the current e-mailing calls are made:

$usergroups = '(' . $usergroup_field . ')'; // you probably want to validate input for your actual implementation
$emails = $vbulletin->db->query_read("SELECT email FROM _vbuser WHERE usergroupid IN $usergroups");

while($result = $vbulletin->db->fetch_row($emails))
{
vbmail($result['email'],$title, $message);
}

Videx 01-17-2011 06:46 PM

There's a mod that allows instant notification for forum subscriptions. But users have to subscribe to the forum themselves. And last I looked it had no options at all such as excluding forums or usergroups.

Note that subscribing people involuntarily like you're planning could quickly get you blacklisted.

LNF 01-17-2011 06:59 PM

thanks for the input...

Is there a way I can modify the text in the notification message?

Videx 01-17-2011 08:18 PM

Yes, virtually all text in vb is in AdminCP>Phrases.


All times are GMT. The time now is 12:59 AM.

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.01455 seconds
  • Memory Usage 1,708KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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