Page 1 of 1

Message to appear on the 'View Guestbook' pages only

Posted: Sun May 16, 2010 2:48 pm
by Annie
Script URL: http://www.hibbitt.org.uk/guestbook/gbook.php
Version of script: 1.7
Hosting company: AddAction
URL of phpinfo.php: http://www.hibbitt.org.uk/phpinfo.php
URL of session_test.php:
What terms did you try when SEARCHING for a solution: comments add text, additional text

Write your message below:

Hi,

Just getting to grips with this script and loving it. I have a question.

Is it possible to show a short message which will appear on the pages where you view the guestbook only, ie. I don't particularly want the message in the header.txt or overall_header because I don't want to see it on the Sign Guestbook or Admin pages. If you go to my guestbook at http://www.hibbitt.org.uk/guestbook/gbook.php I'm referring to the introduction text under The Guestbook heading. I tried placing it in the comments file but it appears with every comment so that's no good.

I don't really know php so some guidance would be greatly appreciated.

Posted: Sun May 16, 2010 7:03 pm
by Henrie
Hello Annie,

To do this you can change overall_header.txt
Change

Code: Select all

<!--CUSTOM HEADER -->
<?php
include('header.txt');
?>
<!--CUSTOM HEADER END -->
to

Code: Select all

<!--CUSTOM HEADER -->
<?php
include('header.txt');
/* Get the action parameter */
$a = isset($_REQUEST['a']) ? gbook_input($_REQUEST['a']) : '';
if (empty($a)) {
echo 'Text only to be displayed on the view guestbook page.<br />';
}
?>
<!--CUSTOM HEADER END -->
Just be carefull not to use single quotes in your text line. Or if you have to, escape them using a backslash (\')

Greetings,
Henrie

Posted: Sun May 16, 2010 8:08 pm
by Annie
Thank you once again Henrie. I'm all set now.

Cheers, Annie