Last comment posted by code snippet

For my MT pals... I've noticed that some commenting systems show the last person who posts a comment on an entry and, because I'm the nerdy, jealous type, I wanted that on the blog, so I figured out how to do that in MT.

Here's the code:

if (<$MTEntryCommentCount$> > 0) {
<MTComments sort_order="ascend" lastn="1"><$MTCommentAuthorLink spam_protect="1"$></MTComments> had the last word | <? } ?><a href="<$MTCGIPath$><$MTCommentScript$>?entry_id=<$MTEntryID$>" onclick="OpenComments(this.href); return false"><$MTEntryCommentCount$> </a>

Since it uses a little bit of php code I'm not sure if it will work with .html pages. If you try it and it works let me know.

Also if you're using any sort of comments plugin you'll want to change the code for the (<$MTEntryCommentCount$> > 0) part. I use Adam Kalsey's simplecomments plugin so my code is actually (<MTSimpleCommentCount> > 0).

patricia posted 138 words at 12:19 AM on September 10, 2003 º | Print