Textpattern Notes Part 3 is a post on The Hickensian

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!

The Hickensian is the journal of Jon Hicks, one half of the creative partnership Hicksdesign. See the work we do.

AD by FUSION

My Zoo

I use Zootool to collect the things I like on the web…

playlist

See more on last.fm

  • Villagers - Becoming A Jackal
  • Arcade Fire - The Suburbs
  • John Grant - Queen Of Denmark
  • School of Seven Bells - Disconnect From Desire
  • The New Pornographers - Together
  • Starflyer 59 - The Changing Of The Guard
  • The Divine Comedy - Bang Goes The Knighthood
  • Beach House - Teen Dream
  • Gorillaz - Plastic Beach
  • Mr B The Gentleman Rhymer - Flattery Not Included
  • Gonjasufi - A Sufi and a Killer
  • Grizzly Bear - Veckatimest
  • Kula Shaker - Pilgrims Progress
  • Matthew Sweet - In Reverse
  • Lemon Jelly - Lost Horizons

Contact

Hicksdesign

Island House

Lower High Street

Burford

Oxfordshire, UK

OX18 4RR

+44 (0)7917 391 536

Download vCard

Hicksmade. Unique handmade products made for machines, not by them