Guest User

Untitled

a guest
Jun 3rd, 2013
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. <?php
  2.  
  3. // Autoloader. Use SPL in a real project.
  4. foreach(array('Server', 'Stats') as $file) {
  5. include sprintf('MCServerStatus/Minecraft/%s.php', $file);
  6. }
  7.  
  8. $servers = array(
  9. "doscraft.eu",
  10. "pvp.doscraft.eu",
  11. "sb.doscraft.eu:42181",
  12. );
  13. $tablica = array(
  14. "DosCraft.eu [Survival + Frakcje] [1.5.2]",
  15. "DosCraft.eu [PvP] [1.5.2] [SurvivalGames]",
  16. "DosCraft.eu [SkyBlock] [1.5]",
  17. );
  18.  
  19.  
  20. echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
  21. echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='".$locale['xml_lang']."' lang='".$locale['xml_lang']."'>\n";
  22. echo "<head>\n<title>".$settings['sitename']."</title>\n";
  23. echo "<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."' />\n";
  24. echo "<meta name='description' content='".$settings['description']."' />\n";
  25. echo "<meta name='keywords' content='".$settings['keywords']."' />\n";
  26. ?>
  27. <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
  28.  
  29. <style>tr td,tr th {text-align:center !important}tr td.motd,tr th.motd{text-align:left !important;}</style>
  30. <style>.status{width:50px;}</style>
  31. <!-- HTML5 shim -->
  32. <!--[if lt IE 9]>
  33. <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  34. <![endif]-->
  35. </head>
  36. <body>
  37. <div class='container'>
  38. <div class='row'>
  39. <table class='table table-bordered table-striped'>
  40. <thead>
  41. <tr>
  42. <th class='status'>Status</th>
  43. <th class='motd'>Serwer:</th>
  44. <th>Gracze:</th>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. <?php foreach($servers as $server): ?>
  49. <?php $stats = \Minecraft\Stats::retrieve(new \Minecraft\Server($server)); ?>
  50. <tr>
  51. <td>
  52. <?php if($stats->is_online): ?>
  53. <span class='badge badge-success'><i class='icon-ok icon-white'></i></span>
  54. <?php else: ?>
  55. <span class='badge badge-important'><i class='icon-remove icon-white'></i></span>
  56. <?php endif; ?>
  57. </td>
  58. <?php foreach($tablica as $tab)?>
  59. <td class='motd'><?php echo $tab;?> <code><?php echo $server; ?></code></td>
  60. <td><?php printf('%u/%u', $stats->online_players, $stats->max_players); ?></td>
  61. </tr>
  62. <?php unset($stats); ?>
  63. <?php endforeach; ?>
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. </body>
  69. </html>
Advertisement
Add Comment
Please, Sign In to add comment