Hicks

Textpattern Notes Part 3

Here is a way to prevent you receiving an email notification of your own comments. Go to the end of the /textpattern/publish/comment.php file, and find this code:

$out = "Dear $RealName,\r\n\r\nA comment on your post on your post 
\"$Title\" was recorded.\r\n\r\nName: $cname\r\nEmail: $cemail\r\nWeb: 
$cweb\r\nComment:\r\n$message";
		mail($email, "[$sitename] comment received: $Title", $out,
		 "From: $RealName <$email>\r\n"
		."Reply-To: $cname <$cemail>\r\n"
		."X-Mailer: Textpattern\r\n"
		."Content-Transfer-Encoding: 8bit\r\n"
		."Content-Type: text/plain; charset=\"UTF-8\"\r\n");
	}

Change to this:

if ($cemail != $email) {
$out = "A comment on your post on your post \"$Title\" was recorded.
\r\n\r\nName: $cname\r\nEmail: $cemail\r\nWeb: $cweb\r\nComment:\r\n$message";
		mail($email, "[$sitename] comment received: $Title", $out,
		 "From: $cname <$email>\r\n"
		."Reply-To: $cname <$cemail>\r\n"
		."X-Mailer: Textpattern\r\n"
		."Content-Transfer-Encoding: 8bit\r\n"
		."Content-Type: text/plain; charset=\"UTF-8\"\r\n");
	}
}

This then only sends an email if the commenters email isn't the same as your email. I also changed it so that when the email comes in, the 'from' is the commenters name, not your own!