Don't send reply-notifications to the user who posted the reply.

svn path=/trunk/boinc/; revision=6169
This commit is contained in:
Janus B. Kristensen 2005-05-16 08:09:37 +00:00
parent db77523307
commit f0cbe53a2a
3 changed files with 24 additions and 3 deletions

View File

@ -6646,3 +6646,15 @@ David 15 May 2005
client/
cs_scheduler.C
scheduler_op.C,h
Janus 16 May 2005
- Don't send reply-notifications in the forum to the user who posted the
reply, this just adds needless datatransfer for sending the mail and
later because the user will check if there actually was a reply...
html/
inc/
subsribe.inc
user/
forum_reply.php

View File

@ -67,8 +67,17 @@ function show_result_page($action, $success, $thread) {
}
function notify_subscribers($threadID) {
$sql = "SELECT DISTINCT * FROM subscriptions WHERE threadid = " . $threadID;
/**
* Notify everyone who has subscriped except the user object specified in the optional
* parameter $except_user.
**/
function notify_subscribers($threadID, $except_user=null) {
if ($except_user){
$extra = " and userid!=".intval($except_user->id);
} else {
$extra = "";
}
$sql = "SELECT DISTINCT * FROM subscriptions WHERE threadid = " . $threadID.$extra;
$result = mysql_query($sql);
while ($row = mysql_fetch_object($result)) {

View File

@ -85,7 +85,7 @@ if (!empty($_POST['content'])) {
}
replyToThread($thread_id, $logged_in_user->id, $_POST['content'], $parent_post, $add_signature);
notify_subscribers($thread_id);
notify_subscribers($thread_id, $logged_in_user); //Notify all subscribers except the user who posted (if the user has also subscribed)
header('Location: forum_thread.php?id='.$thread_id);
}