A vivid imagination, often a good sign of a strong overall programmer.
<?php
final class WorldSDK extends LFS
{
/* Constants */
// Strings
# 0: Makes no change to the LFS mark'ed up strings.
const STRING_NONE = (1 << 0);
# 1: Changes player names only.
const STRING_NAMES = (1 << 1);
# 2: Changes host names only.
const STRING_HOSTS = (1 << 2);
# 3: Changes both player names and host names.
const STRING_BOTH = STRING_NAMES & STRING_HOSTS;
?>
static readonly string STRING_NONE = (1 << 0).ToString();
[B]Warning[/B]: Invalid error type specified in [B]lfsworldsdk.php[/B] on line [B]49[/B]
<?php
trigger_error('Your server\'s configuration is not supported by this version of LFSWorldSDK.', E_WARNING);
?>
<?php
$pst = $SDK->get_pst('juniox_dias');
?>
<?php if (empty($_GET['racer'])): ?>
<form target="_SELF" method="GET">
<lable for="racer">LFS Username:</lable><input type="textbox" id="racer" name="racer" /><br />
<input type="submit" value="Get Info" />
</form>
<?php
include('lfsworldsdk.php');
$racer = (empty($_GET['racer'])) ? 'juniox_dias' : urldecode($_GET['racer']);
<html>
<head>
<title>echo (empty($racer)) ? 'Please Input a Racer\'s Name' : 'Page for ' . htmlentities($racer, ENT_QUOTES); </title>
</head>
<body>
php if (empty($racer)):
<form target="_SELF" method="GET">
<label for="racer">LFS Username:</label><input type="textbox" id="racer" name="racer" /><br />
<input type="submit" value="Get Info" />
</form>
php else:
<table>
<tbody>
php $pst = $SDK->get_pst($racer);
forEach ($pst[0] as $key => $val):
<tr>
php switch ($key):
case 'distance':
<th>Meters Driven</th>
<td>echo $val; </td>
php break;
case 'fuel':
<th>Fuel burned in cl</th>
<td>echo $val; </td>
php break;
case 'laps':
<th>Laps Driven</th>
<td>echo $val; </td>
php break;
case 'joined':
<th>Hosts joined</th>
<td>echo $val; </td>
php break;
case 'win':
<th>Race wins</th>
<td>echo $val; </td>
php break;
case 'races_finished':
<th>Races finished</th>
<td>echo $val; </td>
php break;
case 'qual':
<th>Qualifications</th>
<td>echo $val; </td>
php break;
case 'pole':
<th>Pole positions</th>
<td>echo $val; </td>
php break;
case 'dragwins':
<th>Drags won</th>
<td>echo $val; </td>
php 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>
php break;
case 'hostname':
<th>Hostname</th>
<td>echo LFSWorldSDK::convert_lfs_text($val); </td>
php break;
case 'last_time':
<th>Last active on</th>
<td>echo date('M jS Y @ H:i', $val); </td>
php break;
case 'track':
<th>Track</th>
<td>echo LFSWorldSDK::convert_track_name($val); </td>
php break;
default:
<th>echo ucwords($key); </th>
<td>echo $val; </td>
php endSwitch;
</tr>
php endForEach;
</tbody>
</table>
php endIf;
</body>
</html>
?>
Hostname
[B]Fatal error[/B]: Call to undefined method LFSWorldSDK::convert_lfs_text() in [B]/home2/gridlfsc/public_html/forum/lfswsdk/get_pst2.php[/B] on line [B]70[/B]
<td><?php echo LFSWorldSDK::convert_lfs_text($val); ?></td>
function convert_lfsw_time($time) {
return sprintf('%d:%06.3F', floor($time / 60000), (($time % 60000) / 1000));
}