#************************************************
# sprainbook
# Created on May 23, 2001
# Manuel Reinhard, sprain@gmx.net, http://www.sprain.ch
#************************************************
#************************************************
# This program is free software. It may be used and modified free   
# of charge for personal, academic or non-profit use. By using this     
# script you agree to indemnify sprain from any liability.               
# Please do not remove this copyright notice. 
#
# For information about installation please read
# readme.txt.
#
# The latest version of this script can be found
# on http://www.sprain.ch/scripts
#
# Don't laugh at my English. I gave my best!  
#************************************************

How to install sprainbook:

1) Put path to perl in first line of 'sprainbook.cgi' (usually #!/usr/bin/perl)

2) Upload 'sprainbook.cgi' to your cgi directory.

3) Make 'chmod 755' to sprainbook.cgi

4) Make 'chmod 777' to the directory where sprainbook.cgi is

5) Prepare your template

6) Upload your template

7) Run Setup


*****
How to prepare your form:

First you need to create a form where visitors can type in their message.
Here is an example:

<form method="POST" action="cgi-bin/sprainbook/sprainbook.cgi">
<input type="hidden" value="newentry">
<input type="text" name="NAME">
<input type="text" name="EMAIL">
<input type="text" name="TEXT">
<input type="submit" value="new entry">
</form>

Additionally you can add
<input type="hidden" name="checkemail" value="EMAIL">
Replace EMAIL with the field name  you want to be checked wether
it is a valid e-mail address or not.

<input type="hidden" name="checkurl" value="URL">
Replace URL with the field name  you want to make a little bit
more sure that it is a valid URL. It doesn't work 100%!

<input type="hidden" name="required" value="NAME, EMAIL, TEXT">
The fields you enter are required to be filled.


*****
How to prepare your template:

You need to make a template where the entries should be shown.
Here is an example:

[REPEAT]
The following sprainbook entry has been made:<br><br>
Date: [DATE]<br>
Name: [NAME] [IF_EMAIL]E-Mail:<a href="mailto:[EMAIL]">[EMAIL]</a>[IF_EMAIL_END]<br>
[TEXT]
[REPEAT_END]

Everything between [REPEAT] and [REPEAT_END] will be used for each sprainbook entry.
Inside the brackets [] you give the name of the fields of your form. They will be replaced
with the entered value. Substitution is case-sensitive!!

If you add [IF_FIELDNAME][IF_FIELDNAME_END] everything between these fields will only be
displayed if the value of FIELDNAME is not empty. 

Additionally to your own fields you can add the following fields:
[DATE]    Displays the date when the entry was made
[PAGES]   Lists all the pages with sprainbook entries
[TOTAL]   Displays the total number of entries

[PAGES] and [TOTAL] can be used anywhere in your template, they don't need to be
between [REPEAT] and [REPEAT_END].

*****
How to run setup:
Simply type:
http://www.yourdomain.com/cgi-bin/sprainbook/sprainbook.cgi?setup


Have fun!

