Textpattern Notes: Comments revisited

In Textpattern notes parts 2, and 4 I explained how to hack TXP’s comments system to acheive certain effects. A lot has changed since then (especially with v4.0), and I need to update the methods. I’m now running TXP with no hacks whatsoever, and that’s a very good feeling™.

So lets run through those old hacks:

Step 1,4 & 5 – Changing the preview method, and integrating live Textile previews

I didn’t like having to preview the comment on a separate page (although this is a good spam-saving measure). I wanted to give users a live preview and allow them to submit their comment straight away.
These steps are now all combined within one plugin: nhn_livecommentpreview

It’s worth pointing out, that even with this safety feature removed, I only get comment spam at the rate of 1 every couple of months.

Step 2 – changing the comments to display as <div>’s rather than <li>’s

Simple. Go to Admin > Preferences, and under the ‘Comments’ section. click no to “Present comments as a numbered list?”. You’re now free to wrap your comment markup in whatever takes your fancy.

Step 3 – alternating background colours and sequential numbering

These steps can still be done with php, but for an easier life, I use ajw_comment_num (Allows for outputting current comment number) and ajw_comment_alt 0.3 (Alternates output based on even- or odd-numbered comments) by Andrew Waer

Step 6 – Adding an article link to the notification email

Now in TXP as of 4.01!

See how much easier it all is? Thanks to all the TXP and plugin developers for making my life so much easier.

With the next Textpattern notes, I’m going to look at some of the new tag goodness, especially the new conditional tags…