ZISP Demon Logo
 

[ GuestBook - Reference ]

The Guest Book lets visitors to your page leave comments in a public guestbook.

Dynamic Tools files created within your website:

  • /_zisp_/gbook.txt - text file containing guestbook entries

Template files used by this Dynamic Tool

  • guests.html - displays the guestbook form where visitors can leave their comments.
  • g_ack.html - acknowledges and thanks visitor for their message.
  • g_view.html - displays the entries in the guestbook.

Options available:

  • ID - have multiple independent guestbooks.

GuestBook Setup

Use the following HTML hyperlink to link to your guestbook:

<A HREF="/zisp/guestbook">Click here</A>

Use this HTML hyperlink to display the contents of your guestbook:

<A HREF="/zisp/guestbook_show">Click here</A>

You must also upload an empty guestbook file before your guestbook will function. The file should be named '_zisp_/gbook.txt.


Editing the contents of your GuestBook

The contents of your guestbook are stored in the "gbook.txt" file hidden in the "_zisp_" folder in your website.

You edit the contents by downloading this file, editing it and then uploading it again.

You can download the file from your web browser, by accessing the following page and saving the results as "gbook.txt" on your home computer:

http://www.mysite.com/_zisp_/gbook.txt

You will need to replace "www.mysite.com" with the name of your own web site.

The file will contain the contents of your guestbook.

date<GB:>Tue Nov 16 12:33:27 1999<GB_FIELD_END>
EMAIL<GB:>fred@foo.bar.com<GB_FIELD_END>
NAME<GB:>Fred Bloggs<GB_FIELD_END>
COMMENTS<GB:>Why don't you have a page on Australian
marsupials, like wombats?<GB_FIELD_END>
__ENTRY__
date<GB:>Tue Nov 16 12:32:57 1999<GB_FIELD_END>
EMAIL<GB:>joe@foo.baz.net<GB_FIELD_END>
NAME<GB:>Joe Soap<GB_FIELD_END>
COMMENTS<GB:>I like your website because it has lots
of clever pages!<GB_FIELD_END>
__ENTRY__

Entries are separated by the word "__ENTRY__". Each entry consists of a sequence of fields:

key<GB:>value<GB_FIELD_END>

You can edit this file (for example, using Notepad). Save it and upload it back to your web site, replacing the existing file.

You can clear all the entries in your guestbook by deleting the file from your website. Dynamic Tools will create a fresh "gbook.txt" file the next time someone adds their comments to your guestbook.

Your guestbook can contain up to 50 entries. If you have more than 50 entries, the older ones are deleted.


Customising your GuestBook using Templates

The GuestBook Dynamic Tool uses three template files to generate the pages your visitors see.

If you haven't already done so, you might like to a quick look at the Templates Reference page in this documentation.

Template files should be stored on your website, in a folder called "easyzisp".

The guests.html template

When a visitor clicks on your "/zisp/guestbook" link they will see a page generated from the "guests.html" template:

<h1>Add your comments to my guestbook</h1>

You can add your comments to my guestbook using this
form:

<blockquote>
<form method=POST action="guestbook">
  My name: <input type=text name=name size=30><br>
  My email: <input type=text name=email size=30><br>
  <textarea rows=7 cols=48 name=comments>
I like your website because ...
  </textarea><br>
  <input type=submit value="Submit comments">
</form>
</blockquote>
Thank you!
<p>
<hr noshade size=1>

<form method=POST action="guestbook_show">
<input type=submit value="View My Guestbook">
</form>

<a href="/">Click here</a> to return to my home page.

This template must contain a form with the following parameters:

<form method=POST action="guestbook">

You can use whatever form elements you like in this form. The example above has two textboxes (named "name" and "email") and a textarea named "comments".

Your guestbook will record the value of every form element, and will also record that time and date that the entry was added.

The g_ack.html template

When a visitor to your site adds and entry to your guestbook, the GuestBook Dynamic Tool generates an acknowledgement page from the "g_ack.html" template file.

<h1>Thank you</h1>

Thank you for your message. I have added it to
my guestbook.
<form method=POST action="guestbook_show">
<input type=submit value="View Guestbook">
</form>
<p>
<a href="/">Click here</a> to return to my home page.

The g_view.html template

When a visitor clicks on your "/zisp/guestbook_show" link, they will see a page generated from the "g_view.html" template:

<h1>My Guestbook</h1>

The following entries are in my guestbook:
<blockquote>
<table>
<!--GUESTBOOK ENTRIES-->
</table>
</blockquote>

<form method=GET action="guestbook">
<input type=submit value="Add an entry to my Guestbook">
</form>
<p>
<a href="/">Click here</a> to return to my home page.

This template generates a page with the contents of your guestbook. It has one special tag: "<!--GUESTBOOK ENTRIES-->". This tag must enclosed inside an HTML table ("<TABLE>" and "</TABLE>").

When the webserver displays this template, it replaces the special "<!--GUESTBOOK ENTRIES-->" tag with the contents of your guestbook. The most recent entries in your guestbook are displayed first.


Using multiple GuestBooks

You might want to have several guestbooks. You can do this by giving each separate guestbook its own "ID".

<A HREF="/zisp/guestbook?ID=NN">Click here</A>

... and

<A HREF="/zisp/guestbook_show?ID=NN">Click here</A>

... where "NN" is a number between 0 and 99.

For example, the guestbook with ID "45" will store its contents in the file "gbook45.txt" in your "_zisp_" directory. The standard gbook.txt file is created automatically, however these extra guestbook files must be created manually by you before they can be used. Your ISP should provide details on how to do this. Zisp will try to use the templates named "guests45.html", "g_ack45.html" and "g_view45.html" in your "easyzisp" directory, if they exist.