Page 1 of 1

reading the number of comments for an entry by post number

Posted: Mon Aug 29, 2005 2:49 am
by jerwarren
I'm sorry to ask what is probably a really rudimentary question, but I've been searching and digging through code for a while unable to answer my question myself.

How does one go about reading the number of comments on an entry? The code I've managed to find walks through all the entries and reads the number of comments for each one, but what I am trying to do is fetch the number of comments if you only know the post number. I've been unable to find the correct usage for serendipity_fetchEntry, but I'm guessing that's what I would use. Is there a reference somewhere that shows the correct usage of all the different serendipity_functions?

Re: reading the number of comments for an entry by post numb

Posted: Mon Aug 29, 2005 2:48 pm
by garvinhicking
Actually each entry has the number of comments as a seperate column, so you don't need to make any more DB lookups or API calls.

The serendipity_fetchEntry() call returns the full array, check your $entry['comments'] field, which contains the number of comments. :-)

HTH,
Garvin