I finally got it working in a big roundabout way.
I have a template override for com_content, so in category-blog view I simply added the link:
//comment-link is not outputted on 'afterDisplayContent'
//so added link myself
echo $this->item->event->afterDisplayContent;
//link to comments
//get db
$db = JFactory::getDBO();
//get number of comments
$item_id = $this->item->id;
$query = "SELECT id "
."FROM jos_comment "
."WHERE contentid = $item_id "
."AND published='1' "
;
$db->setQuery($query);
$rows_comments = $db->loadObjectList();
$number_comments = count($rows_comments);
echo '<p>';
//if(defined($this->item->readmore_link)){
//$read_more_url = $this->item->readmore_link;
//}else{
$read_more_url = 'index.php?option=com_content&view=article&id='.$this->item->id.':'.$this->item->alias.'&catid='.$this->item->catid.'&Itemid='.intval(JRequest::getVar('Itemid', ''));
//}
echo '<a href="'.$read_more_url.'#JOSC_TOP">';
echo '('.$number_comments.')';
echo ' comment';
if($number_comments!=1){
echo 's';
}
echo '</a>';
echo '</p>';
then to get the comments under the article in full article-view, I hacked the plugin code.
version:
4.0.0
file:
plugins/content/joscomment.php
line:
42
$mainframe->registerEvent(($joscbotfunc ? $joscbotfunc : 'onPrepareContent'), $joscplugin);
change to:
if(JRequest::getVar('view', '')=='article'){
$mainframe->registerEvent('onAfterDisplayContent', 'pluginJosCommentJ15_UseReturn');
}
unset($joscommentconfig);
Everything works now. Wonderfull plugin!