PDA

View Full Version : How "Fast" Do Your Forums Go?


amykhar
03-20-2005, 10:00 PM
This silly little hack calculates the "velocity" of your forums measured in posts per hour.

It runs as a scheduled task once per hour. You can change how often it runs, but please remember that this one queries the post table which can make quite a hit on a large board.

NOTE: In velocity.php, I set the limit on the first query to avaluethatexceeds how many posts per day that my forum gets. Change this value to be higher than the number of posts you expect to get in aday,but make it reasonable.

How it looks is entirely up to you. Change the template to suit your needs. I kept mine simple for now. I'm sure you'll find more creative ways to display this data.

Deaths
03-21-2005, 07:40 PM
Nice hack, /me installs.

amykhar
03-21-2005, 07:45 PM
Deaths, you were too fast. Grab the install instructions again real quick. I didn't have the queries in that one.

Deaths
03-21-2005, 07:54 PM
Ok, heh.

Polo
03-21-2005, 09:01 PM
Nice...

nexialys
03-21-2005, 09:15 PM
when you're a maniac of stats, this hack is amazing!!! great idea!

lasto
03-21-2005, 10:15 PM
how many queries for this amy ?

accyroy
03-21-2005, 11:37 PM
Thanks for this, it shall look nice! :)

amykhar
03-21-2005, 11:38 PM
how many queries for this amy ?
It runs a maximum of two queries every time it runs. One to get the posts and then one to update the max velocity log if necessary. But, it runs as a cron job and can be scheduled to run hourly or daily. It's your choice.

accyroy
03-21-2005, 11:50 PM
OK, I've got it installed into a nice box under my users online... The first thing I've noticed we are missing is a timestamp from when the top velocity occured. That would be a nice addition amy. :)

amykhar
03-22-2005, 12:18 AM
It's in the scheduled task code and in the table, but I haven't written the code to change the format of it or put it in the datastore yet. That's on my to do list.

ericgtr
03-22-2005, 01:20 PM
when you're a maniac of stats, this hack is amazing!!! great idea!
I am and will install (click). I like this idea, however I think I will probably tweak it around and link it on the forumhome or forumdisplay so that when launched will give you a popup or something similar. Great idea, amykhar!

TheComputerGuy
03-22-2005, 02:49 PM
Amy is the best!

amykhar
04-15-2005, 01:43 AM
Amy is the best!
Awwww shucks :blush:

Reeve of shinra
04-15-2005, 02:22 AM
I was thinking this would be cool to show how each individual forum is stacking up against the others on your board.

WreckRman2
05-01-2005, 04:54 AM
Nice but do we really need all the numbers after the decimal? Why not change 4.2344045850 to just 4.2?

Find:


$velocity = $count/24; // This gives us average posts per hour.


Add below:


$velocity = number_format ($velocity, 2, '.', '');

Christine
05-15-2005, 06:11 PM
Nice!!

Thanks, Amy. :)

Ran the script once it was loaded and saw 47 posts per hour. On a Sunday afternoon. *faints*

* Christine clicks install

SnowBot
05-15-2005, 09:04 PM
Maybe a bit query hungry for me but nice job :)