By shoulders on Monday, 20 February 2017
Posted in Technical Issues
Likes 0
Views 516
Votes 0
Hi

I have got my RSFeedback Komento plugin all working but I cannot figure out how to get the comment count from Komento. I have seen the code somewhere but cannot remember where.

Is there any change you can give me the code or point me in the right direction. Sample code is preferable.

Thanks
That Komento:: class name is located at this file -> JoomlaFolder/administrator/components/com_komento/includes/komento.php

class KMT extends KT {}
class Komento extends KT {}

·
Wednesday, 22 February 2017 00:27
·
0 Likes
·
0 Votes
·
0 Comments
·
I think this is the right way to do things

I got the info from /administrator/components/com_komento/includes/komento.php line 1350


$commentsModel = KT::model('Comments'); // Create a Comments object
$commentCount = $commentsModel->getCount($component, $cid); // Return the Comment count


For RSFeedback it looks like:


require_once( JPATH_ROOT . '/components/com_komento/bootstrap.php' ); // this should be called to intialize Komento.
$commentsModel = KT::model('Comments'); // Create a Comments object
$comments = $commentsModel->getCount('com_rsfeedback', $id); // Return the Comment count


I hope this helps people. Basically create a comments object and then you can use all of the functions from komento.php to get data out.

If this is correct, it totally should be added to the integration page. Also that KT:: and Komento:: are interchangeable and why?

thanks
·
Tuesday, 21 February 2017 04:45
·
0 Likes
·
0 Votes
·
0 Comments
·
I am sorry for the delay of this reply,

Thanks for your sharing, I will report this to our documentation administrator to add this into the Komento documentation.

If i recall correctly from the older version of Komento, we used this Komento:: then after that we need to simplify all our product so now you can use KT:: or Komento:: now is because we can't remove this Komento:: is because it will break other 3rd party who integration with Komento.
·
Tuesday, 21 February 2017 11:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Just out of curiosity do you know where the class Komento:: is created, i found the class KT:: but could not find Komento::
·
Tuesday, 21 February 2017 17:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Awesome. I could not find these lol.

It all makes sense now and I will add this to my notes.

Thanks for going the extra mile.
·
Wednesday, 22 February 2017 06:34
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome.

As a gentle reminder, kindly start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiry. I will lock and mark this thread as resolved.
·
Wednesday, 22 February 2017 09:39
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post