Can't tell for sure because I don't have test data to play with but I think this will give you a count of all the node types that are forum and then add a count of all the comments ... That way you get an accurate count even if the original post doesn't have any comments.

SELECT count(*)
FROM node n
LEFT JOIN comments c 
ON n.nid=c.nid
WHERE n.type='forum'

On 4/12/07, Morten Holmstrup <morten@holmstrups.dk> wrote:
Hi,

I'm trying to put together a block that shows "forum statistics" like
the ones that typically come with phpbb forums and so on. You know,
things like "currently active users", "number of threads", "number of
posts".

Now, I think I have most of them down now - using a few snippets here
and there - but I'm still missing a way to display the complete number
of posts in the forums. The trouble is that replies are in reality
comments, and how do you count the comments that are restricted to the
forums? This is a small feature, I admit, but I'm weird that way ;)

Please correct me, if I'm way off - this is my first site with Drupal
(ammenet.dk).

Anyone know, how to accomplish this or just point me in the right
direction?

(I tried the drupal.org forums, but haven't gotten any replies yet, so I
thought I'd try here)

thanks!
Morten

--
[ Drupal support list | http://lists.drupal.org/ ]



--

Kevin Bridges
http://www.kevinbridges.org/