vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   v2.0 Email new thread notifications to subscribed users (https://vborg.vbsupport.ru/showthread.php?t=18718)

chrispadfield 05-29-2001 10:00 PM

A few have requested this, me especially so i made it.

What it does: Emails all those who have subscribed to a forum an email telling them about a new thread.

Extra queries: 1 upon every new thread. Extra time processing new threads as emails must be sent.

code changes, 1 in newthread.php and 2 new templates.




CODE CHANGE:

Add:

PHP Code:

// This emails a new thread notification to those subscribed to the forum
    
if ($enableemail) {
      
// do emails

      
$useremails=$DB_site->query("SELECT user.*
                                   FROM subscribeforum,user
                                   WHERE subscribeforum.forumid='
$forumid'
                                     AND subscribeforum.userid=user.userid
                                     AND user.userid<>'
$bbuserinfo[userid]'
                                    "
);

              
$toemail=$val;
              
$forumtitle $foruminfo['title'];
              
$threadinfo['title'] = $subject;

      
$bbuserinfo['username']=unhtmlspecialchars($bbuserinfo['username']);
      while (
$touser=$DB_site->fetch_array($useremails)) {
        
$touser['username']=unhtmlspecialchars($touser['username']);

        eval(
"\$emailmsg = \"".gettemplate("email_newthread",1,0)."\";");
        eval(
"\$emailsubject = \"".gettemplate("email_newthreadsubject",1,0)."\";");

        
mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
      }


below the section //send email to moderators which ends with

}
}
}
}

add two templates:

i) email_newthread

Code:

Hello $touser[username],

$bbuserinfo[username] has just started a new thread: in $foruminfo[title]
This is a forum you have subscribed to at $bbtitle

The thread title is: $threadinfo[title]
This thread is located at:
$bburl/showthread.php?threadid=$threadid&goto=newpost

Yours,
$bbtitle team

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unsubscription information:

You are receiving these "new thread" notifications because
you are subscribed to the $foruminfo[title] forum.

To unsubscribe, please visit:
$bburl/usercp.php

and secondly

email_newthreadsubject

Code:

New Thread in $foruminfo[title]
any you are away :)

chrispadfield 05-30-2001 03:41 PM

please note if you are testing this you need two users because it will NOT send an email to the person who started the thread. Either remove the last line of the query

PHP Code:

AND user.userid<>'$bbuserinfo[userid]' 

or use two different users.

chrispadfield 05-30-2001 04:21 PM

oops, i left a line of debug code in.

if you have already installed this, remove this line
echo $touser;
the code change had been updated so if you have not installed it yet don't worry.

MrLister 05-30-2001 06:05 PM

is it possible to make it so it does this every hour and every hour lists all the new threads within the thread.

chrispadfield 05-30-2001 08:08 PM

i am not sure what you mean. Why would you want to send them every hour when they can be done instantly? by the sounds of it you want something more like the community bulletin thing made by Kier/tubedog

chrispadfield 05-31-2001 01:32 PM

sorry, another fix

you need to change $threadinfo[threadid] to $threadid

Joe 06-02-2001 05:57 AM

The emails this sends out are from "nobody" at : nobody@snoturtle.serverhost.com

How do i change this to Bike Forums with my real email addy? :)

chrispadfield 06-02-2001 11:58 AM

mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");

is the line that generates that and it is copied straight from the newreply.php code (which is where most of this code came from). I can't see how it can work in one place and not the other. sorry, not a clue.

Kevin Green 10-15-2001 02:23 PM

Hi,

Very interested in this thread for user support purposes.

Will it email users subscribed to the Forum when there are additions to any of the existing threads

Will it email users if there are additions to the thread it has already notified them of?

I ask because I am interested in having users emailed if there is a new thread or if there are any additions to existing threads regardless of whether they have been previously notified but perhaps failed to check the Forum.

Many thanks

kevin

Pie'oh'pah 10-15-2001 04:48 PM

Hi,

we have the same problem as Joe, when unregistered users are involved.

-Pie


All times are GMT. The time now is 12:35 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.01043 seconds
  • Memory Usage 1,747KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete