Administrators simpilot Posted September 24, 2011 Administrators Report Share Posted September 24, 2011 Vatsim Data Reader phpVMS module to display online pilot and atc data for a phpVMS based virtual airline. Released under the following license: Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License A visible link to http://www.simpilotgroup.com must be provided on any webpage utilizing this script for the license to be valid. Developed by: simpilot www.simpilotgroup.com Developed on: phpVMS v2.1.934-158 php 5.3.4 mysql 5.0.7 apache 2.2.17 Install: -Download the attached package. -unzip the package and place the files as structured in your root phpVMS install. core --modules ----Vatsim ------Vatsim.php --templates ----vatsim ------vatsim.tpl The module will download a text data file using cURL from one of four random Vatsim servers and place it in the root of your install. When the data is called the script will check to see if the data is over 5 minutes old, if so it will refresh the data with a new file. Usage: To show a list of Vatsim online pilot data: The last parameter is the id of the airline you are searching for and would like to display. If you want to show everyone online leave an empty set of single quotes - '' <?php MainController::Run('Vatsim', 'create_vatsim_data', '!CLIENTS:', 'PILOT', ''); ?> If you want to show all online pilots of one airline use the icao (ex 'AAL') <?php MainController::Run('Vatsim', 'create_vatsim_data', '!CLIENTS:', 'PILOT', 'AAL'); ?> If you want to show the online pilots of multiple airlines use an array <?php MainController::Run('Vatsim', 'create_vatsim_data', '!CLIENTS:', 'PILOT', array('AAL', 'UAL', 'SWA')); ?> To show a count of Vatsim online pilots, the last parameter is used just as the function above <?php echo MainController::Run('Vatsim', 'count_vatsim_data', '!CLIENTS:', 'PILOT', ''); ?> To show a list of Vatsim online atc controllers: <?php MainController::Run('Vatsim', 'create_vatsim_data', '!CLIENTS:', 'ATC', ''); ?> To show a count of Vatsim online atc controllers <?php echo MainController::Run('Vatsim', 'count_vatsim_data', '!CLIENTS:', 'ATC', ''); ?> The vatsim.tpl file simply shows all the available data to you in a list for each dataset available. You can display what info you would like and build it into a list, table, or anything else you would like for your site. Code Hosted On Github - Link In My Signature 4 Quote Link to comment Share on other sites More sharing options...
Strider Posted September 24, 2011 Report Share Posted September 24, 2011 Works great, is it possible to show online pilots for multiple airlines, like 5 different ones? Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted September 24, 2011 Moderators Report Share Posted September 24, 2011 Were can we add these lines? Because i am having a problem Here. Quote Link to comment Share on other sites More sharing options...
dimitris Posted September 24, 2011 Report Share Posted September 24, 2011 @servetas Into some .tpl where you like the board to be shown insert this line: <?php MainController::Run('Vatsim', 'create_vatsim_data', '!CLIENTS:', 'PILOT', 'ICAO CODE GOES HERE'); ?> Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted September 25, 2011 Author Administrators Report Share Posted September 25, 2011 @MrBean - I have updated the module to accept an array of airline icao's to display multiple airlines. The original download has been updated. The only file changed is the core/modules/Vatsim/Vatsim.php file so you do not have to update any templates you have already created. @servtas - As dimitris shows in his post, the module does not have a full page display function, it is built similar to the native news feed module and is designed to be inbeded into an existing page or a page you create for it. Quote Link to comment Share on other sites More sharing options...
Tylor Eddy Posted September 26, 2011 Report Share Posted September 26, 2011 Works Great Simpilot! Thanks very much for creating this module, just what I've been looking for Keep up the good work Tylor Quote Link to comment Share on other sites More sharing options...
Rickisani Posted October 21, 2011 Report Share Posted October 21, 2011 Were can we add these lines? Because i am having a problem Here. I also have a problem with the same error. how can you fix it in row 218 is at MainController.class.php: $ret = call_user_func_array(array($$ModuleName, $call_function), CodonRewrite::$params); --------------------------- sorry I done something wrong to the code (<php main controller:: run ('Vatsim', 'count_vatsim_data'? 'CLIENTS:'? 'PILOT', 'AAL')>) was added and there is only watch one (1) where is the rest Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 21, 2011 Author Administrators Report Share Posted October 21, 2011 Looks like you have gotten the code a little mixed up; <php main controller:: run ('Vatsim', 'count_vatsim_data'? 'CLIENTS:'? 'PILOT', 'AAL')> should be <?php MainController::Run('Vatsim', 'create_vatsim_data', '!CLIENTS:', 'PILOT', 'AAL'); ?> Quote Link to comment Share on other sites More sharing options...
kbohme Posted October 22, 2011 Report Share Posted October 22, 2011 i keep getting this error Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'Vatsim' does not have a method 'index' in C:\xampp\htdocs\vms\core\classes\MainController.class.php on line 218 (I get nothing using <?php MainController::Run('Vatsim', 'create_vatsim_data', '!CLIENTS:', 'PILOT', 'AAL'); ?> in a .tpl, when I call the included vatsim.tpl directly I get that error) Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 23, 2011 Author Administrators Report Share Posted October 23, 2011 Is the vatsimdata.txt file being saved to your server and if so does it have anything in it? Quote Link to comment Share on other sites More sharing options...
kbohme Posted October 25, 2011 Report Share Posted October 25, 2011 i can't seem to find the text file on my server, where is it suppost to be ? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 25, 2011 Author Administrators Report Share Posted October 25, 2011 The text file should be getting saved to the root of the site. If it does not exist then the module has not been able to download a new copy for some reason. Quote Link to comment Share on other sites More sharing options...
kbohme Posted October 26, 2011 Report Share Posted October 26, 2011 Thanks I will look into that...perhaps its a permission thing. I will keep you posted. Quote Link to comment Share on other sites More sharing options...
CPC900 Posted October 29, 2011 Report Share Posted October 29, 2011 I get: Warning: fopen(vatsimdata.txt) [function.fopen]: failed to open stream: Permission denied in /home/woodsdom/public_html/CPC/core/modules/Vatsim/Vatsim.php on line 31 Warning: fwrite(): supplied argument is not a valid stream resource in /home/woodsdom/public_html/CPC/core/modules/Vatsim/Vatsim.php on line 32 Warning: fclose(): supplied argument is not a valid stream resource in /home/woodsdom/public_html/CPC/core/modules/Vatsim/Vatsim.php on line 33 Warning: file(vatsimdata.txt) [function.file]: failed to open stream: No such file or directory in /home/woodsdom/public_html/CPC/core/modules/Vatsim/Vatsim.php on line 36 Warning: Invalid argument supplied for foreach() in /home/woodsdom/public_html/CPC/core/modules/Vatsim/Vatsim.php on line 39 I am guessing it is a permission thing, or no?! Quote Link to comment Share on other sites More sharing options...
kbohme Posted October 30, 2011 Report Share Posted October 30, 2011 well actually, the server I am using has been down for the last 3 days and continues to be having problems so I haven't been able to test it. I will let you know. Thanks for the interest. Quote Link to comment Share on other sites More sharing options...
CPC900 Posted October 31, 2011 Report Share Posted October 31, 2011 I deleted the vatsim files and reinstalled fresh, and now the error I get is: Notice: The template file "/home/woodsdom/public_html/CPC//core/templates/vatsim.tpl" doesn't exist in /home/woodsdom/public_html/CPC/core/classes/TemplateSet.class.php on line 248 What the heck am I missing?! After it gave me that error, I copied the vatsim.tpl file into the /core/templates/ directory, just to check(because it installs to the /core/templates/vatsim directory by default, and it came up on the page with the log data for AAL (because I was just testing the default AAL ) and I got this on the screen: row_info 0 callsign-> = AAL109 row_info 1 cid-> = 1089801 row_info 2 realname-> = Benjimann Law VHHH row_info 3 clienttype-> = PILOT row_info 4 frequency-> = row_info 5 latitude-> = 42.29617 row_info 6 longitude-> = -70.83425 row_info 7 altitude-> = 2699 row_info 8 groundspeed-> = 287 row_info 9 planned_aircraft-> = T/B752/F row_info 10 planned_tascruise-> = 500 row_info 11 planned_depairport:-> = EGLL row_info 12 planned_altitude:-> = 37000 row_info 13 planned_destairport:-> = KBOS row_info 14 server:-> = USA-N row_info 15 protrevision:-> = 100 row_info 16 rating:-> = 1 row_info 17 transponder:-> = 2200 row_info 18 facilitytype:-> = row_info 19 visualrange:-> = row_info 20 planned_revision:-> = 2 row_info 21 planned_flighttype:-> = I row_info 22 planned_deptime:-> = 0 row_info 23 planned_actdeptime:-> = 712 row_info 24 planned_hrsenroute:-> = 0 row_info 25 planned_minenroute:-> = 0 row_info 26 planned_hrsfuel:-> = 0 row_info 27 planned_minfuel:-> = 0 row_info 28 planned_altairport:-> = KJFK row_info 29 planned_remarks:-> = row_info 30 planned_route:-> = CPT UL9 KENET UN14 BAKUR DCT RESNO 56N200W 56N300W 56N400W 55N500W OYSTR STEAM N220B TOPPS SCUPP row_info 31 planned_depairport_lat:-> = 0 row_info 32 planned_depairport_lon:-> = 0 row_info 33 planned_destairport_lat:-> = 0 row_info 34 planned_destairport_lon:-> = 0 row_info 35 atis_message:-> = row_info 36 time_last_atis_received:-> = row_info 37 time_logon:-> = 20111031060131 row_info 38 heading:-> = 309 row_info 39 QNH_iHg:-> = 30.398 row_info 40 QNH_Mb:-> = 1029 ------- So, I assume that should have gone into the "vatsimdata.txt" file. Man, I am getting frustrated. Things that should be easy seem to be made hard by my lack of intellect Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 31, 2011 Author Administrators Report Share Posted October 31, 2011 That is all the vatsim template shows, the information that it is finding. You can build that into a foreach loop and build a table or list with the data that you choose. Quote Link to comment Share on other sites More sharing options...
CPC900 Posted October 31, 2011 Report Share Posted October 31, 2011 ah, ok. Got it. Quote Link to comment Share on other sites More sharing options...
freshJet Posted December 8, 2011 Report Share Posted December 8, 2011 Is there a way to restrict ATC to certain airports or region? For example, only show online ATC in Europe? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted December 8, 2011 Author Administrators Report Share Posted December 8, 2011 Not as yet, you could just sort the returned array on the fly to pull out the lines you want. Quote Link to comment Share on other sites More sharing options...
Jeff Posted December 9, 2011 Report Share Posted December 9, 2011 Dave, I've never used anything like this before. Can you give me an example on how to pull data out and place it in a table. Say if I wanted to know the pilot, flight number, dep/arr airport, and altitude? Quote Link to comment Share on other sites More sharing options...
freshJet Posted December 9, 2011 Report Share Posted December 9, 2011 Dave, I've never used anything like this before. Can you give me an example on how to pull data out and place it in a table. Say if I wanted to know the pilot, flight number, dep/arr airport, and altitude? <?php echo "<b>Pilot:</b> $row_info[2] [$row_info[4]]<br>"; echo "<b>Flight:</b> $row_info[4]<br>"; echo "<b>Name:</b> $row_info[2] ($row_info[1])<br>"; echo "<b>Route:</b> $row_info[11] to $row_info[13]<br>"; echo "<b>Altitude:</b> $row_info[7]<br>"; ?> Quote Link to comment Share on other sites More sharing options...
Jeff Posted December 9, 2011 Report Share Posted December 9, 2011 That makes more since than the way I was trying to do it. Thanks Iain 1 Quote Link to comment Share on other sites More sharing options...
Kieran Jones Posted March 18, 2012 Report Share Posted March 18, 2012 when i click get code it says 404 error on GitHub... can everyone else access it? Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted March 18, 2012 Moderators Report Share Posted March 18, 2012 David changed his username or something. Check simpilot's signature for his modules. http://github.com/DavidJClark Quote Link to comment Share on other sites More sharing options...
Kieran Jones Posted March 18, 2012 Report Share Posted March 18, 2012 Ahhh thanks worked now cheers man ! Quote Link to comment Share on other sites More sharing options...
Josf Posted April 17, 2012 Report Share Posted April 17, 2012 hi, thank´s How i can download It? Quote Link to comment Share on other sites More sharing options...
JustinRomaine Posted May 20, 2012 Report Share Posted May 20, 2012 Im trying to play with this how am i supost to set it up. heres what im trying to do but the code is not right. <table cellspacing="0" cellpadding="5" border="0" width="100%"><thead class="fparr"> <td width="14%">Call Sign</td> <td width="11%">CID</td> <td width="17%">Real Name</td> <td width="21%">Frequency</td> <td width="35%">Atis Message</td><td width="2%"></thead><tbody> <? </tbody></table> Simmer to that trying to get the data in each colom do i edit the templet file or am i able to put the eco... part php in the coloms to get it to show that way or hows it work or if some one go do it for me that would be great thanks Quote Link to comment Share on other sites More sharing options...
freshJet Posted May 20, 2012 Report Share Posted May 20, 2012 Im trying to play with this how am i supost to set it up. heres what im trying to do but the code is not right. <table cellspacing="0" cellpadding="5" border="0" width="100%"><thead class="fparr"> <td width="14%">Call Sign</td> <td width="11%">CID</td> <td width="17%">Real Name</td> <td width="21%">Frequency</td> <td width="35%">Atis Message</td><td width="2%"></thead><tbody> <? </tbody></table> Simmer to that trying to get the data in each colom do i edit the templet file or am i able to put the eco... part php in the coloms to get it to show that way or hows it work or if some one go do it for me that would be great thanks http://forum.phpvms.net/topic/5946-vatsim-data-reader/page__view__findpost__p__43380 Quote Link to comment Share on other sites More sharing options...
JustinRomaine Posted May 21, 2012 Report Share Posted May 21, 2012 Ok I've tried that and didn't work do I need to set it to include the vatsim.tlp file so it knows were it's pulling the information? Quote Link to comment Share on other sites More sharing options...
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.