Page 1 of 1

No include_once for footer.txt in Gbook 1.7

Posted: Mon Aug 24, 2009 7:25 pm
by hite-site
Script URL: http://teresajames.com/gbook/gbook.php
Version of script: 1.7
Hosting company: http://godaddy.com
URL of phpinfo.php: http://teresajames.com/info.php
URL of session_test.php: http://teresajames.com/page1.php
What terms did you try when SEARCHING for a solution:
include_once footer.txt

Write your message below:

I just installed GBook 1.7 and my footer.txt contents are not included in the code generated by gbook.php. I can find the include_once for header.txt in /gbook/templates/default/overall_header.php, but I cannot find an include_once for footer.txt. Have I missed some new implementation requirement? Please advise.

Regards,

Page Hite

Posted: Mon Aug 24, 2009 10:06 pm
by Henrie
Hello Page,

I think you have discovered an error in the guestbook. Because after testing it i could not get the text in the footer.txt file to show either.

I think the error is in the overall_footer.php file included in the templates/default folder.

The code in the overall_footer.php is now

Code: Select all

<div class="clear">&nbsp;</div>

<div align="center" class="gbook_bottom">
<?php echo $settings['pages_top']; ?>
</div>

<!--NOSPAM BANNER -->
<?php 
if ($settings['show_nospam'])
{
	?>
	<div id="gbook_no_spam" class="gbook_no_spam" align="center"><a href="http://www.phpjunkyard.com/tutorials/guestbook-spam.php" <?php echo $settings['target']; ?>><img src="<?php echo $settings['tpl_path']; ?>images/no_spam.gif" width="223" height="94" border="0" alt="Stop Guestbook SPAM" title="Stop Guestbook SPAM" /></a></div>
	<?php
}
?>
<!--NOSPAM BANNER END -->

</body>
</html>
I think it should be

Code: Select all

<div class="clear">&nbsp;</div>

<div align="center" class="gbook_bottom">
<?php echo $settings['pages_top']; ?>
</div>

<!--NOSPAM BANNER -->
<?php 
if ($settings['show_nospam'])
{
	?>
	<div id="gbook_no_spam" class="gbook_no_spam" align="center"><a href="http://www.phpjunkyard.com/tutorials/guestbook-spam.php" <?php echo $settings['target']; ?>><img src="<?php echo $settings['tpl_path']; ?>images/no_spam.gif" width="223" height="94" border="0" alt="Stop Guestbook SPAM" title="Stop Guestbook SPAM" /></a></div>
	<?php
}
?>
<!--NOSPAM BANNER END -->

<!--CUSTOM FOOTER -->
<?php
include_once 'footer.txt';
?>
<!--CUSTOM FOOTER END -->

</body>
</html>
And even if this is not the way Klemen has meant the code to be. This way it works correctly.

What remains is for Klemen to fix the code to show the footer.txt contents in the new version.

Greetings,
Henrie

Posted: Tue Aug 25, 2009 5:27 am
by hite-site
Thanks for taking a look at it. I eventually gave up on using header.txt and footer.txt and just modified overall_header.php and overall_footer.php to meet my needs. In the case of the header, it was just easier to get all the scripts and links where they needed to be in the head section.

Regards,

Page Hite

Posted: Tue Aug 25, 2009 5:37 am
by Klemen
Right, the code is missing and the one posted by Henrie is correct one to use. Sorry for that, I already updated the download files.

Posted: Tue Aug 25, 2009 5:44 am
by Henrie
hite-site wrote:In the case of the header, it was just easier to get all the scripts and links where they needed to be in the head section.
I understand what you mean. I noticed this missing too. It has been asked a lot of times to be able to add code to the <head> ... </head> section of GBook. For example by using an additional htmlhead.txt file.
But now with the overall_header.php file it is also not so hard to do.