Weather Graphic Banner Program

Howdy, I have been envious of everyone’s cute banners and wanted my own. I downloaded the script and immediately hit a wall. I know the instructions were written for multiple software packages and written by someone who knows the program inside and out and left out some things that would help a rookie. Is there a FAQ or something somewhere that enhances the instructions or is more specific to a WD install? Here are the things confusing me:

1) Unpack/unzip the archive.
  1. Copy the appropriate data template file to the location that suits the
    weather station software you use.

Instruction 1, no problem. Instruction 2 however threw me. I am guesstimating I they are referring to the HTX file that has WD in the name, but what locations “suits” the software is ambiguous to me. That doesn’t tell me where in the WD directory structure to put the HTX file?

3) Enable processing and upload of the file to the location you want on the server.

As far as I know, all executables on a PC are “enabled”?? Is there a WD setting I need to enable specific to this script?

4) Verify that the file is being processed an uploaded to the server.

Obviously I can’t do this if I don’t know how to get to t his point, but I think the file name you are looking for and where to find it would be helpful.

7) Copy the following files to the directory you want to run the script from:

Should be be uploading in binary, ASCII, or Auto mode? What rights do the files need?

I am sure I will have more questions but I can’t even get started?

Thanks!

Lew

Lew,
I’m guessing you downloaded Anole’s Weather Graphic PHP script from http://scripts.anolecomputer.com/download.shtml and have Weather Graphic V6.1 on your PC now.

If you unpacked it into your local copy of your website in the wxgraphic directory (the default), then you need to edit the config.txt file there and make one change to get it started with WD if you’re using AJAX on your site (or Weather-Display Live, or have clientraw.txt uploading to your site already).

Change the line in config.txt from

$data_file_path  = '/your/path/to/data/file/'; 

to

$data_file_path  = '../clientraw.txt'; 

Save and upload in the wxgraphic directory the *.gif, .jpeg, .png, config.txt, wxgraphic.php, and the icons/. directory.

You should now be able to access and display the default graphics by browsing to
http://www.farmingingtonweather.com/wxgraphic/wxgraphic.php and see the default graphic.

More customization can be done with the template files (avatar., default., banner., banner_big.) using your favorite image editor program, and you can change the layout/colors of what’s displayed by editing the config.txt and the wxgraphic.php program itself.

No conditions uploads other than clientraw.txt are needed for Weather Display users :wink:

This should get you started…

Best regards,
Ken

Hello Ken…

I guessed by website directory you meant the webfiles folder? I put the wxgraphic directory into the webfiles directory, made the config change, and created a wxgraphic directory in the root and put the files in it you specified (without a HTX file). When I tried to launch the program I got this error:

“Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/html/wxgraphic/config.txt on line 16”

This is the link to the PHP file:

http://www.farmingtonweather.com/wxgraphic/wxgraphic.php

Thanks so much Ken!

Lew

Lew,

It looks like you have an extra single quote at the end of line

$data_file_path  = '../clientraw.txt'';

it should look like this

$data_file_path  = '../clientraw.txt';

Best regards,
Ken

Thanks Ken,

That allowed me to get past that error to the next error:

Fatal error: Call to undefined function: imagecreatefromgif() in /var/www/html/wxgraphic/wxgraphic.php on line 446

BTW, as an aside, I noticed when I went to someone else’s site tonight that the arrow thingies worked fine using IE6…so it isn’t just my IE and WD/AJAX…there is still something in my web page or server settings that is causing the arrow problem…

Thanks again,

Lew

Oooh… missing the imagecreatefromgif function in PHP means you may not have the GD library enabled.

Upload the PHP_verify.php to your wxgraphic folder and execute
http://www.farmingtonweather.com/wxgraphic/PHP_verify.php

You should see something like this

 GD support: Yes

    *
    * GD Version: bundled (2.0.28 compatible)
    * FreeType Support: Yes
    * FreeType Linkage: with freetype
    * T1Lib Support: NO
    * GIF Read Support: Yes
    * GIF Create Support: Yes
    * JPG Support: Yes
    * PNG Support: Yes
    * WBMP Support: Yes
    * XBM Support: Yes
    * JIS-mapped Japanese Font Support: NO

in the second yellow box. If GD is not installed/enabled/working, then you won’t be able to use the wxgraphic.php

Best regards,
Ken

hI

Can anybody give me some help
I am trying to install Weather Graphic V6.1
I have downloaded the files and unpacked and retaining the folder structure
uploaded the files to the server
alter the configure file file path to $data_file_path = ‘/clientraw.txt’;
www.weather-above.com/wxgraphic/wxgraphic.php
I get a very small icon, with an X in the centre
can somebody tell me what I’m doing wrong

Thanks

Mick

Hi Mick,

First, you should change your config.txt to have

$data_file_path  = '../clientraw.txt'; 

since your clientraw.txt is really in the directory above wxgraphic directory.

It seems to be returning a 0 byte graphic. Since you’ve selected the .gif format, have you uploaded the *.gif files from the distribution zip?

Hopefully, that should get you started.

Best regards,
Ken

Hi Ken

thanks for your help

I have changed the configuration file to $data_file_path = ‘…/clientraw.txt’;
folder structure on the server
wxgraphic
the files are included please see images


0015.PNG

Where is the icon directory? I tried http://www.weather-above.com/wxgraphic/icons/banner.gif and http://www.weather-above.com/icons/banner.gif and I don’t see just that .gif, I get your whole page :?

The icons directory should be just below the wxgraphic directory in order to show the condition icons on your banner.

Best regards,
Ken

Hello again Ken,

That part seems to be OK as my screen looks like yours:

GD support: Yes

GD Version: bundled (2.0.28 compatible)
FreeType Support: Yes
FreeType Linkage: with freetype
T1Lib Support: NO
GIF Read Support: Yes
GIF Create Support: Yes
JPG Support: Yes
PNG Support: Yes
WBMP Support: Yes
XBM Support: Yes
JIS-mapped Japanese Font Support: NO

I still don’t get the arrows, etc. when viewing my site with IE6. Seemed to briefly work on one visit to my site and then I lost the capability again…sigh.

Lew

Hi

I’ve got the graphics to show

http://www.weather-above.com/wxgraphic/wxgraphic.php

How do I enter the title at the top of the image it says (a title here)?

If I design my own background do I just replace instead of the default image?

And at the bottom of the image. It says (click for more) how do I edit this text?

Appreciate any help thanks

mick

Mick,
Great! You’re on your way to making a weather graphic set.

You modify the text for each type of graphic by editing (carefully) the code in config.txt.

Each type of banner (default, avatar, banner, banner_big) has a small function that is called to create/annotate that particular size graphic. For example, the banner graphic is controlled by this

/******************************************************************************/
/*** write_banner: This function writes your values onto the 468X60 banner. ***/
/******************************************************************************/
function write_banner() {

  // let's start by defining some global variables that will be passed between 
  // functions. This is kind of clunky!
  // NOTE: IF YOU ADD ADDITIONAL COLORS YOU'LL NEED TO ADD THEM HERE TOO!
  global $color1, $color2, $color3, $color4, $color5, $date, $time, $temp, 
         $degree_units, $winds, $wind_units, $gust, $raintoday, $rain_units, 
         $barom, $barom_units, $baromtrendwords, $dewpt, $humidity, $heatindex,
         $heat_index_threshold, $windchill, $wind_chill_threshold, 
         $banner_icon_x, $banner_icon_y, $anti_alias;

  // this section does the heat index and wind chill
  // it figures out what to show, wind chill, heatindex or nothing
  // depending upon your settings
  switch (TRUE){
  // if windchill is <= $wind_chill_threshold we'll output it
  case ($windchill <= $wind_chill_threshold):
       $feelslike = "Wind Chill: $windchill$degree_units";
       imagecenteredtext(70, 38, "$feelslike", 2, 7, $color3, 0);
  break; 
  // if heat index >= $heat_index_threshold we'll output it 
  case ($heatindex >= $heat_index_threshold):
       $feelslike = "Heat Idx: $heatindex$degree_units";
       imagecenteredtext(70, 38, "$feelslike", 2, 7, $color1, 0);
  break;
  } // end switch

  // this section controls what is written to the image, where it is written.
  // see the explanation above for details on what each parameter represents 
  imagecenteredtext(90, 12, "A Title Here", 5, 10, $color2, 0);
  imagecenteredtext(422, 10, "Click For More", 2, 7, $color1, 0); 
  imagecenteredtext(234, 24, "$date @ $time", 1, 7, $color2, 0); 
  imagecenteredtext(70, 25, "Temp: $temp$degree_units", 5, 11, $color4, 0); 
  imagecenteredtext(70, 50, "Humidity: $humidity%", 5, 9, $color4, 0); 
  imagecenteredtext(234, 36, "Wind: $winds", 5, 11, $color4, 0); 
  imagecenteredtext(234, 48, "Gust: $gust$wind_units", 2, 7, $color4, 0); 
  imagecenteredtext(400, 25, "Rain: $raintoday$rain_units", 5, 11, $color3, 0); 
  imagecenteredtext(400, 38, "Dew Pt: $dewpt$degree_units", 5, 9, $color4, 0); 
  imagecenteredtext(400, 50, "$barom$barom_units $baromtrendwords", 2, 7, $color4, 0); 

} // end function write_banner

The strings in the third arguments to the imagecenteredtext() function calls are what you can change. The first two arguments are the X and Y position for the middle of the sentence to be displayed. X=0 is left side, Y=0 is top of image, with X and Y increasing to the X=width, Y=height for the size of the graphic.

You can replace the underlying graphic background with your own image (since you’ve chosen .gif, the default images are named
default.gif
avatar.gif
banner.gif
banner_big.gif

Remember to keep them the same size (height/width) when you replace them.

Hope this helps.

Best regards,
Ken

Lew,
Rather than hijacking this thread, let’s talk on a new thread (or PM or email) about the IE6-arrows problem.

Thanks and best regards,
Ken

Hi

Ken

I think I’m getting the idea
will do some more tomorrow.

:smiley:

mick
Thanks again

I didn’t intend to hijack the threat, it was just a BTW… I think getting the arrows to work with my IE6 is hopeless considering how much has been put into trying to solve it already.

Thanks anyway!

Lew

Lew,
I’ve sent you a mail message with a screen shot of your site in IE6 … let’s continue the debugging off-thread.

Best regards,
Ken

Hi

I have also the text and graphics
http://www.weather-above.com/wxgraphic/wxgraphic.php

I would like to put this on my website
with the relevant information for people to put into their website
is there some kind of the HTML code so they can just copy and paste
or what is the best way to do this

Some of my friends have vista operating system
can they include this in their gadget display
my friend is receiving local weather but would like to have my data displayed as well

I have noticed people on the forum including their banner at the bottom of their posts how do you do this
they look really good

Thanks

Mick
:slight_smile:

To answer the last question, the code for the banner is:

[url=http://www.weather-above.com]
[img]http://www.weather-above.com/wxgraphic/wxgraphic.php[/img]
[/url]

That’s in your forum profile, Forum Profile Information screen.