.purple {
height: 5px;
width: 30px;
margin: 0 auto;
background-color: transparent;
border-radius: 20%;
animation-name: purple;
animation-duration: 0.5s;
animation-timing-function: infinite;
animation-delay: 0;
animation-direction: alternate;
animation-iteration-count: infinite;
animation-fill-mode: none;
animation-play-state: running;
}
@keyframes purple {
100% {
transform: scale(.1);
background-color: purple;
border-radius: 20%;
}
50% {
background-color: #FE2EF7;
}
100% {
transform: scale(1);
background-color: puple;
}
}
body,
html {
height: 10%;
}
body {
display: fixed;
align-items: center;
justify-content: center;
}
'; $green = '
'; $yellow = '
'; $red = '
'; ?>
0) {
for ($a= 0; $a <= 1000; $a++) {
$userid = ($leaderboard[$a]["user_id"]);
$userno = ($leaderboard[$a]["user_no"]);
${$userid} += ($leaderboard[$a]["round_point"]);
$jasondata .= '"' . $userno . '":';
if (${$userid} == NULL) {${$userid} = 0;}
if ($userid == NULL) {break;}
$jasondata .= '{"user_no":"' . $userno . '","user_id":"' . $userid . '","' . 'total_points":' . '"' . ${$userid} . '"},';}
$jasondata .= '{},';
}
}
$jasondata = substr($jasondata, 0, -1);
$jasondata .= '}';
// DEBUG TESTER // echo '
' . $jasondata;
$jasondata = json_decode($jasondata,true);
//------------------------------------------------ Total Points Loader --------------------------------------------------------------------------------------
foreach ($jasondata as $key => $row)
{
$vc_array_point[$key] = $row[total_points];
}
array_multisort($vc_array_point, SORT_DESC, $jasondata);
//***********************************************************************************************************************************************************
// Világranglista Top10 "B" data Load
$driverscount = "1600";
$DRDELTA = "100000";
$data = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/data.json");
$data = json_decode($data,true);
$databackup = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/data-1h.json");
$databackup = json_decode($databackup,true);
// One week backup
if(date('D') == 'Mon') {
$data2 = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/data-tuesday.json");
$data2 = json_decode($data2,true);}
if(date('D') == 'Tue') {
$data2 = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/data-wednesday.json");
$data2 = json_decode($data2,true);}
if(date('D') == 'Wed') {
$data2 = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/data-thursday.json");
$data2 = json_decode($data2,true);}
if(date('D') == 'Thu') {
$data2 = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/data-friday.json");
$data2 = json_decode($data2,true);}
if(date('D') == 'Fri') {
$data2 = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/data-saturday.json");
$data2 = json_decode($data2,true);}
if(date('D') == 'Sat') {
$data2 = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/data-sunday.json");
$data2 = json_decode($data2,true);}
if(date('D') == 'Sun') {
$data2 = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/data-monday.json");
$data2 = json_decode($data2,true);}
$data3 = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/data-24.json");
$data3 = json_decode($data3,true);
$datadailya = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/1-emea-ranking.json");
$datadailya = json_decode($datadailya,true);
$datadailyb = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/2-emea-ranking.json");
$datadailyb = json_decode($datadailyb,true);
$datadailyc = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/3-emea-ranking.json");
$datadailyc = json_decode($datadailyc,true);
$datadailyn = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/11-emea-ranking.json");
$datadailyn = json_decode($datadailyn,true);
$datadailym = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/12-emea-ranking.json");
$datadailym = json_decode($datadailym,true);
$namedata = file_get_contents("http://gtsport.raceonlinehungary.net/data/daily/TEAMS/ROH/realnames.json");
$namedata = json_decode($namedata,true);
$backuptime = $datenow - $datebackup;
$now = date("H:i");
if ($backuptime > 60) {echo '
'. $now . '' . ' |
---|
';}
else {echo '
'. $now . '' . ' |
---|
';}
echo '
' . '' . ' Hungarian GT SPORT Performance Ranking' . $country2 . ' ' . '' . ' |
---|
';
echo '
' . '#' . '
| ' . '' . ' | ' . '' . ' | ' . 'Név/Márka/Egyesület' . ' | ' . 'DR/SR' . ' | ' . 'DR/SR pont/Km' . ' | ' . 'Info' . ' | ' . 'Perf.' . ' |
---|
';
$hunsor = 0;
//Server Backup visszaállítás
//$userid = ($data[0]["user_id"]);
//$day = date("d")-1;
//$month = date("m");
//if ($day < "10") { $day = ('0' . $day); }
//if ($userid == '') {$data = file_get_contents("gtprofiles/manufacturer/2018-$month-$day.dat");
//$data = json_decode($data,true);}
//Server Backup visszaállítás vége
for ($d = 0; $d <= $driverscount; $d++) {
$starplayer = ($data[$d]["driver_star"]);
$manufacturer = ($data[$d]["manufacturer"]);
$board_id = ($data[$d]["board_id"]);
$replay = ($data[$d]["replay"]);
$lap = ($data[$d]["score"]);
$realname = ($data[$d]["realname"]);
$userid = ($data[$d]["stats"]["nickname"]);
$userno = ($data[$d]["number"]);
$totalkm = ($data[$d]["stats"]["total_running_meter"]);
$totalkm = $totalkm / 1000;
$totalkm = round($totalkm);
$country = ($data[$d]["country"]);
$creation = ($data[$d]["create_time"]);
$creation = date("Y/m/d H:i",strtotime($creation));
$photoid = ($data[$d]["photo"]);
$level = ($data[$d]["level"]);
$driverpoint = ($data[$d]["driver_point"]);
//$profilkep = '
';
$status = '
-';
for ($d2 = 0; $d2 <= $driverscount; $d2++) {
$userno24 = ($data2[$d2]["number"]);
$totalkm24 = ($data2[$d2]["stats"]["total_running_meter"]);
$totalkm24 = $totalkm24 / 1000;
$totalkm24 = round($totalkm24);
if ($userno == $userno24) {$DRBACKUP = ($data2[$d2]["dr"]); break;}}
for ($db = 0; $db <= $driverscount; $db++) {
$usernobackup = ($databackup[$db]["number"]);
$totalkmbackup = ($databackup[$db]["stats"]["total_running_meter"]);
$totalkmbackup = $totalkmbackup / 1000;
$totalkmbackup = round($totalkmbackup);
if ($userno == $usernobackup) {break;}
}
$dailyresulta = '
A';
$dailyresultb = '
B';
$dailyresultc = '
C';
$nationsresult = '
N';
$manufactresult = '
M';
for ($da = 0; $da <= $driverscount; $da++) {
$usernoa = ($datadailya[$da]["user_no"]);
if ($userno == $usernoa) {$dailyresulta = 'A'; break;}}
for ($db = 0; $db <= $driverscount; $db++) {
$usernob = ($datadailyb[$db]["user_no"]);
if ($usernob == $userno) {$dailyresultb = 'B'; break;}}
for ($dc = 0; $dc <= $driverscount; $dc++) {
$usernoc = ($datadailyc[$dc]["user_no"]);
if ($usernoc == $userno) {$dailyresultc = 'C'; break;}}
for ($dn = 0; $dn <= $driverscount; $dn++) {
$usernon = ($datadailyn[$dn]["user_no"]);
if ($usernoc == $userno) {$nationsresult = 'N'; break;}}
for ($dm = 0; $dm <= $driverscount; $dm++) {
$usernom = ($datadailym[$dm]["user_no"]);
if ($usernom == $userno) {$manufactresult = 'M'; break;}}
// profile photo
$photoidname = substr($photoid, 0, strlen($photoid) - 2);
$folder1 = substr($photoidname, -2);
$photoidname = substr($photoid, 0, strlen($photoid) - 4);
$folder2 = substr($photoidname, -2);
$photoidname = substr($photoid, 0, strlen($photoid) - 6);
$folder3 = substr($photoidname, -2);
$photoidname = substr($photoid, 0, strlen($photoid) - 2);
$photoidname = $photoidname . '_23';
//$profilkep = "
";
$filename = "data/helmets/" . "$photoidname.png";
if (file_exists($filename)) {
$profilkep = "
";
} else {
$url = "http://gt7sp-prod.s3-website-us-east-1.amazonaws.com/photo/" . $folder1 . "/" . $folder2 . "/" . $folder3 . "/" . "$photoidname.png";
$img = "data/helmets/" . "$photoidname.png";
file_put_contents($img, file_get_contents($url)); $profilkep = "
";
}
// -------------------------------------------------------------------------------------------
if ($photoid == "") {$profilkep = "
";}
// Country filter
$data_country = file_get_contents("data/nat.dat");
$data_country = json_decode($data_country,true);
for ($ccc = 0; $ccc <= 243; $ccc++) {
$country_name = ($data_country[$ccc]["name"]);
$country_code = ($data_country[$ccc]["code"]);
if ($country == $country_code) {break;}}
$star = '-';
for ($n = 0; $n <= 1000; $n++) {
$userno2 = ($namedata[$n]["user_no"]);
$team = ($namedata[$n][team]);
$realnames = ($namedata[$n]["real_name"]);
if ($userno2 == $userno) {break;}}
$DR = ($data[$d]["dr"]);
$SR = ($data[$d]["sr"]);
$Str1=''.$DR.'';
$Str2=''.$SR.'';
if ($DR < "2") {
$dr="E"; $valuemindr = 0;$valuemaxdr = 0;}
elseif ($DR < "4000") {
$dr="D";$valuemindr = 1;$valuemaxdr = 3999;
} elseif ($DR < "10000") {
$dr="C";$valuemindr = 4000;$valuemaxdr = 9999;
} elseif ($DR < "30000") {
$dr="B";$valuemindr = 10000;$valuemaxdr = 29999;
} elseif ($DR < "50000") {
$dr="A";$valuemindr = 30000;$valuemaxdr = 49999;
} else { $dr="A+";$valuemindr = 50000;$valuemaxdr = 100000;
}
if ($SR < "9") {
$sr="E"; $srcolor= "color:red";}
elseif ($SR < "19") {
$sr="D"; $srcolor= "color:red";
} elseif ($SR < "39") {
$sr="C"; $srcolor= "color:yellow";
} elseif ($SR < "65") {
$sr="B"; $srcolor= "color:yellow";
} elseif ($SR < "79") {
$sr="A"; $srcolor= "color:green";
} else {
$sr="S"; $srcolor= "color:green";
}
if ($level == "50") {
$level2 = '
'." ";}
elseif ($level >= "40") {
$level2 = '
'." ";
} elseif ($level >= "30") {
$level2 = '
'." ";
} elseif ($level >= "20") {
$level2 = '
'." ";
} elseif ($level >= "10") {
$level2 = '
'." ";
} else { $level2 = '
'." ";
}
$brandimage = "
";
if ($manufacturer == "0") {$brandimage = "-";}
if ($starplayer == "true") { $dr="S";}
// Progress bar
if ($DR == '100000') { if ($dr == 'A+
' || $dr == 'S
') {$drcolor= "background-color:rgba(204,0,255,0.7)";}}
$rank = '
' . $dr . '
' . $sr . '';
$input = $lap;
$uSec = $input % 1000;
$input = floor($input / 1000);
if ($uSec < "100") { $uSec = ('0' . $uSec); }
if($uSec <= "9") { $uSec = ('0' . $uSec); }
$seconds = $input % 60;
if($seconds <= "9") { $seconds = ('0' . $seconds); }
$input = floor($input / 60);
$minutes = $input % 60;
$input = floor($input / 60);
$korido = ($minutes . ":" . $seconds . "." . $uSec);
// Zászló
$value = "";
if ($country == "") { $value = "";}
if ($lap == "") { $korido = "-------";}
if ($DR == "") { $dr = "- ";}
if ($SR == "") { $sr = "-";}
$sor = ($d+1);
$aktualisido = date('Y-m-d H:i');
//$interval = $aktualisido->diff($creation);
$datetime1 = new DateTime($aktualisido);
$datetime2 = new DateTime($creation);
$interval = date_diff($datetime1, $datetime2);
$interval = $interval->format('%m%d%H');
$online = '';
if ($interval <= "001") { $online = 'class="blinking">';}
if ($interval <= "006") { $active = $purple;}
else if ($interval <= "100") { $active = $green;}
else if ($interval <= "200") { $active = $yellow;}
else if ($interval >= "201") { $active = $red;}
else { $active = $red;}
// Delta különbség
$gap = ($lap - $deltatime);
$input = $gap;
$uSec = $input % 1000;
$input = floor($input / 1000);
if ($uSec < "100") { $uSec = ('0' . $uSec); }
if($uSec <= "9") { $uSec = ('0' . $uSec); }
$seconds = $input % 60;
if($seconds <= "9") { $seconds = ('' . $seconds); }
$input = floor($input / 60);
if($minutes < "9") { $minutes = ('' . $minutes); }
$minutes = $input % 60;
$input = floor($input / 60);
$gap = '+' . ($seconds . "." . $uSec);
//$gap2 = '+' . ($minutes . ":" . $seconds . "." . $uSec);
// Kvalifikációs delta
$qgap = ($lap - $kvalitime);
$input = $qgap;
$uSec = $input % 1000;
$input = floor($input / 1000);
if ($uSec < "100") { $uSec = ('0' . $uSec); }
if($uSec <= "9") { $uSec = ('0' . $uSec); }
$seconds = $input % 60;
if($seconds <= "9") { $seconds = ('' . $seconds); }
$input = floor($input / 60);
if($minutes < "9") { $minutes = ('' . $minutes); }
$minutes = $input % 60;
$input = floor($input / 60);
$qgap = '+' . ($seconds . "." . $uSec);
// World record delta
$worldrec = ($lap - $worldrecord);
$input = $worldrec;
$uSec = $input % 1000;
$input = floor($input / 1000);
if ($uSec < "100") { $uSec = ('0' . $uSec); }
if($uSec <= "9") { $uSec = ('0' . $uSec); }
$seconds = $input % 60;
if($seconds <= "9") { $seconds = ('' . $seconds); }
$input = floor($input / 60);
if($minutes < "9") { $minutes = ('' . $minutes); }
$minutes = $input % 60;
$input = floor($input / 60);
$worldrec = '+' . ($seconds . "." . $uSec);
$Q = '(Q)';
if ($hunsor > "7") { $Q = '';}
// Világrekord összehasonlítás
$wr = '';
if ($wrlap >= $lap) {$wr = ' WL';}
// Autó lekérdezés
//$cartype = ' ';
//$carname = ' ';
$cartype = ($data[$d]["car"]);
$courserecord = ($data[$d]["course_id"]);
include 'data/cartypes.php';
//$kiemelt = 'rgba(255, 255, 255)';
if ($replay == '3') {$replay = '';}
if ($replay == '2') {$replay = '';}
if ($replay == '1') {$replay = '';}
if ($replay == '0') {$replay = '';}
if ($replay == '') {$replay = '';}
//if ($korido >= $deltatime*1.25) {$qgap = 'NM'; $gap = 'NM';}
if ($hunsor == '0') {$deltatime = $lap; $gap = 'Delta';}
if ($hunsor < '12') {$qgap = '';}
if ($hunsor <= '2') {$kiemelt = 'background-color:rgba(204,0,255, 0.4);';}
if ($hunsor <= '500') {$kiemelt = 'background-color:rgba(77, 77, 77, 0.6);';}
//if ($hunsor >= '12') {$kiemelt = 'background-color:rgba(255,0,0, 0.4);';}
if ($hunsor == '11') {$kvalitime = $lap; $qgap = '(Q) Delta';}
//Maximum versenyző
if ($hunsor == $driverscount) {break;}
if ($userid == NULL) {break;}
if ($hunsor == '0') {$kiemelt = 'background-color:rgba(204,0,255, 0.4);';}
$DRGAP = $DRDELTA - $DR;
//$hunsor = ($hunsor+1) . '.';
//$sor = ($data[$d]["ema"]);
//$carpic = '';
$userid = ''. $userid . '';
$wr = '';
$textcolor = '';
$driving = "";
$plus = "";
if ($hunsor > '0') {$plus = "+";}
if ($hunsor == '0') {$DRGAP = "Leader";}
if ($DRBACKUP > $DR) {$DRCOLOR = 'color:red';$arrow = '⇩';}
if ($DRBACKUP < $DR) {$DRCOLOR = 'color:lime';$arrow = '⇧';}
$positions = $d - $d2;
$positions = abs($positions);
if ($positions == 0) {$positions = '';}
if ($DRBACKUP == $DR) {$DRCOLOR = 'color:lightgray';$arrow = '';if ($positions > 0) {$DRCOLOR = 'color:lightgray';$arrow = '';$positions = '';}}
$driving = "";
if ($totalkm > $totalkmbackup) {$driving = "";}
$dailykm = $totalkm - $totalkm24;
if ($dailykm == 0) {$dailykm = '-';}
$dailykm = '' . $dailykm . '';
$alloweddriver = "none";
for ($driv = 0; $driv <= 200; $driv++) {
$driversnr = ($jasondata[$driv][user_no]);
$drivertotalpoints = ($jasondata[$driv][total_points]);
if ($userno == $driversnr) {$alloweddriver = "true";break;}
//echo $driversnr;
//echo $userno;
}
if ($alloweddriver == "true") {
$driversrank = ($driv + 1);
$hunsor = ($hunsor+1) . '.';
if ($hunsor == "71") {break;}
$performance = ($hunsor / $driversrank) * 100;
$sportmanrate = ($SR + 1) / 100;
$performance = round($performance * $sportmanrate);
if ($performance < 40) {$performancecolor = "red";}
if ($performance >= 40) {$performancecolor = "yellow";}
if ($performance >= 80) {$performancecolor = "lime";}
if ($performance >= 100) {$performancecolor = "rgb(204,0,255)";}
//if ($performance > 200) {$performance = $performance -100; $performance = round(100*($driversrank-$hunsor)/$hunsor);$performance = $performance + 100;$performancecolor = "lime";}
if ($performance >= 130) {$performancecolor = "lime";}
if ($performance >= 170) {$performancecolor = "yellow";}
if ($performance >= 230) {$performancecolor = "red";}
if ($hunsor == '11') {
echo '' . '#' . '
| ' . '' . ' | ' . '' . ' | ' . 'Név/Márka/Egyesület' . ' | ' . 'DR/SR' . ' | ' . 'DR/SR pont/Km' . ' | ' . 'Info' . ' | ' . 'Perf.' . ' |
---|
';}
//else {$performancecolor = "red";}
$hunlist = $d +1;
echo '' . $hunsor . ' ' . '(' . $hunlist . '.)' . ' ' . $driversrank . '.' . '' . '' . ' | ' . $value . '
' . $country_name . ' ' . '
| ' . $profilkep . ' ' . $driving . ' | ' . $realnames . '
' . $brandimage . ' ' . $team . '' . '
' . $carname . '
' . $carpic . '
' . ' | ' . $rank . ' | ' . $DR . ' ' . '' . $plus . $DRGAP . '
' . '' . $SR . ' ' . $totalkm . '' .'km ' . ' ' . $dailykm .'km ' . '
| ' . $arrow . '
' . $positions . ' ' . $dailyresulta . $dailyresultb . $dailyresultc . '' . $nationsresult . '' . $manufactresult . ' | ' . $drivertotalpoints . '
' . $performance . '% |
---|
'; $DRDELTA = $DR; if ($wl !== NULL) {$hunsor = '1';}}
}
echo '';
echo "";
?>
Error reporting:
This email address is being protected from spambots. You need JavaScript enabled to view it.
GTSH-Rank © Race Online Hungary 2017