UPDATES EasyBlog 6.0.11 Released! Update to the latest version now!

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is online
Our support specialists is available now. We will attend to you as soon as we can.
  Support is online
Hi guys,
I need a suggestion.
I have inserted a "comments" link in my articles info block (where author, date, views etc. info is) along with the total comments number.
The problem is that if I disable Komento in a single article, the link still shows with an apparently random number of comments.

Here is the code I am using to show this link, if you could suggest a hack to hide the link (or at least show a default "0 comments" text) that would be great.
Thank you!

Here is the code I am using



<?php
// call Komento comment model
$commentsModel = KT::model('Comments');
$commentCount = $commentsModel->getTotal('com_content', $this->item->id);
?>


as you see below I show the comments link if the publish date is displaied, not a very elegant solution... works fine in many cases but not when Komento is disabled for a single article where the publish date is also disaplied


<?php if ($displayData['params']->get('show_publish_date')) : ?>
<?php echo $this->sublayout('publish_date', $displayData); ?>
<!-- Render Komento comments single article page -->
<dd>
<i class="fa fa-fw fa-comments-o"></i> <a href="#comments"><span class="commentCounter" data-kt-counter><?php echo $commentCount; ?> </span><?php echo JText::_('COM_KOMENTO_COMMENTS'); ?></a>
</dd>
<!-- Render Komento comments on single article page - end -->
<?php endif; ?>
The replies under this section are restricted to logged in users or users with an active subscription with us