Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>TruckersMP Status</title>
- <link rel="icon" type="image/png" href="https://truckersmp.com/assets/images/favicon.png"/>
- <style>
- body {
- background: #ffffff;
- text-align: center;
- font-family: arial;
- margin: 0px auto;
- padding: 0px;
- }
- .main {
- width: 300px;
- height: 175px;
- background: #ffffff;
- margin: 25px 2px auto;
- border: solid 2px #000000;
- padding: 10px;
- display:inline;
- float: left;
- text-align: left;
- right: -50%;
- transform: translate(50%, -0%);
- }
- h1 {
- text-align: center;
- font-size: 34pt;
- color: #000000;
- }
- h2 {
- text-align: center;
- font-size: 18pt;
- color: #4c4c4c;
- }
- hr {
- height: solid 2px;
- color: #000000;
- }
- p {
- font-size: 16pt;
- text-align: left;
- text-indent: 48px;
- color: #000000;
- }
- a {
- font-size: 6pt;
- text-align: left;
- text-indent: 48px;
- color: #0000ff;
- }
- .fit {
- max-width: 100%;
- max-height: 100%;
- }
- .w {
- color: #d0d0d0;
- }
- </style>
- </head>
- <body>
- <br>
- <img class="fit" src="https://truckersmp.com/assets/img/truckersmp-logo-black.png" width="600" height="auto">
- <h1>TruckersMP Status Template</h1>
- <h2>By SgtBreadStick</h2>
- <hr>
- <?php
- $servers = json_decode(file_get_contents("https://www.trucknet.biz/truckersmp_api.php"), true);
- ?>
- <?php
- foreach($servers['response'] as $serv){
- if($serv['online']){
- $status = '<strong><font color="green">Online</font></strong>';
- } else {
- $status = '<strong><font color="red">Offline</font></strong>';
- }
- if($serv['collisions']){
- $collisions = '<font color="green">Enabled</font>';
- } else {
- $collisions = '<font color="red">Disabled</font>';
- }
- echo '
- <div style="width: 100%;" class="fit">
- <div class="main" class="fit">
- <h3>'. $serv['name'] . ' / '. $serv['shortname'] .' - ' . $serv['game'] .'</h3><hr>
- Players: '. $serv['players'] .' / '. $serv['maxplayers'] .'<br />
- Queue: '. $serv['queue'] .'<br />
- Status: '. $status .'<br />
- Collisions: '. $collisions .'<br />
- </div></div>';
- }
- ?>
- <a href="https://pastebin.com/BkjXXAMe" class="w" target="_blank">Click Here For Page Source Code</a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement