Jump to content

3 latest NOTAMs in your flightbriefing


hjhjhgjgjh

Recommended Posts

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.

Link to comment
Share on other sites

I have been googling utf8_encode, and tried various methods I found with no joy :( A clue would be great :D

EDIT: It seems that some of the RSS feeds from the site have errors in them, and that's what's causing the problem.

http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.ourairports.com%2Fairports%2Feghi%2Fnotams.rss

Link to comment
Share on other sites

  • Moderators

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?

Link to comment
Share on other sites

  • 3 months later...
  • Administrators

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
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

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;
}

Link to comment
Share on other sites

  • 2 weeks 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...