By tomasgc on Monday, 11 March 2013
Posted in General Issues
Likes 0
Views 2.4K
Votes 0
Hi everyone, first i wanna say thanks for great module!

I wanna put comments count in main lastnews template, like this:
Comments: 12.

How can i do what?

I'm using joomla 2.5,k2 module and Komento module

Thanks for replaying!
Hi Jason,

Can you please share the code for manually calling comment count.

Basically i want to echo the comment count on top of Article (Through my template file).

regards
·
Wednesday, 19 November 2014 21:50
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Sunny,

You can use this code to get the count:

$commentsModel = Komento::getModel( 'comments' );
$commentCount = $commentsModel->getCount( $component, $cid ); // $component = com_content , $cid = the article id.


Hope this helps.
·
Thursday, 20 November 2014 00:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Nik,

I'll try that, and also can you pls guide on the way to echo the overall ratings.

regards
·
Thursday, 20 November 2014 13:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Sunny,

You can try this for rating:

$ratings = $commentsModel->getOverallRatings($component, $cid);
$totalRating = $ratings->value;
$totalRatingCount = $ratings->total;


Please give it a try.
·
Thursday, 20 November 2014 14:00
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post