END; foreach( $all_servers as $server ) { //array_walk( $server, 'htmlspecialchars', 'ENT_QUOTES' ); echo "\t\t\t" . '' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; echo "\t\t\t\t' . PHP_EOL; if ( $server['country'] !== '' ) { $flagfile = 'flags/' . strtolower( $server['country'] ).'.png'; if ( file_exists( $flagfile ) ) { echo "\t\t\t\t' . PHP_EOL; } else { echo "\t\t\t\t' . PHP_EOL; } } else { echo "\t\t\t\t' . PHP_EOL; } $calculatedStatus = $server['status']; if($calculatedStatus == 0) { $gameFull = ($server['networkSlots'] <= $server['connectedClients']); if($gameFull == true) { $calculatedStatus = 1; } } switch($calculatedStatus) { case 0: echo "\t\t\t\t' . PHP_EOL; break; case 1: echo "\t\t\t\t' . PHP_EOL; break; case 2: echo "\t\t\t\t' . PHP_EOL; break; case 3: echo "\t\t\t\t' . PHP_EOL; break; default: echo "\t\t\t\t' . PHP_EOL; } echo "\t\t\t" . '' . PHP_EOL; } unset( $all_servers ); unset( $server ); echo << END; ?>
glestVersion platform binaryCompileDate serverTitle ip tech map tileset activeSlots networkSlots connectedClients externalServerPort country status
" . htmlspecialchars( $server['glestVersion'], ENT_QUOTES ) . '" . htmlspecialchars( $server['platform'], ENT_QUOTES ) . '" . htmlspecialchars( $server['binaryCompileDate'], ENT_QUOTES ) . '" . htmlspecialchars( $server['serverTitle'], ENT_QUOTES ) . '" . htmlspecialchars( $server['ip'], ENT_QUOTES ) . '" . htmlspecialchars( $server['tech'], ENT_QUOTES ) . '" . htmlspecialchars( $server['map'], ENT_QUOTES ) . '" . htmlspecialchars( $server['tileset'], ENT_QUOTES ) . '" . htmlspecialchars( $server['activeSlots'], ENT_QUOTES ) . '" . htmlspecialchars( $server['networkSlots'], ENT_QUOTES ) . '" . htmlspecialchars( $server['connectedClients'], ENT_QUOTES ) . '" . htmlspecialchars( $server['externalServerPort'], ENT_QUOTES ) . '" . '' . $server['country'] . ' country flag' . '" . 'unknown' . '" . htmlspecialchars( $server['country'], ENT_QUOTES ) . '" . htmlspecialchars( "waiting for players", ENT_QUOTES ) . '" . htmlspecialchars( "game full, pending start", ENT_QUOTES ) . '" . htmlspecialchars( "in progress", ENT_QUOTES ) . '" . htmlspecialchars( "finished", ENT_QUOTES ) . '" . htmlspecialchars( "unknown: " . $server['status'], ENT_QUOTES ) . '