Jump to content

vroute vatsim id pull code help


Strider

Recommended Posts

I have some code to put the vatsim id into a txt file and need some help. I have put the following code into the pilots_list.tpl where the vatsim id is place, and it works, but only puts one vatsim id into the text file.

$vroute = fopen("vroute.txt", "w") or die("Unable to open file!");
        $txt = $fieldvalue."\n";
        fwrite($vroute, $txt);
        fclose($vroute);

I have created the vroute.txt file and it has write permission. I need some help in creating this file, as it will make it easier to get my pilots into my VA's vroute community.

Link to comment
Share on other sites

Like here is our list from Hellenic airways:

http://www.flyhellen...hp/VatsimPilots

Just make a new Module called Vroute or whatever you like and then in the index function i have this code:

$pilots = PilotData::getAllPilots();
foreach($pilots as $pilot)
{
$fieldvalue = PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID');
if($fieldvalue != '')
{
if(strlen($fieldvalue) < 5)
{
continue;
}
if (!is_numeric($fieldvalue))
{
continue;
}
echo $fieldvalue.'<br />';
}

Then all you need to do is give them the link like

http://www.YOURSITEURL.com/ACTION.php/vroute

Note it`s important that you give then the link with action.php so that in your <body> tags you only have the VATSIM IDs one in a row. Thats all they need and i think the simplest method ;)

Link to comment
Share on other sites

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