Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    General discussion    Topic: How to add number of comments in content view?
Pages: [1]   Go Down
  Print  
Author Topic: How to add number of comments in content view?  (Read 966 times)
0 Members and 2 Guests are viewing this topic.
lorz
Newbie
*

Karma: 0
Offline Offline

Posts: 11


« on: November 06, 2010, 08:20:41 »

Hi all,
thanks for the great job u've done and u will do for the community. I have one problem. I wanna add the number of comments in content view but i can not find how to do this. I found the way in developper guide to add this number near the title of the content in content view. But i would like to have this near the comment list, in fact near comment text (the title above the list)..
Can you help please?

Thanks for all
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: November 08, 2010, 16:13:15 »

You need to open file /components/com_jcomments/tpl/default/tpl_list.php (or tpl_tree.php if you're using treeview lauout) and replace:

Code: (php)
function getHeader()
{
$object_id = $this->getVar('comment-object_id');
$object_group = $this->getVar('comment-object_group');

$btnRSS = '';
$btnRefresh = '';

if ($this->getVar('comments-refresh', 1) == 1) {
$btnRefresh = '<a class="refresh" href="#" title="'.JText::_('Refresh').'" onclick="jcomments.showPage('.$object_id.',\''. $object_group . '\',0);return false;">&nbsp;</a>';
}

if ($this->getVar('comments-rss') == 1) {
$link = $this->getVar('rssurl');
$btnRSS = '<a class="rss" href="'.$link.'" title="'.JText::_('RSS').'" target="_blank">&nbsp;</a>';
}
?>
<h4><?php echo JText::_('Comments'); ?><?php echo $btnRSS?><?php echo $btnRefresh?></h4>
<?php
}
with

Code: (php)
function getHeader()
{
$object_id = $this->getVar('comment-object_id');
$object_group = $this->getVar('comment-object_group');
$commentsCount = $this->getVar('comments-count');

$btnRSS = '';
$btnRefresh = '';

if ($this->getVar('comments-refresh', 1) == 1) {
$btnRefresh = '<a class="refresh" href="#" title="'.JText::_('Refresh').'" onclick="jcomments.showPage('.$object_id.',\''. $object_group . '\',0);return false;">&nbsp;</a>';
}

if ($this->getVar('comments-rss') == 1) {
$link = $this->getVar('rssurl');
$btnRSS = '<a class="rss" href="'.$link.'" title="'.JText::_('RSS').'" target="_blank">&nbsp;</a>';
}
?>
<h4><?php echo JText::_('Comments') . ' (' $commentsCount ')'?><?php echo $btnRSS?><?php echo $btnRefresh?></h4>
<?php
}
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: How to add number of comments in content view?
 
Jump to: