Tips & tricks & hacks: GBook Guestbook Wednesday, 12 June 2024 @ 20:22:52

My changes to the stock GBook PHP Guestbook, to tweak it to suit my needs

(these are just notes to myself)

Note 1:  The information on this page is for my own use, to help me configure things on my own websites, such as when I install/reinstall things.   If you find anything of use for your own sites, help yourself.
   
Note 2:  Some of my websites I host locally from inside my home, using a Windows web server. My other websites are hosted externally in the USA, using a Linux web server. Windows & Linux use different syntax for accessing files, hence below I have logic to determine if the page is being called from internally or externally, what web server the page is being called from, and then uses the required PHP includes related to that web server.
   
Note 3:  I have hundreds of pages on my many sites that use the items listed below.  If I change the format for any of those items, which I do from time-to-time, rather than having to change that format in hundreds of pages, I make the change in only 1 single place, and then I use the PHP include statements shown below to call the files with the changes in them.  That way, I never need to change the hundreds of pages on my sites.
   
Note 4:  Although the below changes/hacks work for me, I make no guarantees as to your results... any disasters that occur are not my fault.  Use at your own risk... do a backup before making changes to your own files.

 Hack #   Purpose (more-or-less in alphabetical order)   File   Change   Contributor 

 

Footer

To add my own Footer, below that stock GBook footer

Included in my footer are the following:
 
  1. Copyright
  2. Google reCAPTCHA v3
  3. Hosting Banner
  4. TOP button
  5. Tracking (phpWebStat)

 

footer.php
 The footer file that comes with GBook is empty:     
 Add these lines in red:    <?php
    if
        ($_SERVER['REMOTE_ADDR'] == "192.168.2.1") {
            include 'D:\Web\_common\_globals\jmm_global_footer.php';
            echo    '<br>';
            include 'D:\Web\_common\_globals\jmm_global_banner_hosting.php';
            include 'D:\Web\_common\_globals\jmm_global_tracker_phpwebstats.php';
            include 'D:\Web\_common\_globals\jmm_global_code_red-button.php';
            include 'D:\Web\_common\_globals\jmm_global_google_recaptcha.php';
    } elseif
        ($_SERVER['REMOTE_ADDR'] != "192.168.2.1") {
            include "/home/panauro1/public_html/common/_globals/jmm_global_footer.php";
            echo    '<br>';
            include "/home/panauro1/public_html/common/_globals/jmm_global_banner_hosting.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_tracker_phpwebstats.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_code_red-button.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_google_recaptcha.php";
            echo    '<br>';
?>
Figured it out
by myself

 

1

Copyright

To add Copyright information

 

footer.php
 The line(s) in red pertain to the Copyright   <?php
    if
        ($_SERVER['REMOTE_ADDR'] == "192.168.2.1") {
            include 'D:\Web\_common\_globals\jmm_global_footer.php';
            echo    '<br>';
            include 'D:\Web\_common\_globals\jmm_global_banner_hosting.php';
            include 'D:\Web\_common\_globals\jmm_global_tracker_phpwebstats.php';
            include 'D:\Web\_common\_globals\jmm_global_code_red-button.php';
            include 'D:\Web\_common\_globals\jmm_global_google_recaptcha.php';
    } elseif
        ($_SERVER['REMOTE_ADDR'] != "192.168.2.1") {
            include "/home/panauro1/public_html/common/_globals/jmm_global_footer.php";
            echo    '<br>';
            include "/home/panauro1/public_html/common/_globals/jmm_global_banner_hosting.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_tracker_phpwebstats.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_code_red-button.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_google_recaptcha.php";
            echo    '<br>';
?>
Figured it out
by myself

 

2

Google reCAPTCHA v3

To enable Google reCAPTCHA v3 for GBook Guestbook

 

footer.php
 The line(s) in red pertain to reCAPTCHA   <?php
    if
        ($_SERVER['REMOTE_ADDR'] == "192.168.2.1") {
            include 'D:\Web\_common\_globals\jmm_global_footer.php';
            echo    '<br>';
            include 'D:\Web\_common\_globals\jmm_global_banner_hosting.php';
            include 'D:\Web\_common\_globals\jmm_global_tracker_phpwebstats.php';
            include 'D:\Web\_common\_globals\jmm_global_code_red-button.php';
            include 'D:\Web\_common\_globals\jmm_global_google_recaptcha.php';
    } elseif
        ($_SERVER['REMOTE_ADDR'] != "192.168.2.1") {
            include "/home/panauro1/public_html/common/_globals/jmm_global_footer.php";
            echo    '<br>';
            include "/home/panauro1/public_html/common/_globals/jmm_global_banner_hosting.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_tracker_phpwebstats.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_code_red-button.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_google_recaptcha.php";
            echo    '<br>';
?>
Figured it out
by myself

 

3

Hosting Banner

To add a Hosting Banner to the footer



 

footer.php
 The line(s) in red pertain to the BANNER   <?php
    if
        ($_SERVER['REMOTE_ADDR'] == "192.168.2.1") {
            include 'D:\Web\_common\_globals\jmm_global_footer.php';
            echo    '<br>';
            include 'D:\Web\_common\_globals\jmm_global_banner_hosting.php';
            include 'D:\Web\_common\_globals\jmm_global_tracker_phpwebstats.php';
            include 'D:\Web\_common\_globals\jmm_global_code_red-button.php';
            include 'D:\Web\_common\_globals\jmm_global_google_recaptcha.php';
    } elseif
        ($_SERVER['REMOTE_ADDR'] != "192.168.2.1") {
            include "/home/panauro1/public_html/common/_globals/jmm_global_footer.php";
            echo    '<br>';
            include "/home/panauro1/public_html/common/_globals/jmm_global_banner_hosting.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_tracker_phpwebstats.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_code_red-button.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_google_recaptcha.php";
            echo    '<br>';
?>
Figured it out
by myself

 

4

TOP button

To place a red TOP button in the bottom-left corned of the page

 

footer.php
 The line(s) in red pertain to the TOP button:    <?php
    if
        ($_SERVER['REMOTE_ADDR'] == "192.168.2.1") {
            include 'D:\Web\_common\_globals\jmm_global_footer.php';
            echo    '<br>';
            include 'D:\Web\_common\_globals\jmm_global_banner_hosting.php';
            include 'D:\Web\_common\_globals\jmm_global_tracker_phpwebstats.php';
            include 'D:\Web\_common\_globals\jmm_global_code_red-button.php';
            include 'D:\Web\_common\_globals\jmm_global_google_recaptcha.php';
    } elseif
        ($_SERVER['REMOTE_ADDR'] != "192.168.2.1") {
            include "/home/panauro1/public_html/common/_globals/jmm_global_footer.php";
            echo    '<br>';
            include "/home/panauro1/public_html/common/_globals/jmm_global_banner_hosting.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_tracker_phpwebstats.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_code_red-button.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_google_recaptcha.php";
            echo    '<br>';
?>
Figured it out
by myself

 

5

Tracking (phpWebStat)

To track GBook access using phpWebStat

 

footer.php
 The line(s) in red pertain to phpWebStat   <?php
    if
        ($_SERVER['REMOTE_ADDR'] == "192.168.2.1") {
            include 'D:\Web\_common\_globals\jmm_global_footer.php';
            echo    '<br>';
            include 'D:\Web\_common\_globals\jmm_global_banner_hosting.php';
            include 'D:\Web\_common\_globals\jmm_global_tracker_phpwebstats.php';
            include 'D:\Web\_common\_globals\jmm_global_code_red-button.php';
            include 'D:\Web\_common\_globals\jmm_global_google_recaptcha.php';
    } elseif
        ($_SERVER['REMOTE_ADDR'] != "192.168.2.1") {
            include "/home/panauro1/public_html/common/_globals/jmm_global_footer.php";
            echo    '<br>';
            include "/home/panauro1/public_html/common/_globals/jmm_global_banner_hosting.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_tracker_phpwebstats.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_code_red-button.php";
            include "/home/panauro1/public_html/common/_globals/jmm_global_google_recaptcha.php";
            echo    '<br>';
?>
Figured it out
by myself

HTML Entities Encoder/Decoder website used to encode & decode the above HTML-code to text

This page was last modified (timestamped): Monday, 10th June 2024 @ 23:23:06 EDT (America/Toronto) / UTC -04:00
Tuesday, 11th June 2024 @ 03:23:06 GMT (UTC)
86FCB3C656092C347D03FF9C3763B69FE7D6BF16
359 unique visits

FusionWings.com © Copyright 2008-2024 by John Mark Motyer, CD [8.3.8]