Banner Ad Rotation Program (BARP)
Version 1.7-lite
First off, to make these scripts work, you will need access to a web server, and enough privelages to execute SSI (Server Side Includes) commands...
Since you are reading this, you must have already uncompressed all of the files and directories that are included with BARP.
Start by uploading the files to your web site:
-
Copy the entire "barp-files" directory to the root level of your web site. (example: http://www.your_domain.com/barp-files)
-
Edit cgi-bin/barp/ad_definitions.pl For now, just change $site_url so that it's set to the URL of your web site, and $site_path so that it's the full path to the root level of your web site.
-
Copy all of the entire "cgi-bin/barp" directory to your cgi-bin. (example: http://www.your_domain.com/cgi-bin/barp)
-
Change the permissions on the newly uploaded file as follows:
-
To make the CGIs executable, log into your server (via SSH or Telnet) and change directories into the cgi-bin directory, then type:
chmod 755 barp/*
-
To make the log files writeable, log into your server (via SSH or Telnet) and change directories into the directory of your web site (usually where your site's home page is), then type:
chmod 777 barp-files/logs/*
If you are using the FTP program such as "Fetch", "CuteFTP", or "WS FTP", you can set these permissions from within the FTP application.
-
Test out the page by pointing your browsers at: http://www.your_site.com/barp-files/test_page.shtml
To add a banner to your page, first make sure that the page is named with a ".shtml" extension. The banners show up on the page via a server side includes (SSI) command, and web server knows that there is SSI code on the page because of the "shtml" extension - instead of the normal ".html" of ".htm". There are ways to configure your web server to parse ".html" pages for SSI commands, but this document does not cover that.
Next, you will need to make the AD configuration file for the page and add the SSI code to the page.
Lets assume that we want to add banner ads to a page called "test_page.shtml", and we want these banner ads to appear on the top AND bottom of the page.
-
First look in the /cgi-bin/barp folder for a perl script called "TEMPLATE.pl"
-
Duplicate it the file TEMPLATE.pl and name the copy, "index_bottom.pl"
-
Open up the newly duplicated file (index_bottom.pl) in a text editor, such as BBEdit, SimpleText, NotePad, or HomeSite - try not to use MicroSoft Word, because it may change the code.
-
Line 1 tells the server where Perl is and may need to be changed to reflect your server's environment. Any line that starts with a pound sign (#) is a comment.
-
Lines that start with the "@" sign are called arrays. There are 4 arrays in this file. Each array contains part of the information needed to show the right banner. It is VERY important the each array contains the same number of objects, and that each object is enclosed in quotation marks (") and separated with a comma (,). There should be NO COMMA AFTER THE LAST OBJECT IN AN ARRAY. After editing a couple of these, this should become second nature.
-
@images : This array contains the image names. Your version of Perl and Apache may be case sensitive (ad1.gif is not the same as AD1.giF) so be careful with your naming.
-
@urls : This array contains the links for each image. Whatever is listed first in @images will link to whatever is listed first in @urls. Also be sure to keep the "http://".
-
@alt : This array contains the image's ALT text - this is the text that the user sees before the image is fully loaded. The script can be configured to print this text below the ad if needed.
-
@client : This array contains the client's name for each image. Again, whatever is listed first in @images will go with whatever is listed first in @clients. This array is used primarily for logging purposes. Note: Do NOT use spaces in the client name - use an underscore instead.
-
The rest of this file should not be edited. It contains the functions (that get "called" from other files) that actually print the image to the browser.
-
Once you've finished editing this file, upload it to your server in the /cgi-bin/barp directory.
-
Next, you'll need to add the SSI code to your web page. Open the file SSI_example_code.txt in the "documentation" folder and copy the entire snippet of code.
-
Then open the barp-files/test_page.shtml file, and paste the code into the HTML of the page towards the bottom. Rename the following line to link to the correct configuration file:
exec cgi="/cgi-bin/barp/TEMPLATE.pl
"
should be
exec cgi="/cgi-bin/barp/index_bottom.pl
"
Then upload the web page to your server and test it out - http://www.your-site.com/barp-files/text_page.shtml (you won't need to change any permissions on theis page).
David Tufts
iMarc LLC
14 Inn Street
Newburyport, MA 01950
USA
tel: 978.462.8848
fax: 978.462.8807
dave@imarc.net
http://www.imarc.net