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.<br>
<br>SELECT count(*)<br>
FROM node n <br>
LEFT JOIN comments c <br>
ON n.nid=c.nid <br>
WHERE n.type='forum' <br><br><div><span class="gmail_quote">On 4/12/07, <b class="gmail_sendername">Morten Holmstrup</b> <<a href="mailto:morten@holmstrups.dk">morten@holmstrups.dk</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I'm trying to put together a block that shows "forum statistics" like<br>the ones that typically come with phpbb forums and so on. You know,<br>things like "currently active users", "number of threads", "number of
<br>posts".<br><br>Now, I think I have most of them down now - using a few snippets here<br>and there - but I'm still missing a way to display the complete number<br>of posts in the forums. The trouble is that replies are in reality
<br>comments, and how do you count the comments that are restricted to the<br>forums? This is a small feature, I admit, but I'm weird that way ;)<br><br>Please correct me, if I'm way off - this is my first site with Drupal
<br>(<a href="http://ammenet.dk">ammenet.dk</a>).<br><br>Anyone know, how to accomplish this or just point me in the right<br>direction?<br><br>(I tried the <a href="http://drupal.org">drupal.org</a> forums, but haven't gotten any replies yet, so I
<br>thought I'd try here)<br><br>thanks!<br>Morten<br><br>--<br>[ Drupal support list | <a href="http://lists.drupal.org/">http://lists.drupal.org/</a> ]<br></blockquote></div><br><br clear="all"><br>-- <br><br>Kevin Bridges
<br><a href="http://www.kevinbridges.org/">http://www.kevinbridges.org/</a>