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
Bookmarks