German
Main Page
CGI-Forum
Internet Speed
Internet Infos
Archiv
Awards
CGI-Links
CGI Help
XWolf.com
My Guestbook
My Homepage
Realm of CGI



Doppelklick - Professionelles Online Werbenetz
Doppelklick

On first glance, the guestbook is just one more of those already offered in the web, but it has more advanced features. With this script it is possible to administrate several guestbooks at once. You don't have to stick to one single form, as most other guestbooks do.

Another advantage is, that the user can chose between to modes of input: one's own, and the one offered by the script. And the script offers a preview function.

Everything this guestbook needs are two files, where one is the datafile, containing all entries, and a file containing the user's configuration. The user is able to adapt everything according to his wishes. Be it background images, be it seperators, texts, couters etc. etc.

Source Code

guestbook.pl
guestbook.var
cgi-library.pl

Complete Source Code in archived form
Archive of all programs and scripts

Sample Execution

Here you will find a sample execution of the program:
http://www.xwolf.com/cgilocal/guestbook.cgi?rw=read&varfile=/home2/xwolf/data/guestbook.var

Execution

Execution of the program can be achieved by calling it from it's exact location: http://www.rrze.uni-erlangen.de/cgi-bin/webadm/guestbook/guestbook.pl (or wherever it is stored) plus two parameters:
  • rw=read/write - With rw=read all entries of the guestbook are read, with rw=write you can make a new entry.
  • varfile=(filename) - Here you call the file, where all important settings of your guestbook are stored.

    The Settings

    These are settings of a sample varfile (a copy of my own):
    # After this point the parameters are starting.
    HTML_TOP==
    # Here you can set in the path of a html-file, which will be displayed before the gb
    HTML_BOT==
    # Here you can set in the path of a html-file, which will be displayed after the gb
    bodytag==background="http://www.rrze.uni-erlangen.de/~unrzc9/pictures/marble2.gif"
    # Here you can define the background of the page. An URL-address.
    titel==Gästebuch von Wolfgang Wiese
    # The title of the guestbook.
    top==<center><img src="http://www.rrze.uni-erlangen.de/~unrzc9/pictures/greenguy.gif"></center>
    # What you want to see above the title. Maybe an icon...
    pre_text==Here you can read all entries of the guestbook and
    entry_ask==make own entries.
    past_text==Have fun
    # This is the message, which is displayed above the guestbook-data.
    # entry_ask is the text, with the link to the input of new entries, why pre_text
    # and past_text are surrounding this field.
    bottom==
    # What you want to see at the end of the page.
    book==/home2/xwolf/data/guestbook.dat
    # The file of the guestbook-entries. Must be (chmod a=rw)
    forbit_html==0
    # If set to 1 , no html-tags are allowed. Else set 0.
    counter==1
    # 1 makes the counter on, 0 off. 2 switches also the hidecounter on. But
    # don't forget to create then the files $book.count and $book.ignore !!
    # You will need the program 'counterlog.pl' to make a html-statistic.
    allow_home==1
    # If 1 , the user can give his homepage too, else 0
    language==german
    # You can set it to 'english' or to 'german'
    seperator==<p>
    # How you want to part different messages...<p> or <hr> or Images
    need_mail==0
    # If the author is forced to give his email-address
    answer_mail==0
    # If an mail will send to the author after his entry. Not yet ready
    add_beginning==1
    # If 1 is set the new entry will be insert at the top of the document
    italic==1
    # Makes the textes of the guests italic, if its set on 1.
    ACCESS==40
    # The number of the accesses to this page. Will add 1 only if its
    # a read-call.
    tempfile1==guestbook.tmp1
    tempfile2==guestbook.tmp2
    # These both files are for internal use. If you don't set them, the
    # default files will be used, which may be used also by many other users.
    # This could lead to the problem, that messages of other books will be saved
    # on your board, or messages will go lost before saved.
    You can leave out some of these parameters, except titel, book, counter, language, and ACCESS. All others will be set to default values then. You should set the counter to 1, so that the varfile is written anew and all default parameters will be inserted. After that, the parameters can be changed again. This method is somewhat more convinient.

    Caution!

    As the entries will be written to a file in your directory, this file has to be write- and readable: CHMOD a=rw (filename). Same is true for the varfile. At first execution, the file for the entries should be empty! Following files are needed:
    • a varfile. See above. Write- and readable
    • an (at first execution empty) datafile for the entries. Write- and readable
    • if the hidecounter is used, two files, with the name of the datafile PLUS the ending '.count' respectively '.ignore'. The '.count'-file has to be write- and readable, the '.ignore'-file needs just reading-attributes. And a readable file has to be created, where the names of logins are stored, that can access the full host-information of the counter. See: The hidden counter (access counter)

    Installation


    Change the following lines according to your server settings:
    Line 1 #!/local/bin/perl5
    Here include the full path to perl
    Line 22 require "/proj.stand/webbin/cgi-bin/webadm/cgi-library.pl";
    Here include the full path to the cgi-library.pl. An installation manual can be found at: http://www.xwolf.com/lib/cgi-library.html
    Line 27 $guestbook_log ='guestbooks.dat';
    Here include the default path, where the guestbooks' log-files can be found at. Status messages will be written here.
    Line 28 $guestbook_helppage='http://www.rrze.uni-erlangen.de/~unrzc9/cgi/guestbook/guestbook.html';
    The URL to the page, where a user's manual for the guestbook can be found. It is given if wrong entries are given.
    Line 29 $progurl = 'http://www.rrze.uni-erlangen.de/cgi-bin/webadm/guestbook/guestbook.pl';
    Here include the complete URL where the guestbook can be called from.
    Line 30 and 31 $tempfile = 'guestbook.tmp1';
    These are for internal use only
    Line 32 $mailprog = '/usr/lib/sendmail';
    Here you have to include the complete path to the unix program 'sendmail'.

Remarks

It is possible to create an own input mask for new entries, and to give the parameters by method 'POST' to the program. In this case you have to set rw=save. Names of variables are e.g.: name, email, homepage, text. I don't think that this is necessary, though. You should leave that to gurus who have nothing better to do...

If some critical error has been made, the program will catch it and report.

If the counter is used, the varfile of the program is rewritten, as in this file the counter stores the number of accesses. Other variables will not be changed due to this. Maybe their order within the file is changed. Lines beginning with a '#' respectively have no value, will be ignored. If parameters are left out, default values will be used. If e.g. the 'header' is left out, the FAU buttons will be used.

Have fun using the guestbook!



Best viewed with
Netscape
Worst viewed with
MSIExploder
© 1997EMail: Wolfgang Wiese, xwolf@xwolf.com