Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Autoloader. Use SPL in a real project.
- foreach(array('Server', 'Stats') as $file) {
- include sprintf('MCServerStatus/Minecraft/%s.php', $file);
- }
- $servers = array(
- "doscraft.eu",
- "pvp.doscraft.eu",
- "sb.doscraft.eu:42181",
- );
- $tablica = array(
- "DosCraft.eu [Survival + Frakcje] [1.5.2]",
- "DosCraft.eu [PvP] [1.5.2] [SurvivalGames]",
- "DosCraft.eu [SkyBlock] [1.5]",
- );
- echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
- echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='".$locale['xml_lang']."' lang='".$locale['xml_lang']."'>\n";
- echo "<head>\n<title>".$settings['sitename']."</title>\n";
- echo "<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."' />\n";
- echo "<meta name='description' content='".$settings['description']."' />\n";
- echo "<meta name='keywords' content='".$settings['keywords']."' />\n";
- ?>
- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
- <style>tr td,tr th {text-align:center !important}tr td.motd,tr th.motd{text-align:left !important;}</style>
- <style>.status{width:50px;}</style>
- <!-- HTML5 shim -->
- <!--[if lt IE 9]>
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
- </head>
- <body>
- <div class='container'>
- <div class='row'>
- <table class='table table-bordered table-striped'>
- <thead>
- <tr>
- <th class='status'>Status</th>
- <th class='motd'>Serwer:</th>
- <th>Gracze:</th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($servers as $server): ?>
- <?php $stats = \Minecraft\Stats::retrieve(new \Minecraft\Server($server)); ?>
- <tr>
- <td>
- <?php if($stats->is_online): ?>
- <span class='badge badge-success'><i class='icon-ok icon-white'></i></span>
- <?php else: ?>
- <span class='badge badge-important'><i class='icon-remove icon-white'></i></span>
- <?php endif; ?>
- </td>
- <?php foreach($tablica as $tab)?>
- <td class='motd'><?php echo $tab;?> <code><?php echo $server; ?></code></td>
- <td><?php printf('%u/%u', $stats->online_players, $stats->max_players); ?></td>
- </tr>
- <?php unset($stats); ?>
- <?php endforeach; ?>
- </tbody>
- </table>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment