Log in

View Full Version : Batting Average for Baseball Type Forums


Ryan Ashbrook
05-21-2004, 10:00 PM
This was requested by MLBCenter at vBulletinTemplates.

Basically, this hack averages in Post Count, Posts Per Day, and Join Time and gives an average at one thousandth of a decimal.

So it will display an average like this: .203 on both the memberinfo and postbit pages.

I hope you enjoy this hack. :)

Credits:

Boofo - Helping fix the code. Thanks a lot!

MLBCenter - For letting me develop this hack on his live forums. :)

The textfile will constantly be changing, so if you get abnormal averages either report them to me in this thread, or re-do the codes, because posts per day is a tough one to work with, since the posts per day can be very weird on a user by user basis.

xQuEeNzNaZcHox
05-23-2004, 01:57 AM
Can I see some screens? It's very interesting looking.

MLBCenter
05-23-2004, 02:29 AM
I'm getting an error now...

http://forums.mlbcenter.com/member.php?u=2676

Ryan Ashbrook
05-23-2004, 02:27 PM
Screenshots attached to first post.

Ryan Ashbrook
05-23-2004, 04:14 PM
Ok, it's been determined that this hack needs work, or there is no definate way to actually do this.

Code optimized, and totally fixed. :)

Boofo
05-23-2004, 10:28 PM
Congratulations on your second vB3 hack, Ryan. ;)

I think I'll use this. Great idea. Thank you, sir. ;)

Ryan Ashbrook
05-24-2004, 12:20 AM
You're welcome Boofo. :)

Remember about my note in the first post though. The code will always be changing, so be on the lookout. ;)

JCJiffy
05-24-2004, 05:32 AM
The algorithm you're using doesn't make sense at all. Users on my forums with extremely high post counts end up having way lower batting averages than those with very low post counts. Join dates are the same.

Boofo
05-24-2004, 05:39 AM
The algorithm you're using doesn't make sense at all. Users on my forums with extremely high post counts end up having way lower batting averages than those with very low post counts. Join dates are the same.
But rememeber that the batting average is based on posts per day, not total post counts. ;)

JCJiffy
05-24-2004, 05:45 AM
But rememeber that the batting average is based on posts per day, not total post counts. ;)
Posts per day is based off total post counts and the join date.

Boofo
05-24-2004, 05:57 AM
Posts per day is based off total post counts and the join date.
Right. So if you have a new user that is posting alot (as new users often do) and a user that has been there a while but not posted in a while, then the new user will have a higher batting average than the user with a big post count. That is how this should work. ;)

JCJiffy
05-24-2004, 06:03 AM
Right. So if you have a new user that is posting alot (as new users often do) and a user that has been there a while but not posted in a while, then the new user will have a higher batting average than the user with a big post count. That is how this should work. ;)
And to quote myself from above:

Join dates are the same.

In other words, I am noticing that people with higher post counts AND higher posts per day are getting lower batting averages.

Ryan Ashbrook
05-24-2004, 10:46 PM
Well, the thing about the equations is I couldn't get it to work without putting it like it is.

I'm not the best PHP coder in the world, since I've only released three hacks, and they're all basic ones.

MLBCenter
05-25-2004, 12:35 AM
If anyone else can help that would be great...

Strike Three
06-21-2004, 06:35 PM
Here's an idea, for an all-sports forum - give users the choice between batting average [baseball fans], QB passer rating [football fans], shooting percentage [basketball fans or hockey fans]. If you want to give this a try and would like to test it on my site, shoot me an email - chris@thesportsfans.com.

Strike Three
07-02-2004, 02:22 AM
I installed this on my site, but for some reason the batting average shows up at 0.000 for anyone with 3.xx posts per day (or more?).

Ex - http://www.thesportsfans.com/forums/member.php?u=10, http://www.thesportsfans.com/forums/member.php?u=11

MLBCenter
07-05-2004, 02:38 AM
There are some flaws in the BA system here - which is why we created our own way on getting a realistic batting average for all members.

Boofo
07-05-2004, 05:26 AM
There are some flaws in the BA system here - which is why we created our own way on getting a realistic batting average for all members.
Would you care to share? ;)