OK, here is how you do this. Before you modify any scripts, read the disclaimer at the top of the files. Also remember to do a backup of all files before changing anything.
First add this line to languages/deletepost.php:
<pre>$ubbt_lang['DELETED_THIS'] = "deleted the following post:";</pre>
Add this to your config.inc.php file (and change AdminName to the username who is going to recieve the mail, leave it empty to not send any mail at all):
<pre>
$config['mailondelete'] = "AdminName";
</pre>
Open the file deletepost.php and do the following.
First, find this line:
<pre>
$user = $userob -> authenticate();
</pre>
And change it to this:
<pre>
$user = $userob -> authenticate("U_Language");
</pre>
Now find these lines:
<pre>
$html -> send_header($ubbt_lang['POST_DEL_HEAD'],$Cat,"<meta http-equiv=\"Refresh\" content=\"5;url={$config['phpurl']}/postlist.php?Cat=$Cat&Board=$Board&page=$page&view=$view&sb=$sb&o=$o\" />",$user);
</pre>
And add these lines ABOVE:
<pre>
// ------------------------------------
// Send an email about the deleted post
if ($config['mailondelete']) {
$MailUser_q = addslashes($config['mailondelete']);
$query = "
SELECT U_Email,
U_Language
FROM w3t_Users
WHERE U_Username = '$MailUser_q'
";
$sth = $dbh -> do_query($query);
list($Mailto,$Language) = $dbh -> fetch_array($sth);
// -----------------------------------------------------------------
// 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/deletepost.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 = $ubbt_lang['POST_DEL_HEAD'];
$msg = "$Username {$ubbt_lang['DELETED_THIS']}$newline{$ubbt_lang['POSTER_TEXT']}: $Postedby$newline{$ubbt_lang['SUBJECT_TEXT']}: $Subject$newline$Body";
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/deletepost.php";
}
</pre>
/Gardener
www.rollspel.nu