View Full Version : Formula 1 Style Stats.
Dygear
5th April 2006, 00:38
All work is provided 'as is' with no warranties of any kind. So if this messes up your computer in any way, its not my fult.
I think by now most of you have seen the screen shot of a web browser with what looks like Formula 1 Style Stats. I had said that I would not release the stats untill the LFS : F1 seasion was over. Well, even tho the LFS : F1 race year is not over quite yet, I though I would release to you all my working version. So here it is.
http://thenz.org/PHP/F1SS/
http://thenz.org/PHP/F1SS.zip
The first link is to the working version that is on my server. The second is to the zip file where you can all download a copy of the code. Now I did not metion this, but to use this file, you need to edit the /F1SS/Stats/F1_db.php file to include the races in your events. This is based on a championship system and as such, the files reflect that. This is stricly for use in Live For Speed : Formula 1. But you are all free to edit the files for use in your own events. I included the PSD file for the guys who would like to go about editing the theme, if you have a good one, please share it on here, I am sure we would all love to see it. Enjoy guys.
mkinnov8
5th April 2006, 02:02
Thank you for this script, I will enjoy having a play :thumb:
Dygear
5th April 2006, 03:12
I am going to add things like a stats page for each driver. But that will be in the next version. In the version after that, I want to put in a program that will use insim to get information live from the server and display it like they do in the live timing stuff they have on the Formula1 website ... baby steps tho, baby steps.
IcYX
5th April 2006, 14:02
Oh, yeah...that look very good...i try it out, thx ;)
Dygear
9th April 2006, 23:55
I am readying the next release, but first, I need to know of a way to get a time that has been converted down to thousandths of a second, back up to it's fully quilifed string.
For example, 2:47.39 is equal to 1673900 when converted down, but I want to get the 2:47.39 it is equal too, any one want to give this one a shot?
Well, I have the hole miliseconds part down ... I think ...
$Miliseconds = ( $time % 10000 ) / 10;
filur
10th April 2006, 00:37
I am reading the next release, but first, I need to know of a way to get a time that has been converted down to hundredths of a second, back up to it's fully quilifed string.
For example, 2:47.39 is equal to 1673900 when converted down, but I want to get the 2:47.39 it is equal too, any one want to give this one a shot?
I think i use this, passing time as an integer (100ths).
function unpack_time($time) {
$secs = floor($time / 100);
$time = $time - floor($secs * 100);
if ($time < 10)
$time = "0$time";
$ret = @date("i:s",$secs).".$time";
return preg_replace("/^00:/","",$ret);
}
Minutes and seconds grabbed with date using amount of full seconds as an offset (timestamp) from unix epoch (00:00:00), and stitch on the 100ths.
Dygear
10th April 2006, 00:59
Thanks, trying it now. ... Ah, that did not work. I get things like
24:04.00 19:03.00 38:19.00 in lap one times ... makes no sense.
Oh well back to the drawing boards, and hopes that wikipeida gets back working so I can learn how to use moduls math.
filur
10th April 2006, 01:07
Thanks, trying it now. ... Ah, that did not work. I get things like
24:04.00 19:03.00 38:19.00 in lap one times ... makes no sense.
Oh well back to the drawing boards, and hopes that wikipeida gets back working so I can learn how to use moduls math.
Hm, i think the problem is your integer times aren't in 100ths/second, they're in 10000ths/second. :)
function unpack_time($time) {
$secs = floor($time / 100);
$time = $time - floor($secs * 100);
if ($time < 10)
$time = "0$time";
$ret = @date("i:s",$secs).".$time";
return preg_replace("/^00:/","",$ret);
}
function pack_time($m,$s,$h) {
return ($m * 6000) + ($s * 100) + $h;
}
$time = pack_time(2,47,39);
echo $time."\n";
echo unpack_time($time)."\n";
inCogNito
10th April 2006, 05:46
the links don't work
Dygear
10th April 2006, 06:12
the links don't work
Updated the links to point to my persional website.
Also, I will release an update for this soon, that will have improved linux support, and the use of split times, as soon as I get the times to unpack themselfs.
Dygear
12th April 2006, 05:32
Updated, works well on linux servers now :).
[edit] Update to splits.php that has been added for all of you :).
mkinnov8
29th April 2006, 14:47
Hi,
Two things, wondered if there is any update to this script? and also if you could post it on the forums please, the links... send me to a page hosting screen from godaddy.com
Cheers
PS lost the script after an unscheduled reformat.
Thanks :thumb:
Dygear
29th April 2006, 23:50
Yea, I had to change my DNS server name back to godaddy after I went over my bandwith by 110GBs. I'll have the script back up in around 10 days, or I'll host it off SimFIA.com. As for updates to the script, non quite yet, just some track stuff, that I am adding, as seen on the SimFIA.com website.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.