Cookie Support:

The advantage of HWimage being an add-on to HAMweather Pro is that it inherits most all the features of HAMweather.  So the cookies set with HAMweather will also work with HWimage.  Thus, once a user sets a forecast as their default, then if they come to a page that has link to HWimage without the 'forecast' parameter being set, then HWimage will use their cookie information, if available, to output an image.  If no cookie information is available then HWimage uses the default settings for the forecast.

Ok, so all this is good an well, but what can you do with it? Well, using HAMweather cookies with HWimage will allow you to easily customize your home page to have visitors forecast auto display.  Thus providing the personal touch that can keep a web user coming back. All with out using SSI.

Users & Themes:

Just as HWImage supports cookies, the same as HAMweather, HWimage also supports users and themes.  Thus you can hame HWImage use different weather icons than your main HAMweather site etc.  Just specify the user and theme parameters in the URL to HWimage. For example:

http://www.youdomain.com/cgi-bin/hamweather/hwimage.cgi?forecast=zone&place=ronaoke&state=va&user=lee&theme=example

If the user and/or theme parameters are not specified then HWImage will use the value of default, just as HAMweather does.

Output Image to File:

HWimage will allow you to output an image to a file as well as outputting to the web. To do this HWimage uses the same methods as used by HAMweather.  You provide the the 'om' parameter which states how to output the image.  and then you provide the 'of' parameter which gives the file name for the image.   You security, must preset the filename using the web based administration, just as you would for saving the normal HAMweather output to a file.  Below is a table of what to set the om and of parameters to, and refer to the HAMweather documentation on how to define an output file name in the web based admin, (Choose the Output File link under the Administration Section.)

om This parameter sets the output method used by HAMweather.

Set to zero (om=0) or leave out to make output goto Web only.
Set to one (om=1) to make output goto file and web.
Set to two (om=2) to make output goto the file only.

of This parameter is used to specify what file to send output to.  You set to the output file name that was previously set in the web based administration.

Examples of Outputting to a file:

An example of a URL to output the zone forecast for Roanoke, VA to the web only would be:

http://www.youdomain.com/cgi-bin/hamweather/hwimage.cgi?forecast=zone&place=ronaoke&state=va

An example of an URL to output the zone forecast for Roanoke, VA to both the web and a file would be: (Where the file to save the image to is determined by the of=xxx parameter.)

http://www.youdomain.com/cgi-bin/hamweather/hwimage.cgi?forecast=zone&place=ronaoke&state=va&om=1&of=xxx

If you want to output the image to a file only and not the web then you do not want to run the HWimage cgi from the web but from the command line, telnet or cron job.  An example of this would be:

HWimage.cgi forecast=zone place=roanoke state=va om=2 of=xxxx

Notice that when accessing HWimage from the command line you separate the parameters with a space.  If by chance the place name you are trying to get weather info for has a space in its name, simply replace this space with a plus sign (+).  For example, to access the zone forecast for Newport News, VA:

HWimage.cgi forecast=zone place=newport+news state=va om=2 of=xxxx

Referer Checking:

HWImage also allows for referer checking, the same as HAMweather does.  The referer checkign can be useful if you do not want other web sites to steal/insert links to HWimage on your server to add weather information to their pages.

Activating Referer checking in HWimage is not done by turnign on referer checking in the web based admin.  The activation for HWimage is kept seperate so that you may turn it on seperatly from the main HWImage site.  the allowed domains are the same as the ones set up in the web based administration though. So follow the below procedure to activate Referer checking in HWImage, but follow the HAMweather documentaiton for entering the allowed domains in the web based administration.

To activate referer checking for HWImage you will need to goto line 12 of the HWimage.cgi.  You will see the following:

$hwi_referer_mode = 0;

set it to the value of  '1', so it should now look like:

$hwi_referer_mode = 1;

To deactivate referer checking in HWimage, you simply set the value back to '0'; so that it looks like:

$hwi_referer_mode = 0;