Jump to content

Vatsim Statistics


Parkho

Recommended Posts

  • Moderators

A module for phpVMS to view Vatsim Live Statistics

---------------------------------------------------

Install:

1. Download at Github.

2. Upload to your site in folder's order.

3. Access using the following code:

<?php echo url('/vatsimstats') ;?>

4. Enjoy!

*The <div> element refreshes every 3 second which can be modified to desired time.

*This is for phpVMS 5.5x version by Simpilot.

---------------------------------------------------

Demo:

At my website http://www.parkho.ir

---------------------------------------------------

Support:

Use "Contact Me" at my website http://www.parkho.ir

Screenshot:

vs.png

Link to comment
Share on other sites

  • Moderators

Use the following code anywhere you want. You'll just need to position the <div>:

<?php
$json = file_get_contents("https://stats.vatsim.net/user_count_json.php");
$data = json_decode($json, true);
$pilots = $data['pilots'];
$controllers = $data['controllers'];
$atis = $data['atis'];
$observers = $data['observers'];
$supervisors = $data['supervisors'];
$total = $data['total'];
?>
<h3 style="margin-left: 80px; margin-top: 75px;">Vatsim Online Users</h3>
<div id="vs" style="border: solid 3px; padding: 25px; border-radius: 5px;" class="container">
<ul class="blocklist">
 <li>Pilots : <?php echo $pilots;?></li>
 <li>Controllers : <?php echo $controllers;?></li>
 <li>Atis : <?php echo $atis;?></li>
 <li>Observers : <?php echo $observers;?></li>
 <li>Supervisors : <?php echo $supervisors;?></li>
 <li>Total : <?php echo $total;?></li>	   
</ul>
</div>
<script type="text/javascript">
function liveflight(){
 $("#vs").load(location.href + " #vs>*", "");
}
setInterval(function(){liveflight()}, 3000);
</script>

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...