##############################################################################
# Megabook - Guestbook Script V1.1                                           # 
# Copyright 2000 Terry Billinger                                             #
# Created 7/3/00                                                             #
# Available at http://www.militerry.com/megabook/                            #
##############################################################################
# COPYRIGHT NOTICE                                                           #
# Copyright 2000 Terry Billinger                                             #
#    								             #
# This script was made by combining Matt Riffle's Flexbook and               #
# Cliff Gdansk's Guestbook scripts.                                          #
# It allows for easy modification and easy administration.                   #
#                                                                            #
# This script can be used\modified free of charge as long as you don't       #
# change this header or any of the parts that give me credit for writing     #
# this.  By using this script you agree to indemnify me from any liability   #
# that might arise from its use.  In simple English, if this script somehow  #
# makes your computer run amuck and kill the pope, it's not my fault.        #
#                                                                            #
#                                                                            #
# Redistributing\selling the code for this program without prior written     #
# consent is expressly forbidden.                                            #
##############################################################################

***********************************************************************
* HISTORY                                                          
***********************************************************************

This project was started in early July/2000 after I had spent some time
fiddling around with my sister's Ultimate Bulletin Board.  I had 
implemented some 'hacks' that allow things to be displayed different. 
After that I had learned a small bit of Perl.

My sister started to complain about how slow her guestbook was going 
that was hosted at http://www.gbook.nu.  This is because of the 
massive amount of users already using this service and the fact that 
the guestbooks were database driven.  This is when I asked if her she 
would like me to make her a guestbook script.  She had declined 
because she wanted to keep her 900+ entries she had already receieved 
but I still wanted to make one just to see what I could come up with.

Since I don't know the complete Perl language I set out to find a 
guestbook script that used a database instead of just placing HTML 
directly into an already created file.  This is where I had found 
Cliff Gdansk's guestbook.  His was database driven and already had an 
administration script built in.  I had downloaded Flexbook before
which was an easy to use, very configurable script but it wasn't 
database driven.

After going through both the scripts I started to modify, delete and 
copy some parts of both scrits, combining them into a great guestbook 
script.

After finishing the basic guestbook coding (read and sign), I wanted 
to add more.  I added the administration script which allows you to 
modify and delete entries, change some of the variables in the script, 
and modify the complete HTML of the script.  I also added the ability 
to have private entries so that only people who know the administration
password (setup in the admin script) will be able to view them.

After all this work I have an AMAZING guestbook script that looks 
identical to http://www.gbook.nu and works a lot faster.

***********************************************************************
* WHATS NEW
***********************************************************************

V1.1

- Added line breaks to entries.
- Updated HTML filter, now saves all HTML data and hides
  HTML if on.
- Updated Bad Word filter, now saves all bad words and hides
  them if on.
- Bad Words script is now toggleable through administration script.
- Added edit Bad Words list online through administration script.
  Also defineable through badwords.txt.
- Added edit next entry and previous entry apperance through
  administration script.
- Added a [font] tag definable through administration script and
  can be used in header, entry and footer.
- Added IP and Browser logging through [ip] and [browser]. Only valid
  for entries.
- Added IP banning.  The list is editable online through the administration
  script or through banned.txt.  Won't allow banned IPs from signing the
  guestbook.
- Re-Organized [startnum] and [endnum] for the header.  Will now display
  the actual entry numbers listed when sorting ???-1.
- Fixed editing entries through administration script.  Date and time
  are now togther and var1-6 are below.  Also added IP and browser.

***********************************************************************
* FEATURES 
***********************************************************************

- Easy to setup and use
- Bad Word filter
- IP Logging and Banning
- HTML Filtering
- Required fields
- Database driven
- Private entries to be viewed by administrator
- Highly configurable
- Online modification through administration script (admin.cgi)

***********************************************************************
* INSTALLATION
***********************************************************************

In the archived zip file you should have received the following files:

	* readme.txt		- The file you are reading now
	* admin.cgi		- Administration Script
	* guestbook.cgi		- Guestbook Script
	* signgbook.cgi		- Sign Guestbook Script
	* viewpriv.cgi		- View Private Entries Script
	* setup.db		- The setup file
	* gbook.db		- Guestbook Entry Database
	* header.txt		- Header HTML file.
	* entry.txt		- Entry HTML file.
	* footer.txt		- Footer HTML file.
	* badwords.txt		- Bad words file.
	* banned.txt		- Banned IPs file.

Open guestbook.cgi, signgbook.cgi, viewpriv.cgi and admin.cgi in a text editor.
If perl is not at /usr/bin/perl on your system, change the first line 
of the script to #! and then the location of perl (no spaces).

1) Upload all these files in ASCII mode to your CGI directory 
   (usually cgi-bin or cgi-local).

2) CHMOD the *.cgi files to 755 and the *.txt and *.db files to 666.

3) Go to http://www.(yourdomain).com/(yourcgidir)/admin.cgi and enter 
   in the password box "megabook" without quotes and case sensitive.

4) Change the password right away to anything you want and write it 
   down.

5) Change the settings and layout to however you want them.

6) Go to http://www.(yourdomain).com/(yourcgidir)/guestbook.cgi and 
   view your new guestbook!

For more detailed instructions, go to the megabook download page and
look under installation instructions.

***********************************************************************
* USING THE *.txt FILES                                                          
***********************************************************************

The three files:

	header.txt
	entry.txt
	footer.txt

These are HTML documents.  They contain almost everything that is 
printed out for your guestbook.  You can modify these offline by 
editing them on your computer or you can modify them online
using the administration script.

These files also contain codes within them that the guestbook will 
process into other data.  You can use these codes to help you modify 
your guestbook when you change your entire website.

Each HTML file contain their own valid codes which are:

HEADER.TXT:
-----------

[title]		 - Website Title Variable *
[homepage]	 - Homepage location *
[background]	 - Location of background image *
[bgcolor]	 - Background color *
[textcolor]	 - Text color *
[linkcolor]	 - Link color *
[vlinkcolor]	 - Visited link color *
[alinkcolor]	 - Active link color *
[font]		 - Value of Font Face submitted in administration script.
[htmlstatus]	 - Displays HTML is Enabled or Disabled *
[totalnum]	 - Total number of guestbook entries
[startnum]	 - Starting number of entries
[endnum]	 - Ending number of entries

* defined in administration script

ENTRY.TXT:
----------

[name]		 - Value of submitted 'name' field.
[email]		 - Value of submitted 'email' field.
[comment]	 - Value of submitted 'comment' field.
[var1]		 - Value of submitted 'var1' field. Use this to add more fields.
[var2]		 - Value of submitted 'var2' field. Use this to add more fields.
[var3]		 - Value of submitted 'var3' field. Use this to add more fields.
[var4]		 - Value of submitted 'var4' field. Use this to add more fields.
[var5]		 - Value of submitted 'var5' field. Use this to add more fields.
[var6]		 - Value of submitted 'var6' field. Use this to add more fields.
[date]		 - Date of submitted entry.
[time]		 - Time of submitted entry.
[font]		 - Value of Font Face submitted in administration script.
[ip]		 - Submitter's IP.
[browser]	 - Submitter's browser type.
[entrynum]	 - Entry Number *

* It is suggested that you have this somewhere in the entry.txt file 
  for administrative purposes.

FOOTER.TXT
----------

[font]		 - Value of Font Face submitted in administration script.

***********************************************************************
* MEGABOOK EXAMPLES
* These are just a couple of webpages that you can see Megabook in 
* action.                                                          
*
* You can also add your Megabook to our list on the web at the Megabook
* webpage (http://www.militerry.com/megabook/) by clicking on Megabooks
***********************************************************************

http://www.luvliness.net/ - Click on GBOOK to view. (The first user of Megabook)
http://muted.com	  - Click on guestbook to view. (The second user)
http://hotaru.static.nu/  - Click on Contact then Guestbook to view.
http://www.militerry.com/cgi-bin/megabook/guestbook.cgi

***********************************************************************
* Troubleshooting                                                            
* If you're having problems with the script, please read the following 
* before asking me for help.                                                        
***********************************************************************

* Script returns 500 Internal Server Error
        * Make sure you've changed the first line of the *.cgi files 
          to #! and then the path to perl on your system
        * Make sure you've uploaded all files in ascii mode, not 
          binary.
        * Make sure you've set the permissions for *.cgi to 755 and, 
          *.txt and *.db to 666.

* Password: megabook does not work
        * Make sure you've entered it as all lower case without quotes
        * Make sure you've uploaded setup.db as ascii, not binary.
        * Make sure that you've set the setup.db's permissions to 666.
        * Try using a new copy of setup.db .  You can find one at
          http://www.militerry.com/megabook/files/10/setup.db

***********************************************************************

                        If you still need help, go to
                http://www.militerry.com/megabook/support.htm