Jump to content

3 latest NOTAMs in your flightbriefing


Recommended Posts

Posted

This addon shows the 3 latest NOTAMs of both your departure and arrival airport. A readme is included in the zip file. Its possible to display more NOTAMs than 3, for this, just check out the code of notamdep/arr.tpl.. Its self explaining. Download here

notam.png

Posted

you did what ? :blink::lol: well, as long as it works B)

:D I just hate to mess with the core tpl files so I usually add any new addons to my skins folders. but the notamarr.tpl, notamdep.tpl and the schedule_briefing.tpl must all be in the same folder to get it to work right. :D

Posted

I have just been checking all my flights, and one seems to be throwing up errors:

Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.ourairports.com/airports/EGHI/notams.rss:139: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0x86 0x20 0x50 0x4C in /customers/britair.net/britair.net/httpd.www/core/templates/notamdep.tpl on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: CLIMB TO 3000 VIA TR 201 DEG, THEN CONT AS DIRECTED. † PLANVIEW - ADD in /customers/britair.net/britair.net/httpd.www/core/templates/notamdep.tpl on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /customers/britair.net/britair.net/httpd.www/core/templates/notamdep.tpl on line 5
Fehler beim Einlesen der XML Datei

It's for EGHI (Southampton, UK).

All other ICAO codes seem to be working fine.

  • Moderators
Posted

i also tried to put it on my site but not working getting this error

Warning: simplexml_load_file() [function.simplexml-load-file]: URL file-access is disabled in the server configuration in /home/tntvirtua/domains/tnt-virtual.be/public_html/lib/skins/tnt_ver2.0/notamdep.tpl on line 5

Warning: simplexml_load_file(http://www.ourairports.com/airports/EBBR/notams.rss) [function.simplexml-load-file]: failed to open stream: no suitable wrapper could be found in /home/tntvirtua/domains/tnt-virtual.be/public_html/lib/skins/tnt_ver2.0/notamdep.tpl on line 5

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://www.ourairports.com/airports/EBBR/notams.rss" in /home/tntvirtua/domains/tnt-virtual.be/public_html/lib/skins/tnt_ver2.0/notamdep.tpl on line 5

Fehler beim Einlesen der XML Datei

tebin anny sugestions?

Posted

thanks joeri :)

I still haven't got this working on my site. How and where would I place the utf8_encode() call please?

could you send me your schedules_briefing.tpl ? then i can check it. and a link to your va would also be good so i can see whats wrong :)

  • 3 months later...
  • Administrators
Posted

To fix the URL fopen error:

In notamdep.tpl, replace:

if (!$xml = simplexml_load_file ($stream)) { 
die("Fehler beim Einlesen der XML Datei"); 
} 

With:

$file = new CodonWebService();
$contents = @$file->get($stream);
$xml = @simplexml_load_string($contents);

And then in notamarr.tpl do the same thing. This uses the CodonWebService class to pull the stream via cURL, and load it that way. This is the safer way since alot of hosts (including mine) disable url_fopen.

  • Like 1
Posted

To fix the URL fopen error:

In notamdep.tpl, replace:

if (!$xml = simplexml_load_file ($stream)) { 
die("Fehler beim Einlesen der XML Datei"); 
} 

With:

$file = new CodonWebService();
$contents = @$file->get($stream);
$xml = @simplexml_load_string($contents);

And then in notamarr.tpl do the same thing. This uses the CodonWebService class to pull the stream via cURL, and load it that way. This is the safer way since alot of hosts (including mine) disable url_fopen.

That did the trick.

Thanks!

  • 4 months later...
  • 2 weeks later...
  • 2 years later...
Posted

I'm not sure what's wrong, but on certain schedules with this plugin, the template breaks. I have however noticed a pattern, and it seems to happen on schedules in which airports have no NOTAMs. In this case, Esbjerg has no NOTAMs to display. Any ideas how this can be fixed?

k3hKu5Y.jpg

EDIT:// Apologies for asking, got it sorted. If anyone has trouble with this in the future, here's how you solve it. Replace the die() function which apparently kills off the page, with an echo, followed by a return, which will terminate our given target.

Replace this in notamarr.tpl and notamdep.tpl:

if (!isset($xml->channel->item)) {
die("Keine Items vorhanden");
}

with...

if (!isset($xml->channel->item)) {
$message = 'There are no NOTAMs available for this airport.';
echo $message;
return;
}

  • 2 weeks later...
Posted

For anyone having trouble with the files not being in the same place, replace the:

<?php include('notamdep.tpl'); ?>

with:

<?php Template::Show('notamdep.tpl'); ?>

Do that with the second one, and it will work just fine.

  • 11 years later...

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