New Version of Anole's WeatherGraphic script now available

Anole of released version 6.2 of his great banner script on 15/08/2008.
Details here:

As my patch for version 6.1 is no longer needed, I shall be removing it from its published location on


Thank you for the heads up.


This may be in the wrong spot…feel free to move the post.

I got bored and tried this script. Ive uploaded the config file and the sticker file. I went with the sticker “png” for now just to see how everything works. Ive changed everything that i know of in the config file and in the sticker.php file, and im getting “data unavailable”

If you need to see a certin part of the script to see what i did wrong, just ask and i’ll post it. Thanks, Mark.

add on: do i need to set anything up in WD for this to work? thanks.

What have you set for the data file path? I mean this parameter:

$data_file_path - defines the path to the data file. The path can be absolute or relative. If your are using Weather Display clientraw.txt supply the path to it.
NOTE: This is NOT a URL!

Example: $data_file_path = ‘/home/yourdir/weather/datafile.txt’;

i have…

$data_file_path = ‘/clientraw.txt’;

Ive read the README file about 3 times. Ive done everything it says, and thats from 2005. I would figure if the script got updated, so would the README file.

Anole appears to have packaged his old script “sticker.php” along with the new wxgraphic.php script in the 6.2 package. You need to be calling wxgraphic.php. (Anole had to change the original name, I seem to remember that he had be “Asked” to by a concern that thought the word “Sticker” was theirs.)

I see that you have wxgraphic.php on your server, but I get no image with it. Looking at near the top your config.txt:

/***** DATA FILE: defines the path to the data file. *****/
// path can be absolute or relative
// if using WD clientraw.txt supply the path to it.
$data_file_path  = '';

Try changing to

/***** DATA FILE: defines the path to the data file. *****/
// path can be absolute or relative
// if using WD clientraw.txt supply the path to it.
$data_file_path  = ./clientraw.txt';

You also appear not to have uploaded either the default or avatar background images(in .gif or .png). Sticker.png (and also .gif and jpeg) were used by the original sticker.php script and are no longer used. I can get your banner and banner_big images OK. wxgraphic.php when called without a parameter needs a default background image (ie default.gif).

You say you went for the “png” version, but your config,txt is eset for gif.

/***** IMAGE FORMAT: defines the image format *****/
// The script supports 3 image formats: GIF, PNG, and JPEG
// 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';

Let us know how you get on with these suggested changes.
I will PM Anole and let him know about the distribution.


Thanks for looking into that. I did change a few things after posting lastnight. So thats why some things have changed and are not there anymore. If the sticker.php isnt used anymore, why is it still in the DL file? Im at work now, i’ll try it again when i get home in the afternoon. I’ll post an update then. Thanks, Mark.

I PD’d Anole this morning and he has today releleased a revised package with the sticker.* files removed. Everything else is exactly the same, so there is no need to download it if you already have the 6.2 package.


That’s a File path from the root of the server … not from your web space. It needs to be ‘./clientraw.txt’; to work with the wxsticker script, or the FULL path from the filesystem root (like /usr/myusername/home/public_html/clientraw.txt’ ).

Best regards,

thanks Ken. Im going to mess with it after work in about an hour or so. hopefully everything will go good.

My banner page ( says it is raining (not) The main page ( Cloudy, Dry (yep)???


Got it to work…thanks all…

1 more question…how do you use the wxgraphic.php and the config file to also make a regular banner so it updates both? hope i explained that right.

Update: scratch that question…got it

OK…i do have a question…how can ya get rid of the “.” after the current temp? i just want the whole number…Thanks, Mark.

I’m using an old version and in that one there is a section:

// temp conversion precision
// determines the number of decimal places
$temp_prec = ‘0’;

(0 = no decimal)

Update: It is the same, that info is included in the instructions on Anole’s webpage.

TY Niko…worked perfect.

My banner page ( says it is raining (not) The main page ( Cloudy, Dry (yep)???

Silly thing still says rain. But is not showing any amount. BTW I am using the old version.


your banner right now doesnt show its raining.

Yer gonna see “rain=0” if it’s not raining.

I’m using a very old version of the script, and haven’t converted to WD yet, but here are a few things I did to modify the output. Most of them were in the interest of not cluttering a small space with a bunch of useless information. My city’s homepage uses a banner named “city banner” which incorporates the modifications below.
Note the code below is not straight cut and paste, but it may give you a good idea on where to start. :slight_smile: I know this stuff is childs play to alot of the coders here, but when I got it going, I was pretty jazzed :slight_smile:

If we have no rain, nothing is output:

switch (TRUE) {
  case ($raintoday == 0.00):
    $raintoday = "";
case ($raintoday > 0):
    $raintoday = "Today's Rain:$raintoday";

} // end switch

I get the currrent warnings in my stickertags.txt file and use this to shorten them down:

switch (TRUE) {

  case ($warnings == "Warning Description: Fire Weather Advisory"):
    $warnings = "Fire Weather Advisory";

case ($warnings == "Warning Description: Snow Advisory"):
    $warnings = "SNOW ADVISORY";
case ($warnings == "No Warning"):
    $warnings = "";
} // end switch

There is a windchill threshold built into the script. I use the following to show the windchill if it’s below the windchill threshhold and more than 5 degrees below current temp:

if ($_REQUEST[type] == "citybanner") {
   switch (TRUE){
   // if windchill is <= $wind_chill_threshold and the difference is more than 5 degrees,we'll output it
      case (($windchill <= $wind_chill_threshold) and ($temp - $windchill >= 5));
      $feelslike = "Wind Chill: $windchill";
      imagecenteredtext(73, 48, "$feelslike", 2, 8.5, $red, 0);
   // if heat index >= $heat_index_threshold and the difference is more than 5 degrees,we'll output it 
     case (($heatindex >= $heat_index_threshold) and ($temp + $heatindex >= 5));  
     $feelslike = "Heat Index: $heatindex";
     imagecenteredtext(73, 48, "$feelslike", 2, 8, $red, 0); 
   } // end switch

Is there a standard script to add to the banner code for watches, warnings and advisorys?