If you run the script on page.php, the URL will look like page.php?racer=juniox_dias and it will output details of your username.
<?php
php
include('lfsworldsdk.php');
print_r($SDK->get_pst('kantzorf'));
?>
<?php
php
include('lfsworldsdk.php');
function trackToName($trackCode) {
switch($trackCode[0]) {
case 0: $rtn = 'Blackwood ';
switch($trackCode[1]) {
case 0: $rtn .= 'GP Track'; break;
case 1: $rtn .= 'Rally Cross'; break;
case 2: $rtn .= 'Car Park'; break;
}
break;
case 1: $rtn = 'South City ';
switch($trackCode[1]) {
case 0: $rtn .= 'Classic'; break;
case 1: $rtn .= 'Sprint Track 1'; break;
case 2: $rtn .= 'Sprint Track 2'; break;
case 3: $rtn .= 'Long'; break;
case 4: $rtn .= 'Town Course'; break;
case 5: $rtn .= 'Chicane Route'; break;
}
break;
case 2: $rtn = 'Fern Bay ';
switch($trackCode[1]) {
case 0: $rtn .= 'Club'; break;
case 1: $rtn .= 'Green Track'; break;
case 2: $rtn .= 'Gold Track'; break;
case 3: $rtn .= 'Black Track'; break;
case 4: $rtn .= 'Rally Cross'; break;
case 5: $rtn .= 'RallyX Green'; break;
}
break;
case 3: $rtn = 'Autocross ';
switch($trackCode[1]) {
case 0: $rtn .= 'Autocross'; break;
case 1: $rtn .= 'Skid Pad'; break;
case 2: $rtn .= 'Drag Strip'; break;
case 3: $rtn .= '8 Lane Drag'; break;
}
break;
case 4: $rtn = 'Kyoto Ring ';
switch($trackCode[1]) {
case 0: $rtn .= 'Oval'; break;
case 1: $rtn .= 'National'; break;
case 2: $rtn .= 'GP Long'; break;
}
break;
case 5: $rtn = 'Westhill ';
switch($trackCode[1]) {
case 0: $rtn .= 'International'; break;
}
break;
case 6: $rtn = 'Aston ';
switch($trackCode[1]) {
case 0: $rtn .= 'Cadet'; break;
case 1: $rtn .= 'Club'; break;
case 2: $rtn .= 'National'; break;
case 3: $rtn .= 'Historic'; break;
case 4: $rtn .= 'Grand Prix'; break;
case 5: $rtn .= 'Grand Touring'; break;
case 6: $rtn .= 'North'; break;
}
break;
default: return 'Unknown Track';
}
if ($trackCode[2] === 1)
return "$rtn Reversed";
else
return $rtn;
}
<html>
<head>
<title>Page for echo $_GET['racer']; </title>
</head>
<body>
<table>
<tbody>
$pst = $SDK->get_pst($_GET['racer']);
forEach ($pst[0] as $key => $val):
<tr>
switch ($key):
case 'distance':
<th>Meters Driven</th>
<td>echo $val; </td>
break;
case 'fuel':
<th>Fuel burned in cl</th>
<td>echo $val; </td>
break;
case 'laps':
<th>Laps Driven</th>
<td>echo $val; </td>
break;
case 'joined':
<th>Hosts joined</th>
<td>echo $val; </td>
break;
case 'win':
<th>Race wins</th>
<td>echo $val; </td>
break;
case 'races_finished':
<th>Races finished</th>
<td>echo $val; </td>
break;
case 'qual':
<th>Qualifications</th>
<td>echo $val; </td>
break;
case 'pole':
<th>Pole positions</th>
<td>echo $val; </td>
break;
case 'dragwins':
<th>Drags won</th>
<td>echo $val; </td>
break;
case 'ostatus':
<th>Online status</th>
<td>php
switch ($val) {
case 0: echo 'Offline'; break;
case 1: echo 'Spectating'; break;
case 2: echo 'In pits'; break;
case 3: echo 'In race'; break;
}
</td>
break;
case 'last_time':
<th>Last active on</th>
<td>echo date('d-m-Y H:i', $val); </td>
break;
case 'track':
<th>Track</th>
<td>echo trackToName($val); </td>
break;
default:
<th>echo ucwords($key); </th>
<td>echo $val; </td>
endSwitch;
</tr>
php
endForEach;
</tbody>
</table>
</body>
</html>
?>