Regarding the average number of messages and since I am really bad at deciphering the way dates are stored in the posts table, I managed to get something going here:
If you use the following query:
code: SELECT COUNT(*) / (DAYOFYEAR(NOW()) - DAYOFYEAR(FROM_UNIXTIME(MIN(B_Posted)))) As AveragePostsPerDay FROM w3t_posts
then this will return the average number of posts per day. Of course you need to add that query with the usual call to the database and the result to be passed in a local variable, which you will then use it in the shortstatspal.php to be displayed.
Major limitation (and it's my lack of knowledge to blame) is that it uses the DAYOFYEAR function which works for the current year. It works fine for me since my forum was created this year but I haven't found (yet) the way to find the difference in days between the first and last message. Also I have not run any metrics against it. My board has only 5000 messages so I don't know how this will affect others with 10 or 100 times as much messages.
Another workaround for a faster query (to get the COUNT() of messages) is to query the boards table. Alternatively for fastest access one needs to create a table with the date of the first post, the date of the last post and the message count. The last two fields can be updated when a post is made.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.