The online racing simulator
Searching in All forums
(569 results)
misiek08
S3 licensed
Sorry for OffTopic but explain me it: If I pay 3 pounds I'll have 200slots and I can upload, reupload and delete unlimited times?
misiek08
S3 licensed
@Victor - and why only 50 skins? You don't have enough space to keep our skins?
misiek08
S3 licensed
79.186.250.239
From this, it's working.
Lights and InSim
misiek08
S3 licensed
Its my little suggestion to add lights Flag to PlayerFlags. It will be good for cruise server to fine drivers not using lights in car.
misiek08
S3 licensed
I tried from few IP. I have dynamic IP.
misiek08
S3 licensed
I cant find it and join it
misiek08
S3 licensed
In the hosts.ini file you can define hosts Flags. Dygear said in 0.3.4 Flags= setting will work.
misiek08
S3 licensed
DISQ - impossible? DT + SG - I think they can't be together once.
misiek08
S3 licensed
Good to see my code used in official release. Great work! Thanks.
misiek08
S3 licensed
Not public.
LFS Hosting - experiment
misiek08
S3 licensed
Delete this post please.
Last edited by misiek08, .
misiek08
S3 licensed
I didn't have time so I did code below in few minutes. I hope someone will finish it.

<?php 
$rid_string 
'AND ( ';
for(
$s 1$s < ($numServers 1); $s++){
    
$name 'manualIdServer' $s;
    if(${
$name}){
        
$race_id = ${$name};
    }
    else{
        
$r_res = ...;
        
$race_id = ......;
        if(
$serverCrash){
        
// >=
        
}
        else{
            ...
        }
}
?>

It needs to get code from actual version and copy it to my loop.
misiek08
S3 licensed
I will remake it as loop today evening. I think it will be done to 22:00 Europe/Warsaw Time.
misiek08
S3 licensed
Missing racecontrol.html file from link "A listing of all server events". Maybe there are some more files missing. I found this now.

Description of Championship information is wrong.

Can you explain how to add more than 3 servers? That's are things that I think that should be fixed in docs.
Last edited by misiek08, .
misiek08
S3 licensed
Thanks. My dreams are: noone is asking for anything about it. That are only dreams.
misiek08
S3 licensed
Quote from boothy :Hopefully very soon, i.e. before the end of the month

Early march....
misiek08
S3 licensed
You can add small function to remove button from screen and add to createButton an timer.
misiek08
S3 licensed
Why not apt-get/aptitude install wine ?
Then wine LFS.exe /cfg=setup.cfg and done.
misiek08
S3 licensed
DB structure:
-- phpMyAdmin SQL Dump
-- version 2.11.8.1deb5+lenny7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Czas wygenerowania: 24 Lut 2011, 17:49
-- Wersja serwera: 5.0.51
-- Wersja PHP: 5.3.5-0.dotdeb.0

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Baza danych: `ltwt`
--

-- --------------------------------------------------------

--
-- Struktura tabeli dla `classes`
--

CREATE TABLE IF NOT EXISTS `classes` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(255) collate utf8_unicode_ci NOT NULL,
`short` varchar(255) collate utf8_unicode_ci NOT NULL,
`cars` text collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Struktura tabeli dla `drivers`
--

CREATE TABLE IF NOT EXISTS `drivers` (
`id` int(10) unsigned NOT NULL auto_increment,
`team_nr` int(10) unsigned NOT NULL,
`session` int(10) unsigned NOT NULL default '0',
`nick` varchar(255) collate utf8_unicode_ci default NULL,
`uname` varchar(255) collate utf8_unicode_ci NOT NULL,
`car` varchar(255) collate utf8_unicode_ci default NULL,
`plate` varchar(255) collate utf8_unicode_ci default NULL,
`admin` int(10) unsigned NOT NULL default '0',
`add_mass` int(10) unsigned NOT NULL default '0',
`rest_intake` int(10) unsigned NOT NULL default '0',
`flags` int(10) unsigned NOT NULL default '0',
`pla` int(10) unsigned NOT NULL default '0',
`country` varchar(3) collate utf8_unicode_ci default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=148 ;

-- --------------------------------------------------------

--
-- Struktura tabeli dla `laps`
--

CREATE TABLE IF NOT EXISTS `laps` (
`id` int(10) unsigned NOT NULL auto_increment,
`session` int(11) NOT NULL default '0',
`server` int(11) NOT NULL default '1',
`driver` int(11) NOT NULL,
`s1` int(11) NOT NULL default '0',
`s2` int(11) NOT NULL default '0',
`s3` int(11) NOT NULL default '0',
`s4` int(11) NOT NULL default '0',
`ltime` int(11) NOT NULL,
`ttime` int(11) NOT NULL,
`lap` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1679 ;

-- --------------------------------------------------------

--
-- Struktura tabeli dla `packets`
--

CREATE TABLE IF NOT EXISTS `packets` (
`id` int(10) unsigned NOT NULL auto_increment,
`server` int(11) NOT NULL default '1',
`time` int(10) unsigned NOT NULL,
`data` mediumtext collate utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6844 ;

-- --------------------------------------------------------

--
-- Struktura tabeli dla `teams`
--

CREATE TABLE IF NOT EXISTS `teams` (
`id` int(10) unsigned NOT NULL auto_increment,
`session` int(11) NOT NULL default '0',
`team_nr` int(11) NOT NULL,
`start_pos` int(11) NOT NULL default '0',
`pos` int(11) NOT NULL default '0',
`name` varchar(255) collate utf8_unicode_ci NOT NULL,
`car` varchar(255) collate utf8_unicode_ci NOT NULL,
`changes` int(11) NOT NULL default '0',
`penalty` int(11) NOT NULL default '0',
`dsq` int(11) NOT NULL default '0',
`s1` int(11) NOT NULL default '0',
`s2` int(11) NOT NULL default '0',
`s3` int(11) NOT NULL default '0',
`s4` int(11) NOT NULL default '0',
`last_time` int(11) NOT NULL default '0',
`laps_done` int(11) NOT NULL default '0',
`ttime` int(11) NOT NULL default '0',
`online_driver` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=43 ;

misiek08
S3 licensed
Code of beta version can you see below. It's working but there is still a lot of things to do.
Code of plugin:

<?php 
php

class ltwt2 extends Plugins {
    const 
NAME 'Test';
    const 
AUTHOR 'Misiek';
    const 
VERSION PHPInSimMod::VERSION;
    const 
DESCRIPTION 'Testing PRISM.';

    public 
$poss = array();
    public 
$misiek_plid 0;
    public 
$lapsdone = array();
    public 
$session 0;

    public function 
__construct() {
        require_once(
'includes/DB.class.php');
        
DB::gi()->query('SET NAMES utf8');
        
$this->registerPacket('save_to_db'ISP_SPXISP_LAPISP_PITISP_PLAISP_PENISP_FLGISP_NPLISP_REO);
        
$this->registerPacket('lap'ISP_LAP);
        
$this->registerPacket('spx'ISP_SPX);
        
$this->registerPacket('npl'ISP_NPL);
        
$this->registerPacket('npl'ISP_NPL);
        
$this->registerPacket('toc'ISP_TOC);
        
$this->createTimer('showMemoryUsage'30Timer::REPEAT);
        
error_reporting(E_ALL E_NOTICE);
    }

    public function 
showMemoryUsage() {
        echo 
'-------------------------------' PHP_EOL;
        echo 
'-------------------------------' PHP_EOL;
        echo 
'@memory_get_usage(): ' . @memory_get_usage() . PHP_EOL;
        echo 
'@memory_get_usage(true): ' . @memory_get_usage(true) . PHP_EOL;
        echo 
'@memory_get_peak_usage(): ' . @memory_get_peak_usage() . PHP_EOL;
        echo 
'@memory_get_peak_usage(true): ' . @memory_get_peak_usage(true) . PHP_EOL;
        echo 
'-------------------------------' PHP_EOL;
        echo 
'-------------------------------' PHP_EOL;
    }

// Convert LFS Time to minutes:seconds.ms string
    
public function sekdoczas($czas) {
        
$ret "";
        
$minutes intval(intval($czas 1000) / 60);
        if (
$minutes 0) {
            
$ret .= $minutes ':';
        }
        
$seconds bcmod(intval($czas 1000), 60);
        
$ret .= ( ($seconds 10) ? '0' $seconds $seconds) . '.';
        
$setne bcmod($czas1000);
        
$ret .= $setne;

        return 
$ret;
    }

    public function 
cpr($packet) {
        
$client $this->getClientByUCID($packet->UCID);
        if (
$client != NULL) {
            
/* Wpisz dane gracza do tabeli, zeby byly aktualne */
            
$query 'UPDATE {{table}}drivers SET nick = :nick WHERE id = :id';
            
$quer DB::gi()->prepare($query);
            
$quer->bindValue(':id'$client->driver_id);
            
$quer->bindValue(':nick'$this->lfs_codepage_convert($packet->PName));
            
$quer->execute();
        }
    }

    public function 
npl($packet) {
        
$client $this->getClientByPLID($packet->PLID);
        if (
$client != NULL) {
            
/* Pobierz dane gracza i zapisz w danych o klientach hosta */
            
$quer DB::gi()->prepare('SELECT * FROM drivers WHERE uname = :uname AND session = :session');
            
$quer->bindValue(':uname'$client->UName);
            
$quer->bindValue(':session'$this->session);
            
$quer->execute();
            
$driver $quer->fetch(PDO::FETCH_OBJ);
            unset(
$quer);
            
$client->driver_id $driver->id;
            
$client->driver $driver;

            
/* Ustaw w tabeli teams aktualnego kierowcę */
            
$quer DB::gi()->prepare('UPDATE teams SET online_driver = :driver WHERE team_nr = (SELECT team_nr from drivers WHERE uname = :uname) AND session = :session');
            
$quer->bindValue(':uname'$client->UName);
            
$quer->bindValue(':driver'$client->driver_id);
            
$quer->bindValue(':session'$this->session);
            
$quer->execute();
            unset(
$quer);
            
/* Pobierz dane zespołu i dopisz do danych gracza */
            
$quer2 DB::gi()->prepare('SELECT laps_done, ttime FROM teams WHERE team_nr = :team_nr AND session = :session');
            
$quer2->bindValue(':team_nr'$client->driver->team_nr);
            
$quer2->bindValue(':session'$this->session);
            
$quer2->execute();
            
$quer2 $quer2->fetch(PDO::FETCH_OBJ);
            
$client->laps_done $quer2->laps_done;
            
$client->ttime 0;
            
$client->ttime $quer2->ttime;
            unset(
$quer2);
            
/* Wpisz dane gracza do tabeli, zeby byly aktualne */
            
$query 'UPDATE {{table}}drivers SET nick = :nick, car = :car WHERE id = :id';
            
$quer DB::gi()->prepare($query);
            
$quer->bindValue(':id'$client->driver_id);
            
$quer->bindValue(':nick'$this->lfs_codepage_convert($packet->PName));
            
$quer->bindValue(':car'$packet->CName);
            
$quer->execute();
            unset(
$quer);
            echo 
'PName: ' $client->PName ' / UName: ' $client->UName ' / Car: ' $packet->car '/ PLID: ' $packet->PLID ' / UCID: ' $client->UCID PHP_EOL;
            echo 
'Team #: ' $client->driver->team_nr ' / Intake: ' $client->driver->rest_intake ' / Added mass: ' $client->driver->add_mass PHP_EOL;
        } else {
            echo 
'-------------------------------' PHP_EOL;
            echo 
'-------------------------------' PHP_EOL;
            echo 
'NIE MA: ' $client->UName PHP_EOL;
            echo 
'-------------------------------' PHP_EOL;
            echo 
'-------------------------------' PHP_EOL;
        }
    }

    public function 
toc($packet) {
        
/* Obsługa TOC, ktora kiedys zrobi sam PRISM */
        
$client $this->getClientByUCID($packet->NewUCID);
        
$client->players[] = $this->getClientByUCID($packet->OldUCID)->players[$packet->PLID];
        unset(
$this->getClientByUCID($packet->OldUCID)->players[$packet->PLID]);
        
$this->getPlayerByPLID($packet->PLID)->setUCID($packet->NewUCID);
        
/* Koniec obsługi TOC */
        
if ($client != NULL) {
            
/* Pobierz dane gracza i zapisz w danych o klientach hosta */
            
$quer DB::gi()->prepare('SELECT * FROM drivers WHERE uname = :uname AND session = :session');
            
$quer->bindValue(':uname'$client->UName);
            
$quer->bindValue(':session'$this->session);
            
$quer->execute();
            
$driver $quer->fetch(PDO::FETCH_OBJ);
            unset(
$quer);
            
$client->driver_id $driver->id;
            
$client->driver $driver;
            
/* Ustaw w tabeli teams aktualnego kierowcę */
            
$quer DB::gi()->prepare('UPDATE teams SET online_driver = :driver WHERE team_nr = (SELECT team_nr from drivers WHERE uname = :uname) AND session = :session');
            
$quer->bindValue(':uname'$client->UName);
            
$quer->bindValue(':driver'$client->driver_id);
            
$quer->bindValue(':session'$this->session);
            
$quer->execute();
            unset(
$quer);
            
/* Pobierz dane zespołu i dopisz do danych gracza */
            
$quer2 DB::gi()->prepare('SELECT laps_done, ttime FROM teams WHERE team_nr = :team_nr AND session = :session');
            
$quer2->bindValue(':team_nr'$client->driver->team_nr);
            
$quer2->bindValue(':session'$this->session);
            
$quer2->execute();
            
$quer2 $quer2->fetch(PDO::FETCH_OBJ);
            
$client->laps_done $quer2->laps_done 1;
            
$client->ttime 0;
            
$client->ttime $quer2->ttime;
            unset(
$quer2);
            
/* Wpisz dane gracza do tabeli, zeby byly aktualne */
            
$query 'UPDATE {{table}}drivers SET nick = :nick WHERE id = :id';
            
$quer DB::gi()->prepare($query);
            
$quer->bindValue(':id'$client->driver_id);
            
$quer->bindValue(':nick'$this->lfs_codepage_convert($client->PName));
            
$quer->execute();
            unset(
$quer);
            echo 
'PName: ' $client->PName ' / UName: ' $client->UName ' / PLID: ' $packet->PLID ' / UCID: ' $client->UCID PHP_EOL;
            echo 
'Team #: ' $client->driver->team_nr ' / Intake: ' $client->driver->rest_intake ' / Added mass: ' $client->driver->add_mass PHP_EOL;
        } else {
            echo 
'NIE MA: ' $client->UName PHP_EOL;
        }
    }

    public function 
lap($packet) {
        
$client $this->getClientByPLID($packet->PLID);
        
$laptime $packet->LTime;
        if(
$packet->LapsDone == 1){
            
$laptime $laptime $client->ttime;
        }
        if (
$client != NULL) {
            
$client->laps_done++;
            
$client->ttime $client->ttime $laptime;
            
$query 'UPDATE {{table}}laps SET ltime = :ltime, ttime = :ttime WHERE driver = :driver AND lap = :lap AND session = :session';
            
$quer DB::gi()->prepare($query);
            
$quer->bindValue(':driver'$client->driver_id);
            
$quer->bindValue(':ltime'$laptime);
            
$quer->bindValue(':ttime'$client->ttime);
            
$quer->bindValue(':lap'$client->laps_done);
            
$quer->bindValue(':session'$this->session);
            
$quer->execute();
            unset(
$quer);
            
$query 'UPDATE {{table}}teams SET laps_done = laps_done + 1, ttime = ttime + ' $laptime ', last_time = ' $laptime ' WHERE team_nr = :team';
            
$quer DB::gi()->prepare($query);
            
$quer->bindValue(':team'$client->driver->team_nr);
            
$quer->execute();

            unset(
$quer);
        }
    }

    public function 
spx($packet) {
        
$client $this->getClientByPLID($packet->PLID);
        if (
$client != NULL) {
            
$db_split 's' $packet->Split;
            if (
$packet->Split == 1) {
                
$query 'INSERT INTO {{table}}laps (driver, lap, session) VALUES(:driver, :lap, :session)';
                
$quer DB::gi()->prepare($query);
                
$quer->bindValue(':driver'$client->driver_id);
                
$lap $client->laps_done 1;
                
$quer->bindValue(':lap'$lap);
                
$quer->bindValue(':session'$this->session);
                
$quer->execute();
                unset(
$quer);
                unset(
$lap);
                
$query 'UPDATE {{table}}teams SET  s1 = \'0\', s2 = \'0\', s3 = \'0\', s4 = \'0\', last_time = \'0\' WHERE team_nr = :team_nr AND session = :session';
                
$quer DB::gi()->prepare($query);
                
$quer->bindParam(':team_nr'$client->driver->team_nrPDO::PARAM_INT);
                
$quer->bindParam(':session'$this->sessionPDO::PARAM_INT);
                
$quer->execute();
                unset(
$quer);
            }
            
$query 'UPDATE {{table}}laps SET  ' $db_split ' = :value WHERE lap = :lap AND driver = :driver AND session = :session';
            
$quer DB::gi()->prepare($query);
            
$quer->bindValue(':driver'$client->driver_id);
            
$quer->bindValue(':lap'$client->laps_done 1);
            
$quer->bindValue(':value'$packet->STime);
            
$quer->bindValue(':session'$this->session);
            
$quer->execute();
            unset(
$quer);
            
$query 'UPDATE {{table}}teams SET  ' $db_split ' = :value WHERE team_nr = :team_nr AND session = :session';
            
$quer DB::gi()->prepare($query);
            
$quer->bindValue(':value'$packet->STime);
            
$quer->bindValue(':team_nr'$client->driver->team_nr);
            
$quer->bindValue(':session'$this->session);
            
$quer->execute();
            unset(
$quer);
            unset(
$db_split);
            unset(
$query);
        }
    }

// Saves packets into db
    
public function save_to_db($packet) {
        
$save_str serialize($packet);
        
$query 'INSERT INTO {{table}}packets (time, data) VALUES(unix_timestamp(),:serialized)';
        
$quer DB::gi()->prepare($query);
        
$quer->bindValue(':serialized'$save_str);
        
$quer->execute();
        unset(
$quer);
        unset(
$save_str);
    }

    private function 
lfs_codepage_convert($str$conv_to 'UTF-8') {
        
$sets = array('L' => 'CP1252',
            
'G' => 'ISO-8859-7',
            
'C' => 'CP1251',
            
'E' => 'ISO-8859-2',
            
'T' => 'ISO-8859-9',
            
'B' => 'ISO-8859-13',
            
'J' => 'SJIS-win',
            
'S' => 'CP936',
            
'K' => 'CP949',
            
'H' => 'CP950');

        
$tr_ptrn = array("/\^d/""/\^s/""/\^c/""/\^a/""/\^q/""/\^t/""/\^l/""/\^r/""/\^v/");
        
$tr_ptrn_r = array("\\""/"":""*""?""\"""<"">""|");
        
$str preg_replace($tr_ptrn$tr_ptrn_r$str);

        
$newstr $tmp '';
        
$current_cp 'L';
        
$len strlen($str);
        for (
$i 0$i $len$i++) {
            if (
$str{$i} == '^' && isset($sets[$str{$i 1}]) && $str{$i 1} != "^") {
                if (
$tmp != '') {
                    
$newstr .= iconv($sets[$current_cp], $conv_to$tmp);  
                    
$tmp '';
                }
                
$current_cp $str{++$i};
            }
            
// Filter out every character below 0x20
            
else if (ord($str{$i}) > 31)
                
$tmp .= $str{$i};
        }
        if (
$tmp != '')
            
$newstr .= iconv($sets[$current_cp], $conv_to$tmp);  

        
// Final special char to convert - could not do that before codepage conversion
        
return str_replace('^^''^'$newstr);
    }

    
/*
      public function lap($packet){
      $nick = $this->getPlayerByPLID($packet->PLID)->PName;
      $nick = preg_replace('/\^[0-9A-Za-z]/','', $nick);
      # if($nick == 'Misiek')
      echo 'Nick: ', $nick, ' / Czas: ', @$this->sekdoczas($packet->LTime), ' / Ukonczone: ',$packet->LapsDone, PHP_EOL;
      } */
}

?>

Code to display live stats:

<?php 
php
ini_set
('display_errors'1);
error_reporting(E_ALL);
$title 'Live';
require_once 
'inc/DB.class.php';
/* connecting to DB, creating instance and setting utf */
DB::gi()->query('SET NAMES utf8');

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

### convert lfs time to stdClass object {hours, minutes, seconds, mili)

function lfs_time($time$mili true) {
    if (!
$mili) {
        
$time $time 1000;
    }
    
$return = new stdClass();
    
$return->hours floor($time 3600000);
    
$time $time - ($return->hours 3600000);
    
$return->minutes floor($time 60000);
    
$time $time - ($return->minutes 60000);
    
$return->seconds floor($time 1000);
    
$time $time - ($return->seconds 1000);
    if(
$time 100$time '0' $time;
    
$return->mili $time;
    return 
$return;
}

### convert lfs time to string H:i:s.ms

function lfs_time2string($time$mili true$hours false) {
    
$obj lfs_time($time);
    return ((
$hours) ? ($obj->hours ':') : '') . fillZero($obj->minutes) . ':' fillZero($obj->seconds) . (($mili) ? ('.' $obj->mili) : '');
}

### add 0 at the beginning of <10

function fillZero($where) {
    return (
$where 10) ? '0' $where $where;
}

### define colors for HTML-output ###

function lfs_getColorCode($col) {
    switch (
$col) {
        case 
: return "#000000";
        case 
: return "#ff0000";
        case 
: return "#00ff00";
        case 
: return "#ffff00";
        case 
: return "#0000ff";
        case 
: return "#ff00ff";
        case 
: return "#00ffff";
        case 
: return "#ffffff";
        case 
: return "#000000";
        case 
: return "#000000";
        default : return 
$col;
    }
}

### strip colors from names ###

function lfs_nameblank($name) {
    return 
stripslashes(preg_replace("/\^[0-9]/"""htmlspecialchars($name)));
}

### get colored names for HTML-output ###

function lfs_namecolored($name) {
    return 
stripslashes(preg_replace("/\^([0-9])(.[^\^]*)/e"'"<span style=\"color:".getColorCode($1).";\">$2</span>"'htmlspecialchars($name)));
}

/* L = Latin 1
 * G = Greek
 * C = Cyrillic
 * E = Central Europe
 * T = Turkish
 * B = Baltic
 * J = Japanese
 * S = Simplified Chinese
 * K = Korean
 * H = Traditional Chinese
 * 
 */
function lfs_codepage_convert($str$conv_to 'UTF-8') {
    
$sets = array('L' => 'CP1252',
        
'G' => 'ISO-8859-7',
        
'C' => 'CP1251',
        
'E' => 'ISO-8859-2',
        
'T' => 'ISO-8859-9',
        
'B' => 'ISO-8859-13',
        
'J' => 'SJIS-win',
        
'S' => 'CP936',
        
'K' => 'CP949',
        
'H' => 'CP950');

    
$tr_ptrn = array("/\^d/""/\^s/""/\^c/""/\^a/""/\^q/""/\^t/""/\^l/""/\^r/""/\^v/");
    
$tr_ptrn_r = array("\\""/"":""*""?""\"""<"">""|");
    
$str preg_replace($tr_ptrn$tr_ptrn_r$str);

    
$newstr $tmp '';
    
$current_cp 'L';
    
$len strlen($str);
    for (
$i 0$i $len$i++) {
        if (
$str{$i} == '^' && isset($sets[$str{$i 1}]) && $str{$i 1} != "^") {
            if (
$tmp != '') {
                
$newstr .= mb_convert_encoding($tmp$conv_to$sets[$current_cp]);
                
$tmp '';
            }
            
$current_cp $str{++$i};
        }
        
// Filter out every character below 0x20
        
else if (ord($str{$i}) > 31)
            
$tmp .= $str{$i};
    }
    if (
$tmp != '')
        
$newstr .= mb_convert_encoding($tmp$conv_to$sets[$current_cp]);

    
// Final special char to convert - could not do that before codepage conversion
    
return str_replace('^^''^'$newstr);
}

### get next position in class by car/carstype
function get_pos($car, &$classes){
    foreach(
$classes as $class){
        if(
in_array($car$class->cars)){
            
$class->pos++;
            return 
$class->pos 1;
        }
    }
}

### define colors for HTML-output ###
function getColorCode($col) {
    switch (
$col) {
        case 
: return "#000000";
        case 
: return "#ff0000";
        case 
: return "#00ff00";
        case 
: return "#ffff00";
        case 
: return "#0000ff";
        case 
: return "#ff00ff";
        case 
: return "#00ffff";
        case 
: return "#ffffff";
        case 
: return "#000000";
        case 
: return "#000000";
        default : return 
$col;
    }
}

$classes['XR3'] = 1;
$classes['FZ3'] = 1;
$classes['FX3'] = 1;
$classes['TBA'] = 1;
$classes['FZ5'] = 1;
$classes['RB4'] = 1;
$classes['XRG'] = 1;

/* $teamy_kierowcy = DB::gi()->prepare('
  SELECT
  (l.s1 + l.s2 + l.s3 + l.s4) AS splits_tog, l.s1, l.s2, l.s3, l.s4, l.ltime, l.lap,
  d.id as driver_id, d.nick, d.uname, d.admin, d.add_mass, d.rest_intake, d.flags, d.pla, d.country,
  t.id as team_id, t.team_nr, t.name, t.car, t.changes, t.penalty, t.dsq, t.online_driver, t.laps_done, t.ttime
  FROM (SELECT * FROM laps ORDER BY id DESC, lap DESC, ttime ASC) AS l
  LEFT JOIN drivers d ON(d.id = l.driver)
  LEFT JOIN teams t ON(t.team_nr = d.id_team)
  GROUP BY l.driver
  ORDER BY t.laps_done DESC, l.ttime ASC'); */
/* $teamy_kierowcy = DB::gi()->prepare('
  SELECT
  t.*,
  d.*,
  l.*
  FROM (SELECT * FROM laps GROUP BY driver ORDER BY lap) AS l LEFT JOIN drivers d ON d.id = l.driver LEFT JOIN teams t ON t.id = d.id_team'); */
$teamy_kierowcy DB::gi()->prepare('
    SELECT
    t.s1, t.s2, t.s3, t.s4, l.ltime, l.lap,
    d.id as driver_id, d.nick, d.uname, d.admin, d.car, d.add_mass, d.rest_intake, d.flags, d.pla, d.country,
    t.id as team_id, t.team_nr, t.name, t.car as class, t.changes, t.penalty, t.dsq, t.online_driver, t.laps_done, t.ttime,
    (SELECT ltime FROM laps WHERE driver = d.id ORDER BY id DESC LIMIT 1) AS ltime
    FROM teams t
    LEFT JOIN drivers d ON (d.id = t.online_driver)
    LEFT JOIN (SELECT * FROM laps GROUP BY driver ORDER BY lap) AS l ON(l.driver = d.id)
    ORDER BY t.laps_done DESC, t.ttime ASC, t.team_nr ASC'
);
$teamy_kierowcy->execute();
$teamy_kierowcy $teamy_kierowcy->fetchAll(PDO::FETCH_OBJ);

>?
xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>LFS Tracker - Misiek echo ($title && $title != '') ? '::' . $title : ''; </title>
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
        <link rel="stylesheet" href="style_1.css" />
        <script type="text/javascript" src="js/jQuery.js"></script>
        <script type="text/javascript" src="js/jquery.tooltip.min.js"></script>
        <!--script type="text/javascript" src="js/jquery.color.js"></script>
        <script type="text/javascript" src="js/jquery.dump.js"></script>
        <script type="text/javascript" src="js/functions.js"></script>
        <script type="text/javascript" src="js/lang_pl.js"></script>
        <script type="text/javascript" src="js/main.js"></script-->
    </head>
    <body>
        <div id="top_menu">
            <div id="top_menu_inner"><ul class="inline_list" style="margin:0; list-style-type: none;">
                    <li><a href="index.php" class="full_white">Home</a></li>
                    <li><a href="best.php" class="full_white">Best laps</a></li>
                    <li><a href="teams_drivers.php" class="full_white">Teams & Drivers</a></li>
                    <li><a href="rescue.php" class="full_white">Rescue live progress</a></li>
                </ul></div>
        </div>
        <div id="cala_strona">
<!--div id="pitstopy">
    <div id="pitstopy_desc">Pitstopy:</div>
    <div id="pitstop_temp" style="display:none;">
        <div id="pitstop_dr_team"></div>
        <div id="pitstop"></div>
        <div id="opony"></div>
    </div>
</div-->
<center>
    <h1> This is 3rd round race progress...</h1>
    <div id="main_stat_table_div">
        <table id="main_stat_table">
            <tr id="main_stat_desc" class="main_stat_row">
                <td id="id_desc" class="first w_help" title="Position">Pos.</td>
                <td id="id_desc" class="first w_help" title="Team number">#</td>
                <td id="kierowca_desc" style="width: 150px">Driver</td>
                <td id="team_desc" style="width: 150px">Team</td>
                <td id="samochod_desc" class="w_help" title="Car">Car</td>
                <td id="split1_desc" class="w_help" title="Sector 1">S1</td>
                <td id="split2_desc" class="w_help" title="Sector 2">S2</td>
                <!--td id="split3_desc" class="w_help" title="Sector 3">S3</td-->
                <td id="czasokr_desc" class="w_help" title="Lap time">Lap time</td>
                <td id="okr_desc" class="w_help" title="Lap">Lap</td>
                <td id="najokr_desc" class="w_help" title="Best driver lap">Best driver lap</td>
                <!--td id="kara_desc" style="width: 20px">Penalty</td-->
                <td id="gap1_desc">Gap to 1st</td>
                <td id="gap2_desc">Gap</td>
            </tr>
            <!--<tr id="main_stat_1" class="main_stat_row">
                    <td id="id_1" class="first">1</td>
                    <td id="kierowca_1">Misiek 1</td>
                    <td id="team_1">Fast Racing 1</td>
                    <td id="samochod_1">FZR</td>
                    <td id="split1_1">26.39</td>
                    <td id="split2_1">1:02.12</td>
                    <td id="split3_1">--:--.--</td>
                    <td id="czasokr_1">1:48.23</td>
                    <td id="okr_1">2</td>
                    <td id="najokr_1">1:48.23 (1)</td>
                    <td id="kara_1" class="last">-</td>
            </tr> -->
            php
            if(count($teamy_kierowcy) > 0){
                $first_ttime = $teamy_kierowcy[0]->ttime;
                $last_ttime = $first_ttime;
            }
            $i = 1;
            foreach ($teamy_kierowcy as $team) {
                $class_pos = $i;
                if (array_key_exists($team->class, $classes)) {
                    $class_pos = $classes[$team->class];
                    $classes[$team->class]++;
                }
                $best_czas = DB::gi()->prepare('SELECT * FROM laps l WHERE driver = \'' . $team->online_driver . '\' AND ltime <> 3600000 AND ltime <> 0 ORDER BY ltime ASC LIMIT 1');
                $best_czas->execute();
                if ($best_czas2 = $best_czas->fetch(PDO::FETCH_OBJ)) {
                    $team->best_czas = lfs_time2string($best_czas2->ltime);
                    $team->best_nr = $best_czas2->lap;
                    $best_czas->closeCursor();
                } else {
                    $team->best_czas = '---------';
                    $team->best_nr = '--';
                }

                echo '<tr id="main_stat_' . $team->team_id . '" class="main_stat_row"> ';
                echo '<td id="poz_' . $team->team_id . '" class="first" title="' . $class_pos . ' in class ' . strtoupper($team->class) . '">' . $i . '</td> ';
                echo '<td id="id_' . $team->team_id . '" class="first">' . $team->team_nr . '</td> ';
                echo '<td id="kierowca_' . $team->team_id . '">' . lfs_namecolored($team->nick) . '<br />(' . $team->uname . ')</td> ';
                echo '<td id="team_' . $team->team_id . '">' . $team->name . '</td> ';
                echo '<td id="samochod_' . $team->team_id . '">' . strtoupper($team->car) . '<br />Class:' . strtoupper($team->class) . '</td> ';
                echo '<td id="split1_' . $team->team_id . '">' . lfs_time2string($team->s1) . '</td> ';
                echo '<td id="split2_' . $team->team_id . '">' . lfs_time2string($team->s2) . '</td> ';
                //echo '<td id="split3_' . $team->team_id . '">' . lfs_time2string($team->s3) . '</td> ';
                echo '<td id="czasokr_' . $team->team_id . '">' . lfs_time2string($team->ltime) . '</td> ';
                echo '<td id="okr_' . $team->team_id . '">' . ($team->laps_done + 1) . '</td> ';
                echo '<td id="najokr_' . $team->team_id . '">' . $team->best_czas . '<br />(' . $team->best_nr . ')</td> ';
                //echo '<td id="kara_' . $team->team_id . '" class="last">' . $team->penalty . '</td> ';
                //echo '<td id="ttime_' . $team->team_id . '" class="last">' . $team->ttime . '</td> ';
                echo '<td id="gap1_' . $team->team_id . '" class="last">' . lfs_time2string($team->ttime - $first_ttime) . '</td> ';
                echo '<td id="gap2_' . $team->team_id . '" class="last">' . lfs_time2string($team->ttime - $last_ttime) . '</td> ';
                echo '<td id="lapslink_' . $team->team_id . '" class="last"><a href="laps.php?t=' . $team->team_nr . '">Laps</a></td> ';
                echo '</tr>';
                $last_ttime = $team->ttime;
                $i++;
            }
            unset($best_czas);
            
        </table>
</center>
<!--table id="legenda">
    <tr>
        <th colspan="3">Legenda:</th>
    </tr>
    <tr>
        <td style="width:40px; background-color:#FFCC00;"> </td><td>Kierowca znajduje się w pitlane</td>
    </tr>
    <tr>
        <td style="width:40px; background-color:#FF0000;"> </td><td>Zespół nie uczestniczy w wyścigu</td>
    </tr>
</table>
</div>
<div id="komentarz">
<div>komentarz 1</div>
<div>komentarz 1</div>
<div>komentarz 1</div>
<div>komentarz 1</div>
<div>komentarz 1</div>
</div-->
<script type="text/javascript">
    setTimeout("window.location.reload()", 25000);
</script>
</div>
<!--div onclick="do_example()" style="clear:both">Teraz</div>

</div>
<div id="end"></div>

<div>
    <textarea id="kod"></textarea>

    <div id="eval_kod">Execute</div>
    <textarea id="debug"></textarea>
</div-->
<script type="text/javascript">
$('*').tooltip({track: true,
    delay: 0,
    showURL: false});
</script>
</body>
</html>
?>

DB.class:

<?php 
php
class DB extends PDO {

    private static 
$instance NULL;
    private 
$prefix;

    static public function 
gi() {
        if (
self::$instance == NULL) {
            try {
                
self::$instance = new DB('62.75.188.55','ltwt''officiale''ltwt''');
                
self::$instance->setAttribute(PDO::ATTR_ERRMODEPDO::ERRMODE_WARNING);
            } catch (
PDOException $e) {
                die(
'Error while connecting to DB: ' $e->getMessage());
            }
        }
        return 
self::$instance;
    }

    public function 
__construct($host$user$pass$name$prefix '') {
        
$this->prefix $prefix;
        
parent::__construct('mysql:dbname=' $name ';host=' $host$user$pass);
    }

    public function 
exec($query$file false$line false) {
        
$query str_replace('{{table}}'$this->prefix$query);
        return 
parent::exec($query);
    }

    public function 
query($query) {
        
$query str_replace('{{table}}'$this->prefix$query);

        return 
parent::query($query);
    }

    public function 
prepare($query) {
        
$query str_replace('{{table}}'$this->prefix$query);
        return 
parent:[:p]repare($query);
    }

}
?>

I think here are still good PHP programmers so maybe someone can edit it and make it better. @boothy is going to release tracker of MoE but I think it can take some time.
misiek08
S3 licensed
It's possible to join every server as admin and as any account. Joining as admin is easy but as other LFSW account it's harder to do. I didn't that but someone did it on my server. It's really awesome when you change password and he is coming as admin back.
misiek08
S3 licensed
Check if green marked teams are good.

Teams that are not marked green didn't send confirmation of forum.

If there are still some wrong data post here.
For next round every tracker manager will have panel to add/edit/remove players.
misiek08
S3 licensed
NP. I think tracker will die during race. I'm doing it alone and it was hard.
misiek08
S3 licensed
Added. Check please.
misiek08
S3 licensed
There is no old driver? Only new drivers in team?
FGED GREDG RDFGDR GSFDG