COPYRIGHT

SSI Random Image Displayer Version 1.00
Copyright 2001 London Perl Mongers, All rights reserved

LICENSE

This script is free software; you are free to redistibute it
and/or modify it under the same terms as Perl itself.

URL

The most up to date version of this script is available from the nms
script archive at  <http://nms-cgi.sourceforge.net/>.

SUMMARY

ssi_rand_image chooses a random image from a set of predefined images and
displays it on a webpage. It is intended to be used as a Server Side
Include program.

FILES

In this distribution, you will find three files:

ssi_rand_image.pl - The main perl script.
README            - This file. Instructions on how to install and use 
                    ssi_rand_image.
MANIFESTO         - List of files

CONFIGURATION

There are a number of variables that you can change in rand_image.pl which
alter the way that the program works.

$DEBUGGING    - This should be set to 1 whilst you are installing
                and testing the script. Once the script is live you
                should change it to 0. When set to 1, errors will
                be output to the browser. This is a security risk and
                should not be used when the script is live.

@images       - The list of images that the random image is chosen from.
                Each image has three parts to its definition:

                file - the URL of the image file
                alt  - some brief text to describe the image
                url  - An optional link URL (see $link_image below)

$uselog       - Set this value to 1 to log which image is returned each time
                the program runs.

$logfile      - The path to the logfile, only needed if $uselog = 1. This file
                must be writable by the webserver. For example, 

                    $logfile = "/tmp/randimages.log";

$date_fmt     - The format that the date will be logged in. The default
                format (%c) presents the date in this format:

                    Sun Jan 27 17:20:56 GMT 2002

                which is probably adequate for most purposes.

$link_image   - If this value is true (i.e. 1) and the chosen image has
                a 'url' component, then the image will be displayed as a
                link to the given URL.

$align        - The alignment to use when displaying the image.

$border       - The border width (in pixels) to use when displaying the
                image.

INSTALLATION

ssi_rand_image is installed simply by copying the file ssi_rand_image.pl.pl 
into your cgi-bin directory. If you don't know where your cgi-bin directory 
is, then please ask your system administrator

You may need to rename ssi_rand_image.pl to ssi_rand_image.cgi. Again, your
system administrator will know if this is the case.

You will probably need to turn on execute permissions to the file. You can
do this by running the command "chmod +x ssi_rand_image.pl" from your command
line. If you don't have command line access to your web server then there
will probably be an equivalent function in your file transfer program.

Then, edit your HTML files and change all the images that you want to
be randomized to:

<!--#exec cgi="http://your.host.com/cgi-bin/ssi_rand_image.pl"-->

This is just an example, so be sure to insert the correct URL of your
ssi_rand_image.pl installation.

Note: As this is a "Server Side Include" you will need to ensure that your
web server has been configured to support SSI. Also, it's possible that you
may need to rename any files that include SSI calls to give them a different
extension. A common choice is .shtml. Your system administrator will be able
to help you with these details.

SUPPORT

For support of this script please email:

  <nms-cgi-support@lists.sourceforge.net>

