Comment or commentS ?

Topics: Enhanced Blog Edition
Aug 25, 2008 at 1:07 AM

Just a bit problem, and try to let the people be aware of that.

In PostList.xsl, a comparison operator "!=" is used for the term "1" from a test statement in order to write out "Comments" instead of "Comment" when there are comments existed for any post. However, the predicate for the test statement isn't correct in a case of zero comment; it writes out "Comments." 

This was found in Widelife theme at line# 125 and line# 129 in PostList.xsl.

line 125: 
    <xsl:value-of select="NumComments" /> Comment<xsl:if test="NumComments !=1">s</xsl:if>

line 129:
    <xsl:value-of select="NumLinkbacks" /> Comment<xsl:if test="NumLinkbacks !=1">s</xsl:if> to this post

The statement is goint to test whether the number of comment is larger than 1 or not; if it has one commnet, not zero comment, writes COMMENT. To  make the statement work correctly, change "!=" to "&gt;".

-----------> change the comparison operator != to &gt;
Aug 26, 2008 at 12:19 AM
Nice catch!  You should post this to the issues tracker, as well.

Mike Sharp
Aug 26, 2008 at 3:37 AM

Thanks Mike!

Some people may feel that the term of zero commentS sounds OK. So, it looks like that is just a personal preference...


Have a good night!

- James Zheng