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 get nr of comments ?
Pages: [1]   Go Down
  Print  
Author Topic: How to get nr of comments ?  (Read 2736 times)
0 Members and 1 Guest are viewing this topic.
google
Newbie
*

Karma: 0
Offline Offline

Posts: 1


Email
« on: July 01, 2009, 14:21:46 »

Hi, i need to get from the database the number of comments for every article, how do i do that ?

I tried this:

Code:
$query="SELECT count(id) FROM `#__jcomments` WHERE contentid='$id' AND published > 0 AND `option`='com_content' ";

         $db->setQuery($query);

         return (int) $db->loadResult();

but it doesn't seem to work. i'm new to this so I must be missing something simple or not Smiley


Other question is how do I remove the "read more" and nr of comments  automatically inserted when jcomments is enabled.

Thank you.
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: July 04, 2009, 19:41:50 »

Please read: How to display the comments count

Other question is how do I remove the "read more" and nr of comments  automatically inserted when jcomments is enabled.
at this time - only by editting JComments content plugin (see function for event onPrepareContent).
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 get nr of comments ?
 
Jump to: