This is the culmination of a small project for Destroy Entertainment, Warner Music Group and Rhino Entertainment.
Wed, February 15, 2006 - 12:22 PM permalink
I noticed it was difficult to get a grammatically correct display out of the comment count in MT. Especially for us folks who prefer to use dynamic publishing. :) For instance by default, the comment display will say "0 comments, 1 comments, 2 comments" which obviously is incorrect grammar. So what did I do about it? Basically, I wrote this super simple little php snippet which can be used by anyone in their MT installation to solve just this problem. This is especially pertinent to anyone using the dynamic publishing feature of MT, like me!
This will correctly display the comment count with a pluralized "comments" only when there is 2 or more comments, or more specifically - when there is only "1" comment, display nothing, and otherwise insert an "s" (after the word "comment").
I initially chose to use the MTIfNonZero tag to turn off the comment count if the number was zero. Now I realize that I could have done the whole thing in php but hey it works, so why mess with it...
So whats happening here is that the MTIfNonZero tag checks the comment count and displays the rest if the count is 0. The MTEntryCommentCount is then called and next is the word "comment". The php script is inserted immediately following to avoid any extra spaces and then checks to see if the count is "1" = display nothing, "else" = display "s". Make sense? Good.
originally published at isaachorton.liquidratio.com
A leader, a thinker, someone who tries to shape a convenient form which reflects his deepest feelings, his impressions, his thoughts. He is the soul creator influenced by his own state of mind and emotion.
Creativity is similar to life, full of surprises, filled with hope, confidence, glory and beauty. Creative forms of expressions are a long search after the unexpected and unexplored.
Dreams represent a fertile substrate for any vision or idea. Dreams are a virtual imagination spinning in everyones mind waiting for this day to come. This day when your imagination is turned from virtuality into reality.
Every creation, every design, every form and shape you see belongs to a visualization of your own dreams. Isaac's world is a world of dreams.
You are not connected to isaac josephwant to grow your network?