Syntax and adding images..
Brought to you by:
iridium
From: Donovan A. H. <do...@hu...> - 2002-03-27 02:12:11
|
I have PHPWeather running but I am having a few issues getting the precipitation to show up, I'd also like to add an image of the current weather conditions like on the http://www.moulton-udell.k12.ia.us/ site as described in the below message. It seems like I'm making this process over complicated, but it is working all except for the precipin and I believe that is due to the wrong syntax. Here is the current code I am using: -- start -- <?php include('./weather/phpweather.inc'); include('./weather/locale_en.inc'); $metar = get_metar('KVCT'); $data = process_metar($metar); $temp_f = $data['temp_f']; $windmph = $data['wind_miles_per_hour']; $winddir = $data['wind_dir_text_short']; $dewf = $data['dew_f']; $humidity = $data['rel_humidity']; $visibility = $data['visibility_miles']; $precipin = $data['precip_6h_in']; echo "<tr><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">Temp:</font></div></td><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">$temp_f °F</font></div></td></tr>"; echo "<tr><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">Wind:</font></div></td><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">$windmph mph $winddir</font></div></td></tr>"; echo "<tr><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">Dew Point:</font></div></td><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">$dewf °F</font></div></td></tr>"; echo "<tr><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">Humidity:</font></div></td><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">$humidity %</font></div></td></tr>"; echo "<tr><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">Visibility:</font></div></td><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">$visibility m</font></div></td></tr>"; echo "<tr><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">Precipitation:</font></div></td><td><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">$precipin</font></div></td></tr>"; ?> -- end -- Regards, Donovan A. Huff Huff Data Systems Owner/Operator (361) 501-2957 www.huffdatasystems.com Message: 8094298 FROM: Kevin GodbyDATE: 03/13/2002 14:29:00SUBJECT: RE: Bug' with weather icons (images.inc) allo! on 3/13/02 3:01 PM, Ray van Beek at <EMAIL: PROTECTED> wrote: > 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. > > I found it. Great! Do you mind if I reference your site on my 'Online > weather' project page http://www.devolder.nl ? Be my guest! I found it extraordinarily easy to use the phpweather.inc and images.inc files. Works marvelously! >This way if there is no current weather data in the metar, it will fall >back >on the cloud condition. Hope this helps. > > That *is* a good idea. Well, I don't know if most weather stations report current weather conditions frequently or not. But the station I'm using doesn't appear to use them very often, so instead of printing nothing, I decided to print the cloud conditions. It's a little more useful that way. > Now Kevin, I like the today's specials for lunch. Maybe I'll drop by :-) <grin> Well then, you won't want to miss tomorrow's lunch -- we're having turkey fritters and hash browns! Thanks again for the script and graphics -- they look great! ---- Kevin Godby <<EMAIL: PROTECTED>> Technology Coordinator Moulton-Udell Community School District 305 E. Eighth St. Phone: (641) 642-8131 Moulton, Iowa 52572 Fax: (641) 642-3461 |