Jump to content

Recommended Posts

Posted

So I've been asking around for a while now and I've seen others doing the same on how to take pilot data off vatsim and display it on their website.

So I googled and finally, after about 3 months of hunting found a script called "VatsimPHP". Its freeware and easy to use.

If you dont know much about php, the online manual helps alot.

Link: http://www.bbflights.com/VatsimPHP/

-Thomas.

  • Moderators
Posted

Yeh thats what we use to display from Vatsim, we have used it on another server and embedded it in to the tpl either as embed object or iframe cant remember off the top of my head now.

But yeh its real easy to get what you want to display.

  • 7 months later...
Posted

This code is working in my VA, just replace spanish words to english and TPR icao.

<?php

require_once("VatsimPHPgenerator.php");

$VatsimPHP=new VatsimPHP;

echo "<CENTER><FONT SIZE=\"3\"><B><U>Pilotos en Vuelo Conectados a VATSIM</U></B></FONT></CENTER>";

echo "<TABLE WIDTH=\"100%\" CELLSPACING=\"0\" CELLPADDING=\"0\">";

$pilotlist=$VatsimPHP->airline(array("TPR"));

for($i = 0; $i < count($pilotlist); $i++)

{

echo "<TR><TD WIDTH=\"100%\" STYLE=\"border: 1 solid #003C00\"><TABLE WIDTH=\"100%\" CELLSPACING=\"0\" CELLPADDING=\"0\">";

echo "<TR><TD WIDTH=\"100%\" COLSPAN=\"4\" BGCOLOR=\"#DDDDDD\">   <FONT SIZE=\"2\"><B>".$pilotlist[$i][2]."</B></FONT></TD></TR>";

echo "<TR><TD WIDTH=\"20%\" ROWSPAN=\"3\" VALIGN=\"TOP\" ALIGN=\"CENTER\" STYLE=\"border: 1 solid #DDDDDD\"><FONT SIZE=\"1\"><A HREF=\"http://www.vataware.com/pilotredir.cfm?cid=".$pilotlist[$i][1]."\">".$pilotlist[$i][0]."</A><BR>";

if($pilotlist[$i][9])

{

echo $pilotlist[$i][9];

}

echo "<BR>";

if($pilotlist[$i][21])

{

echo $pilotlist[$i][21]."FR";

}

echo "</FONT></TD>";

echo "<TD WIDTH=\"20%\" STYLE=\"border: 1 solid #DDDDDD\"><FONT SIZE=\"1\">".$pilotlist[$i][8]." KT</FONT></TD>";

echo "<TD WIDTH=\"10%\" VALIGN=\"TOP\" ROWSPAN=\"7\" STYLE=\"border: 1 solid #DDDDDD\"><FONT SIZE=\"1\">".$pilotlist[$i][11]."<BR>".$pilotlist[$i][13]."<BR><BR>".$pilotlist[$i][28]."</FONT></TD>";

echo "<TD WIDTH=\"50%\" VALIGN=\"TOP\" ROWSPAN=\"5\" STYLE=\"border: 1 solid #DDDDDD\"><FONT SIZE=\"1\">";

if($pilotlist[$i][30])

{

echo $pilotlist[$i][30]."<BR><BR><B>RMK:</B> ".$pilotlist[$i][29];

}

echo "</FONT></TD></TR>";

echo "<TR><TD WIDTH=\"20%\" STYLE=\"border: 1 solid #DDDDDD\"><FONT SIZE=\"1\">".$pilotlist[$i][7]." FT</FONT></TD></TR>";

echo "<TR><TD WIDTH=\"20%\" STYLE=\"border: 1 solid #DDDDDD\"><FONT SIZE=\"1\">".$pilotlist[$i][12]."</FONT></TD></TR>";

echo "</TABLE></TD></TR>";

}

if(count($pilotlist) == "0")

{

echo "<TR><TD WIDTH=\"100%\" COLSPAN=\"2\" ALIGN=\"CENTER\"><FONT SIZE=\"1.5\">Por el momento no hay Pilotos en Vuelo.</FONT></TD></TR>";

}

echo "</TABLE>";

?>

Posted

I will probably get in trouble and forced to take it off but the files are available on www.fspaintshop.com, so get them while you can. I included and example read me in the directory. Do not change the name of the included directory. Just unzip and put the directory on your server.

Posted

I forgot to include one file, the most important one that makes it work..LOL sorry...re download to get it. the vatsimPHPgenerater.php wasn't in the download and you need that outside of the directory on your server to work. You implement this using the example i included.

Posted

How do I implement this? I used the code posted above, but keep getting erros, and no idea how to fix them. There was no example text file included in the download.

  • Moderators
Posted

Im not at home at the moment, basically all you need is the files,

Create a folder in your root, vatstats or something, then in that you need another folder vatsimphpfiles, in there you have blank text files for airports.txt customization.txt,metars.txt,satnet-data.txt and status.txt, make them all 764 (permissions).

Then you should have the following files in your vatstats folder,

all.php

vatpilots.php

vatsimnow.php

VatsimPHPgenerator.php

To display on your pages, just do an include or iframe,

So,

<iframe id="Vatsim" src="http://yoursource.com/vatstats/all.php" width=680px height=300px marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=yes></iframe>

These files All can be customized to display your callsigns only or everyone on vatsim.

Posted

can anybody help me?

where can I get these files:

all.php

vatpilots.php

vatsimnow.php

PM me with your e-mail and i'll send you the files with some little instructions.

Regards

  • 2 weeks later...
Posted

I got the email, but the files you sent me are the ones I got from simpilot. Would like to get the, all.php, vatpilots.php and vatsimnow.php

These files I search, but finding nothing

Posted

Dear all, just we know those files are very difficult to find, i explain in PM messages when i offer my help i thought you need just the vatsimphp generator and other files included in my e-mails. Once again i apologize for this misunderstanding, i'm still looking for the files to send.

Regards

  • 2 weeks later...
Posted

Ok, The directory "VatsimPHPfiles" goes in your site root directory, it should only contain the .txt files. The file VatsimPHPgenerator.php also goes in your site root by itself, not in any directory.

Here is an example of how I use it.

<?php

require_once("VatsimPHPgenerator.php");

$VatsimPHP=new VatsimPHP;

$pilotlist=$VatsimPHP->airline("put your va's call letters here");

for($i = 0; $i < count($pilotlist); $i++)

{

     echo '<p>';

	echo $pilotlist[$i][0].':';

	echo $pilotlist[$i][2];

	echo '</p>';



}

if(count($pilotlist) == "0")

{

	echo "<p>Currently no operations</p>";

}

?>

Posted (edited)

I am getting these errors:

[b]Warning[/b]:  copy() [[url="http://malaysiava.org/function.copy"]function.copy[/url]]: URL file-access is disabled in the server configuration in [b]/home/globalai/public_html/malaysiava.org/VatsimPHPgenerator.php[/b] on line [b]63[/b]

[b]Warning[/b]:  copy(http://info.vroute.net/vatsim-data.txt) [[url="http://malaysiava.org/function.copy"]function.copy[/url]]: failed to open stream: no suitable wrapper could be found in [b]/home/globalai/public_html/malaysiava.org/VatsimPHPgenerator.php[/b] on line [b]63[/b]

[b]Warning[/b]:  copy() [[url="http://malaysiava.org/function.copy"]function.copy[/url]]: URL file-access is disabled in the server configuration in [b]/home/globalai/public_html/malaysiava.org/VatsimPHPgenerator.php[/b] on line [b]65[/b]

[b]Warning[/b]:  copy(http://www.klain.net/sidata/vatsim-data.txt) [[url="http://malaysiava.org/function.copy"]function.copy[/url]]: failed to open stream: no suitable wrapper could be found in [b]/home/globalai/public_html/malaysiava.org/VatsimPHPgenerator.php[/b] on line [b]65[/b] 

How do I fix them?

Edited by nightfox
  • 2 months later...
Posted

i become the failure

Warning: copy(VatsimPHPfiles/satnet-data.txt) [function.copy]: failed to open stream: Permission denied in /www/htdocs/w00dac26/lausitzair/lib/skins/ObsessBlue/VatsimPHPgenerator.php on line 63

Warning: copy(VatsimPHPfiles/satnet-data.txt) [function.copy]: failed to open stream: Permission denied in /www/htdocs/w00dac26/lausitzair/lib/skins/ObsessBlue/VatsimPHPgenerator.php on line 65

can anybode help me

the vatsimphpfiles are in the root of my site and the vatsimphpgenerator is in the skin folder

thx

  • 3 months later...
Posted

G'day,

I would like to display an amount for all pilots an ATC, as well as my pilots online on vatsim using this code, how would i got about displaying the pilots and ATC online ?

I've seen it done before, i'm not sure how it was done though.

Also, I've just tried this code

<?php

require_once("VatsimPHPgenerator.php");

$VatsimPHP=new VatsimPHP;

$pilotlist=$VatsimPHP->airline("put your va's call letters here");

for($i = 0; $i < count($pilotlist); $i++)

       {

            echo '<p>';

               echo $pilotlist[$i][0].':';

               echo $pilotlist[$i][2];

               echo '</p>';



       }

if(count($pilotlist) == "0")

       {

               echo "<p>Currently no operations</p>";

       }

?>

I would like to display an amount of pilots, not every pilot with that callsign, how can i edit this to display a number for the amount of pilots online ?

Cheers

Tylor

Posted

I have the following warning on my page:

Warning: copy() [function.copy]: Filename cannot be empty in /home/xxxx/xxxxx/VatsimPHPgenerator.php on line 63

Warning: copy() [function.copy]: Filename cannot be empty in /home/xxxxx/xxxxx/VatsimPHPgenerator.php on line 65

Any have a solution, all was working good untill two weeks ago, and realy don`t now how solve this problem.

Regards

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...