Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: When there are no comments  (Read 2419 times)

0 Members and 1 Guest are viewing this topic.

Mannie_

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 51
When there are no comments
« 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
Logged

Mannie_

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 51
Re: When there are no comments
« Reply #1 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
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.