| 1 |
sf-dustfinger |
1.1 |
<div id="linkBar"> |
| 2 |
sf-dustfinger |
1.2 |
<a href='index.html'>Home</a> |
| 3 |
|
|
<a href='about.html'>About</a> |
| 4 |
|
|
<a href='download.html'>Download</a> |
| 5 |
sf-dustfinger |
1.4 |
<a href='highscores.html'>High Scores</a> |
| 6 |
sf-dustfinger |
1.1 |
<a href='#'>Contact</a> |
| 7 |
sf-dustfinger |
1.4 |
|
| 8 |
|
|
<?php |
| 9 |
|
|
$jsonScoresUnparsed = file_get_contents("recent.json"); |
| 10 |
|
|
|
| 11 |
|
|
$jsonArray = json_decode($jsonScoresUnparsed); |
| 12 |
|
|
|
| 13 |
|
|
$timestamp = $jsonArray->date; |
| 14 |
|
|
$version = $jsonArray->version; |
| 15 |
|
|
$players = $jsonArray->data; |
| 16 |
|
|
|
| 17 |
|
|
$onlineCount = 0; |
| 18 |
|
|
foreach($players as $player) |
| 19 |
|
|
{ |
| 20 |
|
|
$lastLogout = $player[4]; |
| 21 |
|
|
if($lastLogout==null) |
| 22 |
|
|
{ |
| 23 |
|
|
$onlineCount++; |
| 24 |
|
|
} |
| 25 |
|
|
else |
| 26 |
|
|
{ |
| 27 |
|
|
break; //Stop searching. |
| 28 |
|
|
} |
| 29 |
|
|
} |
| 30 |
|
|
|
| 31 |
|
|
echo "<a style='float: right;' href='recent.html'>$onlineCount Players Online</a>\n"; |
| 32 |
|
|
?> |
| 33 |
|
|
|
| 34 |
sf-dustfinger |
1.1 |
</div> |