HAMweather 3 - SSI Plug-in (Simulated Server Side Include)
Contents:
Many people use Server Side Includes (SSI) to insert ads and/or other information into their HTML documents. Many of these same users would like to do this with the HAMweather Output. (i.e. add banner ads to the HAMweather output.). You may think that you can simply add the SSI directives to the HAMweather templates and as HAMweather sent out the output the webserver would catch these SSI directivesand parse them as well. The core distribution of HAMweather3 does not allow for this. This is where the SSI plug-in for HW3 comes in. It will allow you to add the SSI directives to your templates and have them parsed. The SSI plug-in understands the following SSI directives:
NOTE: The use of SSI simulation, like normal SSI, can lower security on your server, thus it should only be used when absolutely needed.
| Directive Name | Description |
| "Include File" | <!--#include file="/complete/file/path/to/file"-->
This command will insert a file into the HAMweather output. Basically it is very similar to the way that the basic HAMweather include works. You must set file equal to a complete file path or it can be set to relative path to a file that is in the users 'include' directory. NOTE: When using this directive, you will need to set the complete file path to the file you are trying to include. the HAMweather 3 SSI plug-in, does not support "relative" file paths. NOTE: Also, on Windows servers make sure you include the drive letter as well. For example:
|
| "Include Virtual" | <!--#include virtual="http://www.yourdomain.com/path/to/file"-->
This command will insert a file or script output into the HAMweather output. You must set 'virtual' equal to a full url to the file or script to include. NOTE: When using this directive, you will need to set the complete URL, including "http" to the file you are trying to include. The HAMweather 3 SSI plug-in, does not support "relative" URLs. NOTE: At this time
the HAMweather 3 SSI plug-in only supports virtual includes for URLs using
the "http" protocol. Thus, you cannot use a virtual include
using a URL that uses the "https" protocol. |
| "Exec cmd" | In normal SSI this directive would execute a program
on the server and then take the output and insert into the web page.
Because of security concerns the SSI plug-in will not support
this. If you
need to run a script/program on the server it must be accessible via the
web and then can be obtained via the "include virtual"
directive. |
NOTE: The use of SSI simulation, like normal SSI, can lower security on your server, thus it should only be used when absolutely needed.
The SSI plug-in falls under the HAMweather 3 Software suite license. You can find the latest version at:
http://www.hamweather.net/hw3/docs/license.html
The SSI plug-in has the same requirements as the core distribution.
You can download the SSI plug-in from the HAMweather Plug-ins area at:
http://www.hamweather.net/hw3/hw3plugins/links.php
Installation of the SSI plug-in is fairly simple per the following steps:
| Step | Description |
| 1 | Upload the "ssi.pm"
file to the /hamib/HW3Plugins directory of the HAMweather 3 installation. |
| 2 | Paste the following line
into the /configs/hw3.ini.php file, in the [Parse Plugins] section.
HWSSI=HW3Plugins::ssi|parse_line|0|1|1
|
The above installation will make the SSI plug-in allow simulated SSI directives in all templates outputted by HAMweather 3. You can now add "Include file" or "include virtual" SSI directives to your HW3 templates. If you use SSI with-in most of your templates this is the preferred method of usage of the SSI plug-in.
Allow SSI only in certain templates:
If you only need to use SSI in one or two templates then you may find slightly better performance and security making only making the SSI plug-in available when specifically turned on from with in the template. To use this method you will need to change the HWSSI line in the "[Parser Plugins]" section of the hw3.ini file to the following:
HWSSI=HW3Plugins::ssi|parse_line|0|1|0
Note, the last digit is a zero (0) instead of a one (1). This tells HW3 not to load the SSI plug-in automatically, but only when specifically requested from with in the template being outputted.
When using this latter method you will need to add the line:
%%USE=HWSSI%%
to the templates that you need to use SSI. The above line should appear before the first SSI directive that is in the template.