Version: , by chrispadfield
Developer Last Online: Oct 2008
Version: 2.2.x
Rating:
Released: 05-29-2001
Last Update: Never
Installs: 7
No support by the author.
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]'
");
$bbuserinfo['username']=unhtmlspecialchars($bbuserinfo['username']);
while ($touser=$DB_site->fetch_array($useremails)) {
$touser['username']=unhtmlspecialchars($touser['username']);
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
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
// send email to moderators
if ($enableemail) {
$moderators=$DB_site->query_first("SELECT CONCAT(newthreademail,' ',newpostemail) AS newthreademail FROM forum WHERE forumid='$forumid'");
$modtable=$DB_site->query("SELECT DISTINCT user.email FROM moderator,user WHERE moderator.userid=user.userid AND forumid IN ($foruminfo[parentlist]) AND (newthreademail=1 OR newpostemail=1)");
while($thismod=$DB_site->fetch_array($modtable)) {
$moderators['newthreademail'].=" $thismod[email]";
}
if ($moderators['newthreademail']!="") {
$mods=explode(" ",trim($moderators['newthreademail']));
while (list($key,$val)=each($mods)) {
if (trim($val)!="") {
$toemail=$val;
$forumtitle = $foruminfo['title'];
$threadinfo['title'] = $subject;
not quite sure how that will help as that edits the subject of the email not where it is from. Unless you have a linebreak in the subject template, that might make it not work.
Originally posted by WizyWyg Hi can someone repost the code in its entirety with all the corrections. looking through the coding and this site is somewhat driving me cross eyed