]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
only display comment count if there are comments
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 25 May 2010 16:40:24 +0000 (16:40 +0000)
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 25 May 2010 16:40:24 +0000 (16:40 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6208 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/blog/views/default/object/blog.php

index 02f74b95ea99ad351ab44d9988fc651651223956..eee8660548c2861f2d671d0d170472facc5838f0 100644 (file)
@@ -32,7 +32,12 @@ $date = friendly_time($blog->publish_date);
 // The "on" status changes for comments, so best to check for !Off
 if ($blog->comments_on != 'Off') {
        $comments_count = elgg_count_comments($blog);
-       $comments_link = "<a href=\"{$blog->getURL()}#annotations\">" . sprintf(elgg_echo("comments"), $comments_count) . '</a>';
+       //only display if there are commments
+       if($comments_count != 0){
+               $comments_link = "<a href=\"{$blog->getURL()}#annotations\">" . elgg_echo("comments") . " (". $comments_count .")</a>";
+       }else{
+               $comments_link = '';
+       }
 } else {
        $comments_link = '';
 }