Textpattern Notes Part 3

24 Jun 2004

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!

Recent Posts

Using the iPad Pro as my main computer

07 Jan 2019

Hicks' top albums of 2018

22 Dec 2018

Hicks Studio Clearout!

17 Dec 2018

New Identity for iHasco

13 Nov 2018

Leigh and Jon did Inktober

01 Nov 2018

We are Oxvik

15 Oct 2018

The Hicks Logowall

05 Oct 2018

Hiding Away

16 Sep 2018

Biro sketch of Lauzerte

23 Aug 2018

Instagram Hickstagram

  • 13 Jan 2019

  • 05 Jan 2019

    Just tried the Vegan Sausage Roll from Greggs. Really good - nicer than the meat one, and the thought of Piers Morgan frothing at the mouth makes it even tastier

  • 30 Dec 2018

    Blackbird studies #ipadpro #procreate

  • 27 Dec 2018

    My special egg plinth from @maanthh. You have to say the name in the style of Matt Berry in the IT Crowd ✊

  • 26 Dec 2018

    This is my Pencil. There are many like it, but this one is mine. #applepencil

  • 25 Dec 2018

    Christmas reading πŸ€—

  • 24 Dec 2018

    Hope you all have a very Happy Christmas folks! πŸŽ„πŸŽ‰πŸΈ

  • 22 Dec 2018

    The moon tonight was full and large. Taken through a spotting scope with iPhone, hence a bit blurry

  • 21 Dec 2018

    It’s that time, here are my top 9 albums of 2019! 7 - Beach House Columbus (Original Motion Picture Soundtrack) - Hammock The Appearances - Ester Drang The Art of Pretending to Swim - Villagers Twenty Two in Blue - Sunflower Bean In Transit - The Amazing Vide Noir - Lord Huron Marauder - Interpol The Great Untold - Scott Matthews

  • 20 Dec 2018

    Another new music genre

Contact us

Call Jon on +44 (0)7917 391536, email or tweet @hicksdesign.

Alternatively, pop in for tea and cake at the studio…

Hicks
Wenrisc House
Meadow Court
Witney, OX28 6ER
United Kingdom