WebsiteX5.info - The ultimate guide for Incomedia's WebsiteX5

Search this site

Go to content

Main menu:


Add a guestbook to your WebsiteX5 site

How to...

Note! To be able to use the guestbook script described on this page your provider must support PHP and you will have to make some minor adjustments to some of the php-files. You will also need an FTP-client to upload the script...

A guestbook is a nice way to get some feedback on your hard work on your website. On the internet you can find all sorts of guestbook script. There are also sites where you can sign up for a guest book, but then you get all sorts of advertising that you might not want. In this article I describe how to set up your own guestbook in WX5 based on one of the many guestbook scripts available

I have chosen for the free Gbook script from Klemen Stirn. This script is easy to implement and has lots of functionality and such as anti-spam fighting, e-mail notification when new message are posted and a stylesheet which you can modify to change e look of your guestbook.

You can download the script files from the link above. Take some time to read the page and try out the demo. When you like what you see this is how to implement it in WX5.

Download the zip-file containing the script and other files which are needed and unzip the package in a folder on your local hard drive.

In the unzipped folder there is a file called readme.htm. Take some time to read this file. Go to this folder with the explorer .

Parameters
Open the file 'settings.php' with your favourite text editor (notepad will be fine) and change the settings to suit your site. The installation section of the readme.htm file describes the parameters in detail. For those of you who do not have any php-experience, watch out that you do not remove any quotes in the strings you are about to edit...

A small tweak
The guestbook contains a link back to your site. Because we will later use an iframe (look at it as a site within a site) to pull the guestbook into your site we will need to disable this link. Otherwise your visitors will see your site within your site (does this make sense?).

Make a copy of the file gbook.php to gbook.php.save (just in case something goes wrong).

Then edit the file gbook.php with a text editor.
Search for the text '
t61' (without the quotes). There is only one occurence in the file:

echo '<h3 style="text-align:center">'.$settings['gbook_title'].'</h3>
<p style="text-align:center">
<a href="'.$settings['website_url'].'">'.$lang['t61'].' '.$settings['website_title'].'</a>
|
<a href="gbook.php">'.$lang['t60'].'</a>
| <a href="gbook.php?a=sign">'.$lang['t48'].'</a></p>
<div class="centered">
';


And just delete the red text (from '<a href=...' to "</a> |', including the first vertical bar '|').

Save the file.

Uploading to your server
You are now ready to upload the files to your webserver. Open your site in an FTP-program. I use FireFTP, which is a free plugin to the Firefox browser, but there are many other good FTP-programs which you can use...

Browse to the root of your website, create a new folder, for example '/guestbook' or /httpdocs/guestbook' and point your ftp-program to this new folder.

Upload the complete contents of the folder containing your script files to the webserver.

Users must be able to write their entries to the webserver, so the file which contains the guestbook entries must be made writeable. When you use FireFTP you can just right click on the file on the webserver and select properties:



The owner, the group and the Public must have Read and Write permission (Manual chmod 666) to be able to use the guestbook.

You can now test your guestbook by opening a browser and surf to the addres http://<yourwebsite>/guestbook/gbook.php.

To get you guestbook in WX5
To embed your guestbook into WX5 is simple.

Go to the 'Map Creation' dialog and add a new page, for example 'Guestbook'

Edit this page and select the number of rows and columns. Now add a new HTML Code object to the page and make it wide enough. Set the height to a suitable value. I have chosen 804 pixels.

Now double click on the HTML Code object and enter the following code in the HTML-code, replacing ' <your website> with the address of your site.

<iframe src="http://<your website>/guestbook/gbook.php" width=614 height=800 frameborder=0>
</iframe>

Make sure you make the HTML Code object a few pixels bigger than the size of the <iframe> to suppress any scrollbars. In this example the HTML Code object is 618x804 pixels...

Click on OK and save!

You are now ready to test the website. You can press the test-button and this gives you an impression of how the page will look. However, the full functionality of the guestbook can only be used after you have exported you website to your web space because the PHP needs a PHP-interpreter...

Change the appearance of the guestbook
You can make slight alterations to the appearance of the guestbook by editing the file style.css. For example, when you want to have a red background as a header then open the file style.css. Look for

td.upper {
color : #FFFFFF;
background : #23559C;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
}

and change ' background : #23559C;' to 'background : #FF000;'. After saving and reuploading the file to your webserver you can see the changes.

Don't be shy to experiment with the stylesheet, but always make a copy of the original! There are plenty of good CSS manuals on the internet...

Have fun!


Back to content | Back to main menu