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 display number of user's comment?
Pages: [1]   Go Down
  Print  
Author Topic: How to display number of user's comment?  (Read 651 times)
0 Members and 2 Guests are viewing this topic.
johnny
Newbie
*

Karma: 0
Offline Offline

Posts: 6


negdelteam
« on: November 05, 2011, 16:24:14 »

Hi there,
I'm using JComment v2.2.0.2 and Jomsocial 1.6.290.
Can I display number of Jomsocial user's comment?
 Huh

Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: November 07, 2011, 17:04:59 »

1. Open /components/com_jcomments/tpl/default/tpl_comment.php
2. Find code:
Code: (php)
<span class="comment-date"><?php echo JCommentsText::formatDate($comment->datetimeJText::_('DATETIME_FORMAT')); ?></span>
insert after:
Code: (php)
<?php
$user 
=& JFactory::getUser();
if (
$user->id) {
    
$db =& JFactory::getDBO();
    
$db->setQuery('SELECT COUNT(*) FROM #__jcomments WHERE userid = ' $user->id);
    
$count $db->loadResult();
    echo 
JText::_('Posts:') . $count;
}
?>
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
johnny
Newbie
*

Karma: 0
Offline Offline

Posts: 6


negdelteam
« Reply #2 on: November 07, 2011, 17:20:35 »

Hi there,

Thanks for your help! It's working 100%  Smiley tnx tnx tnx Smiley
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: How to display number of user's comment?
 
Jump to: