Topic: [Modification] Statistics with average values per month (Read 807 times)
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 7943
40607 credits Members referred : 3
« on: Sep 11, 2006, 08:07:23 PM »
This time I though to write this modification and this thread in the same time (otherwise I wouldn't remember later to post the modification )
This modification will display in the statistics of your forum, the dailly average registers, new topics and new posts that made in your forum for every month.
So let's start. The first file you have to modify is the /Sources/Stats.php
Find :
Code:
// Activity by month. $months_result = db_query(" SELECT YEAR(date) AS stats_year, MONTH(date) AS stats_month, SUM(hits) AS hits, SUM(registers) AS registers, SUM(topics) AS topics, SUM(posts) AS posts, MAX(mostOn) AS mostOn FROM {$db_prefix}log_activity GROUP BY stats_year, stats_month", __FILE__, __LINE__);
and replace it with :
Code:
// Activity by month. $months_result = db_query(" SELECT YEAR(date) AS stats_year, MONTH(date) AS stats_month, SUM(hits) AS hits, SUM(registers) AS registers, SUM(topics) AS topics, SUM(posts) AS posts, AVG(registers) AS registersAVG, AVG(topics) AS topicsAVG, AVG(posts) AS postsAVG, MAX(mostOn) AS mostOn FROM {$db_prefix}log_activity GROUP BY stats_year, stats_month", __FILE__, __LINE__);