######################################################################
#
# Dream Catchers CGI Scripts Feel free to modify
# Rotating Placement this script to your
# Created by Seth Leonard needs, but please
# for Dream Catchers Technologies, Inc. keep this portion so
# that I get credit.
# http://dreamcatchersweb.com/scripts The same goes for
# distribution.
#
# (c)1996/1997 Dream Catchers Technologies, Inc.,
# All Rights Reserved
#
######################################################################
Dream Catchers Technologies, Inc. provides this script free of charge. However, if you do use this script, a $1.00 donation is appreciated to help support this free resource. Please send $1.00 to:
Dream Catchers Technologies, Inc.
P.O. Box 8600
Kirkland, WA 90834
(make payments payable to Dream Catchers Technologies, Inc.)
Step by step instructions for Rotating Placement
CONTENTS:
rotplace.cgi - the cgi script which operates your rotating placement program
placecount.txt - a file keeping track of what placement to display
readme - this file
Follow these easy steps:
**********************************************************************
** THIS SCRIPT REQUIRES SERVER SIDE INCLUDES, PLEASE MAKE CONTACT **
** WITH YOUR SERVER TO MAKE SURE THAT YOU HAVE THIS OPTION!!!! **
**********************************************************************
1. Contact your server. Ask them to create a cgi-bin directory for you. Also ask them how one can access a file in that directory from WWW. Usually this is "http://www.your_server.com/cgi-bin/your_name/filename".
2. If you have direct access to your server, log onto your server (Telnet access to your server). At the command prompt, type "which perl". Write down the line given to you. Usually this is /usr/local/bin/perl. If you do not have a direct connection, ask your server where the perl program resides.
3. Design the pages or page sections that you would like to rotate through. If you are rotating through pages, design these pages as normal. Put in all the tags you want and start the file with the tag and end it with . If you are rotating through pages, again, design it as if it is part of a page. I have found that the rotating section works best in two instances:
A. In use with a table. One section would be a row or a column. So you would put a
or at the beginning of the section design.
B. In use with images. Each section would be a different image and possible a description. So if you are using it to advertise, a section would look like this:

Buy this product
And the html that would have the advertisement would look like this:
4. Open the rotplace.cgi file included in the files you downloaded from Dream Catchers CGI Scripts page.
5. The first line of rotplace.cgi has the line:
#!/usr/local/bin/perl
If the line you recieved from your server when you typed "which perl" is different, replace the one there. Keep the #! and don't change anything if it is the same one you were given.
6. Find the section that says "ONLY EDIT THIS PART OF THE SCRIPT" and change the vaiables so that the match your home directory.
NOTE: The values already placed there are examples!!
For example:
$placecounter = "/home/you/public_html/palcecount.txt"
you would change to:
$placecounter = "/home/scripts/public_html/placecount.txt"
Change the values of:
$placecounter = the actual path on your server to placecount.txt. This is the file that keeps track of which pages/sections to display.
$place[?] = the location of the page/section that you are using. (whether you are using pages or sections, they must be in your home directory, and the path to them here must be one through your directory, such as /home/you/public_html/place.txt)
IF YOU WOULD LIKE TO ROTATE BETWEEN MORE THAN 5 PAGES, JUST ADD THEM. BUT KEEP THE $page[ ] FORMAT, INCREASING BY ONE NUMBER EACH TIME.
$max = the number of pages/sections that you are rotating through. This should be the same number that the last $place[?] has between the [ ].
7. You are done changing this file. Save the file as rotplace.cgi, or any other filename ending in .cgi. NOTE: The file can also be saved as rotplace.pl if your server prefers this.
8. Create an HTML page. If you are rotating through pages, use the following tag as the only line in the html file:
*(look below for a description of how this line works)
If you are rotating sections of pages, do this like a normal page, designing it how you would like page to look. In the place you would like to have the rotating section, use this tag:
*(look below for a description of how this line works)
So a page using an advertisement image and slogan could look like this:
Buy this product
(*)./cgi-bin/you/rotlink.cgi is the path to your rotplace.cgi file on your server. So /cgi-bin/scripts/rotplace.cgi would take you from http://dreamcatchersweb.com/scripts/file.htm to http://dreamcatchersweb.com/cgi-bin/scripts/rotplace.cgi. NOTE -- EACH SERVER SETS UP SERVER SIDE INCLUDES DIFFERENTLY, CHECK WITH THEM TO SEE WHICH PATH IS CORRECT.
9. Warning!! If you view the html file off-line (from your hard drive), the rotating section or page will not appear! It needs the server script to be able to bring in the correct information to make it a complete page.
10. Save the file as anything.html (any name will do).
11. Upload all .cgi and .txt files into your cgi-bin and .htm or .html files to any directory that can be accessed via the web (many servers require that you upload these types of files in ASCII format, check with your server administrator to be sure).
12. You now need to set the permissions of the files you've uploaded. You can do this one of two ways.
1. TELNET - telnet into your server and go to the directory which holds the files. Type chmod [permission] filename. For example: chmod 755 file.cgi.
2. FTP SOFTWARE - you'll need to find out how to change permissions of the files using your specific program. Using WS_FTP (recommended), select the file you want to change permissions of and click your right mouse button and select CHMOD (UNIX). A box will appear with the option to select any number of 9 separate boxes (top row for read, middle row for write, bottom row for execute). These translate into actual unix permissions. If the file needs to be a+rx or 755, select every read box and every execute box (that is every box on the top and bottom rows). If the file needs to be a+rw or 666, select every read box and every write box (that is every box on the top and middle rows). These are the only two permissions you need to worry about.
The files included need to following permissions:
rotplace.cgi a+rx or 755
If you have telnet access, you can also check your scripts for errors by going to the directory they reside in and typing either perl filename.cgi or filename.cgi (depends on your server). If you get an error, you most likely edited the script where you shouldn't have or forgot to put a " or ; on one of your variable definitions.
13. Load the page from the internet, and see if you have a rotating page or section. Use RELOAD to cycle through your options
14. Smile, you're done...
All working? Great! You now have a Rotating Link. If there are problems, please consult http://dreamcatchersweb.com/scripts and chose the Frequently Asked Questions option. You can also post a message on the User Forum asking for help from other users. Please do not send email, it WILL NOT be answered. I apologize for this, but there were just too many requests to be able to offer quality help for all as well as work on new projects.
|