I added some code that will allow for people to use the subscription option to get email on new posts when they get submitted instead of the daily report.
Modify your addpost.php and goto
// ---------------------------------------------
// Update the total post if the post is Approved
if ($Approved == "yes") {
and add this code right above
code:
// Send an Email to the Subscribers if they are Subscribed to this board
if ($Approved == "yes") {
$query = "
SELECT U_Email,
U_Language
FROM w3t_Users
LEFT JOIN w3t_Subscribe ON U_Username = S_Username
WHERE S_Username = U_Username
AND S_Board = '$Board_q'
";
$sth = $dbh -> do_query($query);
while ( list($Mailto,$Language) = $dbh -> fetch_array($sth) ) {
// -------------------------------------------=
// We need to make sure this user still exists
if ($Mailto) {
// -----------------------------------------------------------------
// Now if this user has a pre-selected language we use that language
// for the message we send out
if (!$Language) { $Language = $config['language'];}
require "{$config['path']}/languages/$Language/addpost.php";
$EmailBody = $Body;
if ($config['stripcodes']) {
$EmailBody = preg_replace("/<([^>])*>/","",$EmailBody);
}
$newline = "\n";
if (stristr(PHP_OS,"win")) {
$newline = "\r\n";
}
$to = $Mailto;
$mailer = new mailer;
$header = $mailer -> headers();
$subject = "New Post To $Title from $postername";
$msg = "$postername has posted a message to $Title: $newline{$config['phpurl']}/showthreaded.php?Cat=$Cat&Board=$Board&Number=$Mnumber$newline${newline}------Message Below------${newline}Subject: $FormSubject${newline}${newline}Message:$newline$EmailBody";
mail("$to","$subject",$msg,$header);
// --------------------------------------------------
// Now, we need to switch back to this users language
$Language = $user['U_Language'];
if (!$Language) { $Language = $config['language']; }
require "{$config['path']}/languages/$Language/addpost.php";
}
}
}