If you want it on every page, I believe the easiest way to do that is to make the weather_include.txt file into a PHP file, by adding <?php at the beginning and ?> at the end, renaming the extension, then include that file in the phpinclude template, then you should be able to use $weather anywhere. (This is in theory, not tested by me.)
You can easily add more cities. This hack comes with over 1500 cities that are made available, but there are a lot, lot more. Probably just about any town that is covered by an ISP would be available, or if not then the town next to it. I have attached a text file to this post that explains how to add more cities. I have also put this file into the weather01.zip and updated the attachment in the first post; note that if you have already downloaded it, it is NOT necessary to download it again. Just download the file from the attachment in this post, because nothing else in the ZIP has changed at all.
BTW, the cities Newcastle, Newcastle On Clun, Newcastle Wea Cntr, and Newcastle Wx Centre are all available, as are Cardiff and Edinburgh.
Mark Hewitt, no, it the front page won't try to connect to MSNBC every time someone loads it. A user's weather data is stored in the database and is usable for up to two hours after it was put there; after it is more than two hours old, the hack will connect to get new data. This should minimize the amount your site has to connect to MSNBC, plus the hack itself will not have to go through the steps of parsing the raw data, etc. I have personally observed on my home computer a difference of a few seconds between when the front page uses cached data and when I force it to get new data. If you want to change how long the cached data is considered "fresh", look for this line in weather.php:
PHP Code:
if ((time()-7200)>$datecut or $forceupdate=="yes") {
Change the number
7200 to some other number, where it is the number of seconds. (There are 3600 seconds in one hour, thus for two hours, it is 7200.) Now this hack will display, on either the box on the forums home page or on the weather forecast page, the time the data was last updated by AccuWeather. This is the time the original raw data was updated, NOT when the data was stored in your database. You can try to pay attention to that time to see how often the actual raw data is updated (I have not had time to do that yet, and I just picked two hours as a seemingly good amount of time), and adjust the number accordingly. Meaning, if the raw data is only updated every three hours, make the cached data fresh for three hours; however, you run the risk that someone will cache some data just before an update, then the raw data changes, meanwhile the user is sees old data for the next three hours.