Hey guys,
I'm trying to make a piece of php code to make making the stats for this thread easier:
http://www.1stracing.nl/forum/viewtopic.php?t=100
As you can see in the thread above, I need Wins, 2nd's, 3rd's and Finished races for all our teammembers. The Excel sheet creates the rest of the stats (percentages and etc.). At the moment I'm just clicking my way through LFSW Online Racer Stats, but I think it takes way too much time
So that's where my very first php project started (see code on the bottom). Output should look like this (e.g.):
TraXXion 906 200 170 138
Scoop 685 106 123 82
Chriskart 1221 296 207 150
etc. etc.
But from the code below I get:
TraXXion 906 200 170 138
Scoop 906 200 170 138
Chriskart 906 200 170 138
etc. etc.
In other words, everyone gets my stats (the first requested) instead of their own. Would anybody know what I'm doing wrong here?
Thanks in advance for any help,
René
PS They are monthly stats so I will only run the parser once every month. It's not like I'm going to get all this data (and use LFSW bandwidth) every day.
I'm trying to make a piece of php code to make making the stats for this thread easier:
http://www.1stracing.nl/forum/viewtopic.php?t=100
As you can see in the thread above, I need Wins, 2nd's, 3rd's and Finished races for all our teammembers. The Excel sheet creates the rest of the stats (percentages and etc.). At the moment I'm just clicking my way through LFSW Online Racer Stats, but I think it takes way too much time
So that's where my very first php project started (see code on the bottom). Output should look like this (e.g.):
TraXXion 906 200 170 138
Scoop 685 106 123 82
Chriskart 1221 296 207 150
etc. etc.
But from the code below I get:
TraXXion 906 200 170 138
Scoop 906 200 170 138
Chriskart 906 200 170 138
etc. etc.
In other words, everyone gets my stats (the first requested) instead of their own. Would anybody know what I'm doing wrong here?
<?php
echo "<table class='moduletable' bgcolor='#EEEEEE' border='1' cellpadding='1' cellspacing='0' style='border-collapse: collapse' style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px'>";
$Titles = array("Meters","Fuel","Laps","Hosts joined","Wins","Second","Third","Finished","Quals","Pole","Online credits","Drags","Drag wins","Online","Hostname");
$i=0; $ii=0; $cnt=0;
$data = array();
$TeamMembers = array("traxxion","Scoop","Chriskart","kartboy","Geforcy","Thommm","auch_enne","AppiePils","Kenneth [NOR]","kaspur","Darkone55","XRRoy","Priitmek","lastpunisher");
$InGameName = array("TraXXion","Scoop","Chriskart","Kartboy","Geforcy","Thomm","SMOKE","Appie","Kenneth","Kaspur","Darkone","XRRoy","Priitmek","lastpunisher");
$TotalMembers = count($TeamMembers);
while ($cnt < $TotalMembers)
{
@$handle = fopen ("[URL]http://lfsworld.net/pubstat/get_stat2.php?action=pst&version=1.2&racer=$TeamMembers[/URL][$cnt]", "r");
while ($userinfo = @fscanf($handle, "%s"))
{
list ($data[$i]) = $userinfo;
if($i>3)
{
if($i<7)
{
$Podium[$ii]=$data[$i];
$ii++;
}
}
$i++;
}
$podiumplaces = $Podium[0] + $Podium[1] + $Podium[2];
echo "<tr><td>$InGameName[$cnt]</td><td>$data[7]</td><td>$Podium[0]</td><td>$Podium[1]</td><td>$Podium[2]</td></tr>";
@fclose($handle);
$cnt++;
sleep(10);
}
echo "</table>";
?>
Thanks in advance for any help,
René
PS They are monthly stats so I will only run the parser once every month. It's not like I'm going to get all this data (and use LFSW bandwidth) every day.