Version 5.0 is now available:
http://scripts.anolecomputer.com/download.shtml There are a lot changes starting with some new parameters added to config.txt:
Moved the icon placement parameters out into the config.txt file to make it easier to control placement of the icon. I meant to do this in 4.0 but somehow overlooked it. Here's what the section looks like from the new config.txt:
/***** ICON PLACEMENT: this section defines where the current *****/
/***** conditions/forecast icon will be placed if you are using it *****/
// $sticker_icon_x: x coordinate on sticker of the upper left pixel of icon
// $sticker_icon_y: y coordinate on sticker of the upper left pixel of icon
$sticker_icon_x = '2';
$sticker_icon_y = '2';
// $banner_icon_x: x coordinate on banner of the upper left pixel of icon
// $banner_icon_y: y coordinate on banner of the upper left pixel of icon
$banner_icon_x = '300';
$banner_icon_y = '2';
// $banner_big_icon_x: x coordinate on banner_big of the upper left pixel of icon
// $banner_big_icon_y: y coordinate on banner_big of the upper left pixel of icon
$banner_big_icon_x = '2';
$banner_big_icon_y = '2';
Made it possible to choose your image format with a single parameter in config.txt. Options are gif, png, or jpeg. Background and current conditions icons have been provided for all three formats. Here's what the section looks like from the new config.txt:
/***** IMAGE FORMAT: defines the image format *****/
// The script supports 3 image formats: GIF, PNG, and JPG
// set $image_format for each as follows:
// for GIF: $image_format = 'gif';
// for PNG: $image_format = 'png';
// for JPEG: $image_format = 'jpeg';
$image_format = 'gif';
Probably the biggest change is the addition of current condition icons for VWS users! To use this feature the following tags are added to the VWS template file:
^climate_cconds1^,^vst144^,^vst145^
Thanks to Gordon C. @
http://oldlineweather.com for coming up with the list of possible values for ^climate_cconds1^ and making this possible!
Added some functionality to handle conditions where the data file is not present. Since its possible that the data file could be in the process of being uploaded at the time we try to get it, we can end up with a situation where we have no data. This can result in either script errors or blank images. The script is now much more robust in dealing with problems pulling the data file. Specifically:
If the data file is not found on the first attempt it will try again after a two second sleep.
If the data file is not found on the second attempt it will try again after another two second sleep.
If the data file is not found on the third attempt an image in the appropriate size (sticker, banner, banner_big) will be output indicating that there was no data available.
You can modify the text output in this instance by change the line (currently line 68 ) in sticker.php that reads:
nodataimage("Data Currently", "Unavailable");
Thanks to kenmtrue @
http://saratoga-weather.org/ for the idea/suggestion on handling the no data file issue.
And finally a couple of minor corrections:
Corrected some problems with icon images names.
Corrected text locations in the default images so they'll look a bit better initially.
One thing that I did not add that I had talked about doing was static images. If you need static images, it's probably best to tackle that through a cronjob. If you only want static images so you can use the banner in your signature on a phpBB forum or other location that will not allow php script calls, on a good way to accomplish that is through server redirects. Most control panels will let you do this through them or you can do it with an .htacess file if you are comfortable with that.
This will probably be the last major revision of the script. Of course, I'll continue to issue bug fixes, but the script is pretty much doing everything I want it to do for now.