XF 2.2 How to count posts per month

sleepyhead

Member
Hi,

I need to gather some data from my forum to show how many posts there are per month. I can't see how to do this, can anyone advise? I can see in the forum statistics that I can look at a chart of forum posts over a time period, but how do I get to the data behind the chart? I have plotted a chart of posts over a one year period, grouped by month, and it says that the 'Values represent daily averages within each time period' - does this mean that each monthly number shown is the average daily post count, or the post count for the whole month? Any advice would be much appreciated!
 

sleepyhead

Member
Yes


Did you expand the 'Raw Statistics' section, then multiple the value shown by the number of days in the month? That should give you a reasonable close stat for the total number of posts that month.
Thanks, I think that must be the only option so I'll do that. I was hoping for a quick way as i have a few different forums to do but I'll just get on with it! Thanks :)
 

Mouth

Well-known member
I was hoping for a quick way as i have a few different forums to do
SQL:
select year(from_unixtime(post_date)), month(from_unixtime(post_date)), count(post_id)
from xf_post
where message_state = 'visible'
group by year(from_unixtime(post_date)), month(from_unixtime(post_date));
 
Top