forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Mannie_ on February 08, 2010, 11:02:40 am

Title: When there are no comments
Post by: Mannie_ on February 08, 2010, 11:02:40 am
Didn't know how to call the topic but i guess it describes my question.
I wanted to know how to make it so that when there are no comments it will say something like comments: 0 instead of just leaving that field blank when there are no comments.

Hope there is an easy way to do this

Thanks in advance
Mannie
Title: Re: When there are no comments
Post by: Mannie_ on February 08, 2010, 11:55:58 am
I have figured it out
i changed this
Code: [Select]
//comments nr
        if ($CONFIG['display_comment_count']) {
            $comments_nr = count_pic_comments($row['pid']);
            if ($comments_nr > 0) {
                //$$cap .= "<span class=\"thumb_num_comments\">".sprintf($lang_get_pic_data['n_comments'], $comments_nr )."</span>";
                $$cap .= "<span class=\"thumb_num_comments\">".sprintf($lang_get_pic_data['n_comments'], $comments_nr )."</span>";
            }
        }

To this

Code: [Select]
//comments nr
        if ($CONFIG['display_comment_count']) {
            $comments_nr = count_pic_comments($row['pid']);
            if ($comments_nr >= 0) {
                //$$cap .= "<span class=\"thumb_num_comments\">".sprintf($lang_get_pic_data['n_comments'], $comments_nr )."</span>";
                $$cap .= "<span class=\"thumb_num_comments\">".sprintf($lang_get_pic_data['n_comments'], $comments_nr )."</span>";
            }
        }

Might be handy if anyone else wanted to know this