10 Sep 2010
Support Center
»
Knowledgebase
»
Display number of comments
Display number of comments
Article
We have a function named
countComments( $id )
which accepts one optional parameter - ID of the article being commented. Leave it as null to use already defined $id in $comments object, or path of current PHP page. Default: null (recommended for most users)
You can call this function from $comments object, something like this:
$comments->countComments($id);
The function returns value which can be assigned to PHP variable or printed on screen, so your code may look something like this:
-------[ code ]---------------------------------------
<?php
printf('Total: %1$d comment(s)', $comments->countComments());
?>
-------[ code ]---------------------------------------
Article Details
Article ID:
5
Created On:
02 Dec 2009 11:35 PM
This article was helpful
This article was not helpful
User Comments
Add a Comment
If you would like to comment on this entry, please use the form below. Comments may be queued for moderation, and will not be published until approved.
Image verification required
Please enter the characters that appear to the right in the space provided. This is just to verify that you are a human.
Full Name:
E-mail Address: (optional)
Comment:
Back
Log in
Username:
Password:
Remember Me:
Search
-- Entire Support Site --
Knowledgebase
Downloads
Troubleshooter
Article Options
Add Comment
Print Article
PDF Version
E-mail Article
Add to Favorites
Home
|
Knowledgebase
|
Troubleshooter
|
News
|
Downloads
Language:
English (U.S.)
Helpdesk Software by Kayako SupportSuite v3.50.06