<?php
####### COPYRIGHT NOTICE #######
#
# Simple PHP Banner Script © 2001 Martin Phillips.
#
http://www.aus-etrade.com# sales@aus-etrade.com
# Version - 1.01
# 27 Sep 2002
#
# This program is being distributed as freeware. It may be used,
# modified and re-distributed free of charge, so long as this
# copyright notice remains intact.
#
# By using this program you agree to indemnify the author/copyright
# holder, Martin Phillips from any liability.
#
# Selling the code for this program without prior written consent is
# expressly forbidden.
#
# Please give me credit for this and any derived works.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND
#
####### START OF CONFIG #######
$banner_dir_URL="
http://www.yourdomain.com/banner"; # The URL of the dir containing the banners
$banner_width="392"; # Speaks for itself
$banner_height="72"; # So does this
# Every time this banner rotation script is used, the banner count
# file is deleted and a new one is written. This file tells the
# script which banner to show next.
# The directory containing this file must be writable. (chmod 777)
# this is the path to hte directory not the URL.
$count_file = '/path/to/banner_count.txt';
# The following array lists image name and where the banner links.
# Banner links can either be URLs or email links.
#
# Example:
#
# $banners = array ('image1.gif - mailto:email1@address.com',
# 'image2.gif - mailto:email2@address.com',
# 'image3.gif -
http://link1.com',
# 'image4.gif -
http://link2.com');
$banners = array ('natnum1.gif - mailto:support@norcom.net.au?Subject=More%20Info%20on%20National%20dialup',
'sat1.gif -
http://www.norcom.net.au/pricing/satellite.html',
'virus.gif -
http://www.norcom.net.au/dotnews/archive/flash3.html',
'etrade.gif -
http://www.aus-etrade.com');
####### END OF CONFIG #######
if ($banner_dir_URL == "
http://www.yourdomain.com/banner") {
$banner_dir_URL = ".";
}
if ($count_file == '/path/to/banner_count.txt') {
$count_file = './banner_count.txt';
}
if (is_file ($count_file))
{ $display_num = join ('', @file ($count_file)); }
else
{ $display_num = 0;}
$banner_info = explode(" - ", $banners[$display_num]);
print "<A HREF=$banner_info[1]><IMG SRC=$banner_dir_URL/$banner_info[0]
BORDER=0 WIDTH=$banner_width HEIGHT=$banner_height></A>";
$display_num++;
if (count($banners) == $display_num)
{ $display_num = 0; }
@unlink ($count_file); # delete banner count
$file = fopen ($count_file, "w+");
flock ($file, LOCK_EX);
fwrite ($file, $display_num);
fclose ($file);
?>