Moderators Parkho Posted November 2, 2016 Moderators Report Posted November 2, 2016 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: Quote
Moderators Parkho Posted November 2, 2016 Author Moderators Report Posted November 2, 2016 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> Quote
ShrikarG Posted November 2, 2016 Report Posted November 2, 2016 (edited) Works just awesome. Thank you very much for this module. Hoping for a similar module for IVAO too Edited November 2, 2016 by shrikar Quote
flyalaska Posted November 2, 2016 Report Posted November 2, 2016 Looks nice! I will have to give it a try this evening. Quote
flyalaska Posted November 2, 2016 Report Posted November 2, 2016 Is it possible to add your airline into the stats? example ALA Pilots Online: 12 Quote
Moderators Parkho Posted November 2, 2016 Author Moderators Report Posted November 2, 2016 Is it possible to add your airline into the stats? example ALA Pilots Online: 12 I'll look into it. Quote
Moderators Parkho Posted November 13, 2016 Author Moderators Report Posted November 13, 2016 Thanks! Unfortunately the json page used, doesn't provide specific airline status and I couldn't find a solid API for VATSIM statistics, so the answer to your Q is NO! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.