Re: 'Bug' with weather icons (images.inc)
Brought to you by:
iridium
From: Kevin G. <go...@ae...> - 2002-03-13 16:42:43
|
on 3/12/02 2:25 PM, Ray van Beek at r_v...@ho... wrote: > Hmmmm, I glued your metar in my own script (down below) and it shows ok > (overcast). Maybe I did something wrong with scope of variables, more than > one include files or something in that direction.... My mistake! I was passing the actual metar string to your function instead of the array. In other words, I was doing this: $metar = get_metar('KOTM'); // station in Ottumwa, Iowa $data = process_metar($metar); $image = get_sky_image($metar); // <-- this is not the right way! instead of this: $image = get_sky_image($data); // <-- this is the correct way! That's what I get for not reading the comments/instructions very carefully. :) > No problem, let me know when it's operational (and the URL). Well, my web site is here: http://www.moulton-udell.k12.ia.us/ The weather is located in the navigation column on the left-hand side (at the bottom). It looks okay in IE, but for some reason, my columns get squished in Netscape. I'm still trying to work on that. To print the current weather string, I'm doing something like this: $metar = get_metar('KOTM'); $data = process_metar($metar); $condition = ucfirst($data['cloud_layer1_condition']); $weather = $data['weather']; // if there is no current weather, use the cloud condition instead if (strlen($weather) == 0) { echo "$condition<br>\n"; } else { echo "$weather<br>\n"; }; This way if there is no current weather data in the metar, it will fall back on the cloud condition. Hope this helps. Thanks again for the script! ---- Kevin Godby <go...@ae...> Technology Coordinator Moulton-Udell Community School District 305 E. Eighth St. Phone: (641) 642-8131 Moulton, Iowa 52572 Fax: (641) 642-3461 |