#!/usr/bin/perl

############################################
##                                        ##
##       WebAdverts (Configuration)       ##
##           by Darryl Burgdorf           ##
##       (e-mail burgdorf@awsd.com)       ##
##                                        ##
##             version:  2.15             ##
##         last modified: 3/22/00         ##
##           copyright (c) 2000           ##
##                                        ##
##    latest version is available from    ##
##        http://awsd.com/scripts/        ##
##                                        ##
############################################

# The following variables should be set to define the locations
# and URLs of various files, as explained in the documentation.

$display_path = "/home/rabble/public_html/apps/RockBannerz/ads_display.cgi";
$adverts_dir = "/home/rabble/public_html/apps/RockBannerz";
$display_cgi = "http://www.rabble.co.uk/apps/RockBannerz/ads.cgi";

$advertzone = "";
$ADVUseLocking = 1;
$ADVUseCookies = 1;
$CheckForCookie = 1;
$GraphicTimestamp = 0;
$ADVLogIP = 1;
$ADVResolveIPs = 0;
$DupViewTime = 0;
$DupClickTime = 0;
$ADVRandomizeList = 1;
$DefaultBanner = "";
$IgnoredIPs = "";
$RequireMember = 0;

# $Ztext = "";
# $Zalt = "";
# $Ztarget = "";
# $Zwidth = "";
# $Zheight = "";
# $Zborder = "";

$ExchangeName = "WebScripts Advertisers";
$ExchangeURL = "";
$ExchangeLogo = "";
$ExchangeLogoWidth = 60;
$ExchangeLogoHeight = 60;
$ExchangeLogoPosition = "";
$ExchangeBannerWidth = 468;
$ExchangeBannerHeight = 60;

# NOTHING BELOW THIS LINE NEEDS TO BE ALTERED!

unless ($ADVNoPrint) {
	if ($ARGV[0]) { $ADVQuery = $ARGV[0]; }
	else { $ADVQuery = $ENV{'QUERY_STRING'}; }
}

if ($ADVUseCookies && $CheckForCookie && ($ADVQuery =~ /page=/)
  && ($ADVQuery !~ /advert=/) && ($ADVQuery !~ /banner=/)
  && ($ENV{'HTTP_COOKIE'} !~ /TestCookie=TestValue/)  
  && ($ADVQuery !~ /checkforcookie/)) {
	print "Set-Cookie: TestCookie=TestValue\n";
	print "location: $display_cgi?$ADVQuery;checkforcookie\n\n";
	exit;
}
elsif ($CheckForCookie
  && ($ENV{'HTTP_COOKIE'} !~ /TestCookie=TestValue/)) {
	$ADVUseCookies = 0;
}

require $display_path;
&ADVsetup;

unless ($ADVNoPrint) { reset 'A-Za-z'; exit; }

1;
