Play Nice

A word about the original writing found on this site

Unless otherwise noted, these are my words, ideas, thoughts and feelings. If you like them great, if you don't that's fine too.

You're welcome to quote my writing, but please make sure you include a link back to the page from which you got the material.

This work is licensed under a Creative Commons License.
Creative Commons License



[This is where the summary would go if I'd bothered to write one.]

« Week 44Saved »
Comments off code

I don’t do it very often, but every once in a while I don’t allow comments. Until today I couldn’t figure out how to have the words ‘Comments off’ show up whenever I turned comments off. This of course has been bugging me because, well, I’m that sort of goofy.

I finally leafed through the MT manual* and discovered the MTEntryFlag. Using this and a little PHP (the same PHP snippet I keep using the hell out of) I finally figured out how to accomplish this.

Just in case anyone is interested:

The actual value returned by the MTEntryFlag is commented out so it won’t show on the blog.

<!—<$MTEntryFlag flag=“allow_comments”$>—>
if (<$MTEntryFlag flag=“allow_comments”$> == 0) {
?>Comments off<? } ?>

This should go right before the MTComments code.

*Seriously, you’d think I’d be better about reading manuals and instructions. It really would save me a great deal of trouble.

Published 12/07/03 in Geek_Speak • | Views: 9575 times | Print

Post a comment

Commenting is not available in this blog entry.