Thank you for your interest in our Guestbook Script. We recommend that you carefully read this documentation.
Smilies powered by eLouai Smilies
The script has been configured in a way that makes it ready to use. After uploading all script files to your web server by FTP and running the database table installation routine you can work with the script.
Please make sure the script directory has writable permissions (chmod 777) during the installation process.
When you intend to edit the script you should do that step by step. After each change you should run the script to monitor the effects. Doing so enables you to know what change causes an error.
The HTML templates of the script have been generated by the specifications of XHTML 1.0. HTML tags like <br> or <input> contain an ending slash (<br /> or <input type="text" name="feld" />).
The script works like a classic guestbook script. Visitors of your website can read an entry list - last entry first. The visitor can sign the guestbook by using a form.
The administrator can edit and delete guestbook entries. The admin can login via "/admin/index.php" by using the database access data (username and password). After logging in the Admin can create and remove the database tables. Additionally each guestbook entry will be expanded by additional information such as IP address and browser and the delete and edit links as well.
The file "config.php" is the configuration file of the script. To edit the settings open the file in a text editor (i.e.: Wordpad under MS Windows).
The following variable $database contains the MySQL access data. You will get those access data when you create a database or ask your web space provider. Description of the $database variables:
$database['host'] | Name of the database server, i.e.: localhost.
|
|
$database['name'] | Name of the database.
|
|
$database['user'] | Username of the database.
|
|
$database['pass'] | Database password.
|
|
$database['prefix'] | To tell apart the guestbook script tables from the existing ones you can
add a prefix to the database table names.
|
|
|
The following variables can be edited:
$language | You can set here the language. Enter the abbreviation that is used in the
language file name that is stored in the directory "languages" ("en" in
languages.en.inc.php and "de" in languages.de.inc.php).
|
|
$results_per_page | This variable contains the number of guestbook entries per page. In
case the number of entries is higher than the number of results per
page the script displays links to navigate between the guestbook pages.
You can leave this variable empty and display all entries on one single
page.
|
|
$direct_page_links | In case the guestbook has a high number of entries the link list to the
guestbook pages can get quite long. Therefore, you can define the number
of links you want to be displayed. I.e. if you have 20 guestbook pages
you will get the following direct link list:
|
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
||
You could set a limit of 9 links. All numbers after 9 would be replaced
by dots (can be changed within the HTML template).
|
||
1 2 3 4 5 6 7 8 9 ...
|
||
The link display would be changed by page 6:
|
||
... 2 3 4 5 6 7 8 9 10 ...
|
||
Tip: You can test this behavior by doing some test entries. Set the
numbers of entries per page to 1.
|
||
$show_error_messages | The default value of this variable is set to "yes" by default so during
the configuration process you will get error messages and hints that
help you to install the script. Once the script configuration have been
finished you can set those system messages off because it is not necessary
to give extern visitors a view inside the system.
|
|
$path['templates'] | This file contains the path to the directory where the HTML template are
stored.
|
|
$file[] | All $file[] variables contain template file names. Those template files
are described in the chapter "HTML Templates".
|
|
$add_text | You can add further values, text, variables or other content to this
variable. That content can be displayed in the HTML templates by using
markers/placeholders within curly brackets { and }.
|
|
If you want to add your own values to the variable $add_text please
follow the pattern from the example entries.
|
$add_text = array( 'txt_additional' => 'Additional', 'txt_more' => 'More' );
The first part of each entry is the name of the placeholder. In case you want to use the value of 'txt_addition' in your template enter the name of the entry with curly brackets - {txt_addition}. The name must not contain white spaces or special characters. Only allowed is the _ .
Create the following folders on your web server (with the most FTP clients you are able to copy the hole script with all folders in one go):
/guestbook/ /guestbook/inc/ /guestbook/languages/ /guestbook/templates/
Copy all files to their corresponding folder. Image files (.gif, .jpg, .png) have to be uploaded in binary mode. Every other files have to be uploaded in ASCII mode (text mode).
Before uploading you need to enter the MySQL details in the file "config.php". Please ask your web space provider for the MySQL access data.
Description of the $database variables:
$database['host'] | Name of the database server, i.e.: localhost.
|
|
$database['name'] | Name of the database.
|
|
$database['user'] | Username of the database.
|
|
$database['pass'] | Database password.
|
|
$database['prefix'] | To tell apart the guestbook script tables from the existing ones you can
add a prefix to the database table names.
|
|
|
When you have entered all data and uploaded all updated files you can install the database tables. To accomplish that you need to login the admin area (/admin/index.php) and open the "Database" page. At the bottom of the page you'll find the table list and the status of each table. Click on "Install table" to create the table.
The file "form_config.php" contains the form field configuration. Each form field will be defined in the following pattern:
$new_form_fields[] = array( 'name' => 'name', 'label' => 'Name', 'type' => 'text', 'required' => 'yes', 'value' => '' );
Every form field definition contains certain elements:
Beside the original script options you can add your own options. Those options will be added to the form field automatically. Possible options would be: maxlength, size, cols, rows, selected, checked. You can also add CSS content like: class, style.
Example:
$new_form_fields[] = array( 'name' => 'comment', 'label' => 'Kommentar', 'type' => 'textarea', 'required' => 'yes', 'value' => '', 'cols' => '20', 'rows' => '10', 'style' => 'padding:5px;' );
This form field definition produces a multi line text field ('type' => 'textarea') with the intern name "comment" ('name' => 'comment'). On the HTML page appears the label "Comment" ('label' => 'Comment'). This field is required to fill in ('required' => 'yes'). The visitor have to enter a value to write a guestbook entry. No default value is defined ('value' => ''). The text field has a width of 20 columns ('cols' => '20') and a height of 10 rows ('rows' => '10'). Additionally the field gets a margin of 5 pixel - defined by CSS ('style' => 'padding:5px;').
To see how the form field configuration works you can take a look at the file "form_config_example.php" where every possible form field has been defined. The corresponding HTML template is "form_detail_example.tpl.html". Open the file "sign_example.php" to see how the form looks in your browser.
Please open the template "form_detail.tpl.html" in your text editor to see how the form fields are placed.
The form field definition produces automatically two placeholders: {label:...} and {field:...}. The dots can be replaced by the name of the form field, i.e.: {label:name} and {field:name} or {label:comment} and {field:comment}.
The placeholder {label:...} contains the name of the form field that you want to show to the visitor. The placeholder {field:...} contains the HTML code of the form field, i.e.: <input type="text" name="name" value=" " size="30" style="width:350px;" />
The form field names also appear as placeholders ({name} or {comment}) in the template "entry_detail.tpl.html" within the LOOP block . They will be replaced by the values that are stored in the database.
The directory "templates/.../" contains the files for the layout. You can use HTML and CSS to customize the layout as you wish. The already existing subfolders "derfault" and "simple" are examples how to customize the guestbook.
In case you are using a WYSIWYG editor like Adobe GoLive, Macromedia Dreamweaver, MS Frontpage or NetObjects Fusion please make sure the software does not make any changes by itself.
The template files contain markers with curly brackets { and } like: {txt_next_page}. These markers will be replaced by its counterparts from the language file "languages/language.en.inc.php". You are free to edit that file and change the words and phrases. You are also free to replace the markers within the template files by real words or put those markers to other positions within the template file. And you are also able to enhance the language file by using the given pattern.
Amongst those word markers exist the so called loops. Similar to HTML tags the two parts (<LOOP …>…</LOOP>) must not be separated. If you want to alter the position within the template you need to move the whole block.
There are also IF blocks. These are to display or remove parts of the HTML code under certain conditions. The IF blocks can be handled in the same way as the loop blocks.
main_layout.tpl.html
This file can contain the layout elements that apply for all pages. All guestbook pages are then using automatically the same layout. You can leave this file empty and define an individual layout for each guestbook page.
The file contains the special placeholder {main_content}. This placeholder will be replaced by the script with the content of the detail templates. This placeholder must not be removed or altered - even if the file shall not contain any layout content.
The main template contains also the placeholder {txt_title} within the title tag (<title>...</title>). That placeholder has been defined in the file "config.php" in the variable $add_text. The used variable $script_title can be defined within the several PHP files (index.php, delete.php, edit.php, login.php, sign.php). Just enter the page title you want.
entries.tpl.html
This file contains the layout of the guestbook entry page. It contains the following elements:
<IF NAME="logged_in">
If the administrator has been logged in, the log out link will be displayed.
{txt_entries} {txt_page} {currentpage} {txt_page_of} {allpages}
These placeholders contain information about number of guestbook pages and the number of the current page.
<IF NAME="previous_result_page">
This IF block contains navigation links.
<IF NAME="page_link_start"> <IF NAME="page_link_end">
If you have limited the number of direct links to the guestbook pages the content of these IF block will be displayed at the beginning or/and the end of the link list.
<LOOP NAME="page_direct">
Within this LOOP block the direct links to the guestbook pages will be displayed. You will get a link list that consists of numbers (1 2 3 4 5 6 7 8 9 ...).
<IF NAME="next_result_page">
This IF block contains navigation links.
{entry_detail}
The detail layout of the guestbook entries are stored in the file "entry_detail.tpl.html".
entry_detail.tpl.html
<LOOP NAME="guestbook_entries">
Within this LOOP block appear the names of the form fields as placeholders (i.e.: {name} or {comment}). These placeholders are replaced by database values.
The script automatically creates variables that contain the modified content of the guestbook entries. Following changes will be made:
Instead of the usual variable (placeholder) you need to use an enhanced variable like following:
{modified:...}
The field {comment} changes into {modified:comment}.
sign.tpl.html
edit.tpl.html
<LOOP NAME="message">
This LOOP block displays notes and error messages, i.e. when a required field has not been filled in by the user.
{form_detail}
This placeholder will be replaced by the content of the form detail template "form_detail.tpl.html".
form_detail.tpl.html
The form field definition produces automatically two placeholders: {label:...} and {field:...}. The dots can be replaced by the name of the form field, i.e.: {label:name} and {field:name} or {label:comment} and {field:comment}.
The placeholder {label:...} contains the name of the form field that you want to show to the visitor. The placeholder {field:...} contains the HTML code of the form field, i.e.: <input type="text" name="name" value=" " size="30" style="width:350px;" />
{emoticon_list}
This variable will be replaced by the list of available emoticons (smilies). If you don’t want to use emoticons just remove this variable.
For the answers to your questions about Form Mail, and for the solutions to your problems with Form Mail, visit our support forum.
You can use the Guestbook Script for free. If you want to run the script without the link to STADTAUS.com you can purchase the full version online.
Contact: http://www.stadtaus.com/en/
More Scripts at STADTAUS.com:
Please visit our project MetaCollection. It is a resource for CGI and PHP related script archives.