[Jaws-commits] r13305 - trunk/jaws/html/gadgets/Blog

afz at jaws-project.com afz at jaws-project.com
Tue Aug 7 06:44:10 UTC 2012


Author: afz
Date: 2012-08-07 06:44:10 +0000 (Tue, 07 Aug 2012)
New Revision: 13305

Modified:
   trunk/jaws/html/gadgets/Blog/HTML.php
Log:
show no comment message instead of 0 comments

Modified: trunk/jaws/html/gadgets/Blog/HTML.php
===================================================================
--- trunk/jaws/html/gadgets/Blog/HTML.php	2012-08-06 21:26:51 UTC (rev 13304)
+++ trunk/jaws/html/gadgets/Blog/HTML.php	2012-08-07 06:44:10 UTC (rev 13305)
@@ -609,7 +609,7 @@
             $tpl_block = $commentLink? 'comment-link' : 'comments-statistic';
             $tpl->SetBlock("entry/$tpl_block");
             $tpl->SetVariable('url', $perm_url);
-            if ($commentLink && $entry['comments'] == '0') {
+            if ($commentLink && empty($entry['comments'])) {
                 $tpl->SetVariable('text_comments', _t('BLOG_NO_COMMENT'));
             } else {
                 $tpl->SetVariable('text_comments', _t('BLOG_HAS_N_COMMENTS', $entry['comments']));
@@ -1213,7 +1213,11 @@
                 $tpl->SetVariable('date-year',      $year);
                 $tpl->SetVariable('date-time',      $date->Format($entry['publishtime'], 'g:ia'));
                 $tpl->SetVariable('title', $entry['title']);
-                $tpl->SetVariable('comments', $entry['comments']);
+                if (empty($entry['comments'])) {
+                    $tpl->SetVariable('comments', _t('BLOG_NO_COMMENT'));
+                } else {
+                    $tpl->SetVariable('comments', _t('BLOG_HAS_N_COMMENTS', $entry['comments']));
+                }
 
                 $id = !empty($entry['fast_url']) ? $entry['fast_url'] : $entry['id'];
                 $url = $GLOBALS['app']->Map->GetURLFor('Blog', 'SingleView', array('id' => $id));



More information about the Jaws-commits mailing list