Leuven-Template solve waittime error in retrieving METAR information

As of today the website http://weather.aero/, also known as ADDS, stopped its services.

There are some older, not updated versions of the Leuven-Template metar scripts still using this URL.

Release 2.7 is NOT affected, this release used this server as backup

Release 2.6 original download used this is the script version: # 3.00 2014-09-21 release version

approx line 30

$weatherApiUrl	= 'http://weather.aero/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&hoursBeforeNow=3&mostRecent=true&stationString='.$SITE['METAR'];

change to

$weatherApiUrl	= 'http://aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&hoursBeforeNow=3&mostRecent=true&stationString='.$SITE['METAR'];

Please consider in all cases to switch to using Yahoo for current conditions as their site has an impeccable track-record for years.


Bumped and changed the subject line to better reflect the contents

hello WIM…

I have 2 sites I created for friends that use the older 2.6 version of your templates and I think both are screwed up and not working may have something to do with the code you mention above in this Thread.

The first site is here…


and the 2nd site is here…


the errors shown on both sites are what appears when trying to access the weather2 home pages.

do you have any idea what is wrong and how to fix them? if it is to do what is mentioned above in this thread, exactly which file or files do I edit the code in?

I just don’t have the time to update their sites right now to version 2.7 of your templates

Thank you…Chris

UPDATE about 30 Minutes after I posted above…

I got both sites viewable again by downloading and then uploading to their server’s /weather2 folder the new wsMetarXmlphp file fix from your support page.
now the only visible errors on both these sites is some error code near the forecast/icons text and most likely is do to noaa/nwc forecast changes made for the Dual Image/Icon that was released around july6th

My question is…will the fix on your support page work if these 2 sites are using version 2.6 of your templates, or is this fix on your site just for version 2.7 of the templates? if it will not work, is there a fix for version 2.6?


This morning (my CET) I checked both sites, they seem to be OK.
I assume you found the updates for both problems on the support site.

Sites with latest updates, also version 2.6 are OK, the METAR errors were pro-active solved in update
update 2015-05-10 new xml errors => Support for Leuven-Template for weather-sites


I think you should check if the Yahoo settings are correct at those sites as Yahoo seems to run a 24/7 available website.
You can then switch to Yahoo when there is a “current condition problem” with Metar.

And it is only one setting to swith from yahoo <==> Metar and back.


BOTH release 2.6 and 2.7 have full support and all problems are posted on the support site a.s.a.p.
They have a separate page with the known problems as sometimes the solutions / changed scripts are different.


There is no need to switch from 2.6 to 2.7 as the improvements for an already running website are small.


Hello Wim…

Thank you and will look into the Yahoo Idea. Both sites are now updated with new fixes for version 2.6 and working well.



There seems to be be some users with old versions of the METAR xml script. They face long delays in retrieving the “Current Conditions”.

Best one: => switch to yahoo for “Current Conditions”. They also use the metar but they are most of the times far quicker then loading the metar yourself.
In your settings file scan for $SITE[‘curCondFrom’] and change as in this example by commenting the others and uncommenting Yahoo.

#  STANDARD     C U R R E N T  C O N D I T I O N S   from which source do we get them
#$SITE['curCondFrom']	= 'wd';		// if you are using WeatherDisplay AND have set WD correctly
$SITE['curCondFrom']	= 'yahoo';	// if you use Yahoo also for the forecast on the startpage no other forecast
#$SITE['curCondFrom']	= 'metar';	// default, mostly best choice

You first have to find the correrct yahoo id ( $SITE[‘yaPlaceID’] ) for your area at https://weather.yahoo.com


Or use this adapted version of the metar xml script. As always you should make a copy/backup of a script to be replaced FIRST .


wsMetarXml.php.zip (3.43 KB)