Here is the updated code for the subscriptions. If you globally disable subscriptions it will not send an email out.
code:
// Send an Email to the Subscribers if they are Subscribed to this board
if (($Approved == "yes") && ($config['subscriptions'] == 1)){
$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";
}
}
}