I imagine all you have to do is make sure the file path to “phpweather.inc” and “locale_en.inc” is correct. In the case of the snippet above they would have to be in the same directory as the page calling for them. You may want to try an absolute path.
Mine looks like:
<?php
include(‘/home/****/public_html/fultonchain/locale_en.inc’);
include(‘/home/****/public_html/fultonchain/phpweather.inc’);
$metar = get_metar(‘KSLK’);
$data = process_metar($metar);
pretty_print_metar_wap($metar, ‘Saranac Lake, NY’);
?>
You’ll note that I’m displaying “pretty_print_metar” which is configured by modifying the function in “phpweather.inc”. In my version (not necessarily current) it starts on line 396.
But that’s just it Cedar, I can’t seem to find those 2 particular files anywhere in my weather directory. Was I supposed to create them? Or were they part of the install package?
I see your point 🙂
I just downloaded the current version and it seems there were a few more changes than I thought. If your using 2.21 I’m afraid I’m not going to be much help, it took me forever to get the old version the way I wanted it and I’m not about to mess with it now 🙂
However, 1.6x is still available for download, meets my needs well and contains the two files your looking for.
Thanks for trying Cedar!
So is there anyone else out there using v2.21 that help me figure out what code I need to place into my blog to call the weather info??
Cedar, one more question. If I wanted to remove v2.21 and use 1.6x, how would I go about doing that? Delete the SQL db and all the files and just install the older version, creating a new db and tables?
Thanks!
Yep, that would pretty much be it. Keep in mind that the database is only used for caching and while it will speed up the response time it isn’t strictly necessary — also, you need not create a new database, your only inserting one table (metars) so it is unlikely to conflict with anything else on a shared database.
The docs for 1.x are a little more comprehensive than the ones for version 2.
DaisyHead,
I had some issue installing phpWeather, but it was just a matter of pointing to the correct database and directories and running the configuration files. Make sure you do that. Through that you can set create the default.php file that will allow you to determine the default weather station and metrics.
Also, don’t use the DB all the time option, because it doesn’t up date as quickly. Also, make a very small cache amount. My phpWeather updates about every 45 minutes.
I’m using mine on the main page http://www.dean-logan.com/.
The one thing I wish it had was a “normal temperature range”. After setting that, then the current temperature can be compared to the range and the appropriate temp icon could be displayed (i.e. hotter than normal, normal, colder than normal).