I have found on joomlatune.com code, which is responsible for displaying the number of comments.
- Code: Select all
global $mainframe;
$comments = $mainframe->getCfg('absolute_path'). '/components/com_jcomments/jcomments.php';
if (file_exists($comments)) {
require_once($comments);
$count = JComments::getCommentsCount($id, 'com_mycomp');
echo $count ? ('Comments('. $count . ')') : 'Add Comments';
}