ChurchMedia |
02-03-2003 08:24 AM |
Another great hack! :)
I have the "threadstarter" hack installed, which emails forum subscribers when new threads are started. I'm trying to implement your hack into that one. It goes into the newthread.php.
Here is what I added, along with a new template, but it doesn't seem to work. It just sends out plain text. See anything wrong?
PHP Code:
// Hack: Send email notification on subscribed forums
if ($enableemail and $visible) {
$tousers=$DB_site->query("SELECT user.username,user.email
FROM subscribeforum,user
WHERE subscribeforum.forumid='$forumid'
AND subscribeforum.userid=user.userid
AND user.userid<>'$bbuserinfo[userid]'");
$forumtitle=unhtmlspecialchars($foruminfo['title']);
$author=unhtmlspecialchars($bbuserinfo['username']);
$postsubject=unhtmlspecialchars($subject);
$postcontents=unhtmlspecialchars($message);
while ($touser=$DB_site->fetch_array($tousers)) {
$touser['username']=unhtmlspecialchars($touser['username']);
// Logician HTML mail hack
if ($touserinfo['htmltext']==0){
// user wants plain text messages
eval("\$emailmsg = \"".gettemplate("email_threadstarter",1,0)."\";");
eval("\$emailsubject = \"".gettemplate("emailsubject_threadstarter",1,0)."\";");
mail($touser['email'],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
}
else
//user wants HTML messages
{
eval("\$emailmsg = \"".gettemplate("email_threadstarter_html",1,0)."\";");
eval("\$emailsubject = \"".gettemplate("emailsubject_threadstarter",1,0)."\";");
mail($touser['email'],$emailsubject,$emailmsg,"From: \"$bbtitle \" <$webmasteremail>\nMIME-VERSION: 1.0\nCONTENT-TYPE: TEXT/HTML; CHARSET=iso-8859-9\nCONTENT-DISPOSITION: INLINE\n");
}
// Logician HTML mail hack
}
}
// End hack
I think I may have a } out of place...
|