joeholden Posted June 29, 2013 Report Share Posted June 29, 2013 Hello, I'm struggling to get around this, but is there an API or a piece of code I can use to place a pre-file flight plan button on the flight briefing page? Any help appreciated! Quote Link to comment Share on other sites More sharing options...
magicflyer Posted June 29, 2013 Report Share Posted June 29, 2013 I am unsure of what is being asked, so I am going to include both options. If you are looking into adding a link to vatsim.net/fp in your pilot center you need to simply add the following line of code at whichever location you desire it to be added in your .tpl file which can be found in core/templates: <a href="http://vatsim.net/fp">Click here to file vatsim flight plan</a> If you are looking into directly filing a vatsim flight plan through your website using a one click button That will not work due to Vatsim's high security. However, Vatsim does allow you to prefill form data in the flight plan. To do so you need to post variables through the URL to be passed to the vatsim server. These are pretty much GET variables, if you know what those are. Take a look at this page: http://www.vatsim.net/fp/ If you look closely you will notice numbers next to each field(ex: Type has the number 1, Cruising altitude has the number 7) These numbers are the names of the variables that need to be passed in the url. We pass these variables in this format: http://www.vatsim.ne...index.php?fpc=2=SKY7790 In the example above we passed in the value 'SKY7790' to the 2nd key which is the key for the Callsign field. Additional variables can be passed in by building up on that url by adding &3=B737 or &4=250, etc... This will work to fields that require a text value. Radio buttons are a bit different. The IFR/VFR fields accepts the values I and V (Capital i and v) so, &1=I will check the IFR radio button, and &1=V will check the VFR radio button Here is a compete query that you can work with: http://www.vatsim.net/fp/index.php?fpc=&1=V&2=SKY7790&3=B737&4=250&5=LQSA&6=1552&7=FL140&8=BOSNA&9=LQBK&10a=00&10b=48&&11=RTF=Yourva%20/www.yourva.com&12a=01&12b=47&13=LQTZ&14=Ryan%20Rinaldi%20KSFO 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.