Guestbook using myPHP Guestbook

From TNG_Wiki
Jump to navigation Jump to search

A very good option for creating a guestbook for a TNG site, especially given the security and support issues of Lazarus, is the software entitled "myPHP Guestbook." It is developed by Wolfgang Leverberg, who is very conscientious and helpful. myPHP Guestbook provides very good security and spam protection and handles recent versions of PHP. You can see the guestbook in action on the genealogy site at https://vitter.org/familytree (but please be sure to sign the guestbook! ;-)

You can download the myPHP Guestbook software at https://www.php-guestbook.de/. There are two zip files to download (the second one needed for the embedded version described below). The installation instructions are partly in German.

To include within your TNG site, you can use myPHP Guestoook on your site via iframes, or with a little more work, you can embed the PHP directly into a TNG template. Both approaches use a template file modeled after featuretemplate.php.

iframe Version

The iframe version is easier/cleaner, but there may be some scrolling issues on some systems. For example, on a Mac desktop, you may have to contend with an inner and an outer scrolling bar. On an iPhone, things work seem to work perfectly with the iframe approach. You can test a working version at https://www.vitter.org/familytree/gbookiframe.php.

To implement the iframe version, install the myPHP Guestbook code by following Wolfgang Leverberg's instructions, including putting the file iframe-style.css into your top-level TNG folder (where your TNG files reside). In that same folder, put the file gbookiframe.php. You can get a copy of a working version of gbookiframe.php by going to https://vitter.org/familytree/gbookiframe.txt and then changing the name of the file to end with .php rather than .txt. It assumes that the guestbook folder (which contains the other myPHP Guestbook files) is named myPHPGuestbook, so you should follow that convention. In other words, gbookiframe.php and the folder myPHPGuestbook should both be in the top-level TNG folder.

The gbookiframe.php file is based upon the featuretemplate.php TNG file. It includes the necessary CSS definitions, iframe tag, and javascript call.

Embedded PHP Version

The website https://vitter.org/familytree uses the embedded PHP version of myPHP Guestbook. You can test it out at https://www.vitter.org/familytree/gbook.php.

To implement the embedded PHP version, install the myPHP Guestbook code by following Wolfgang Leverberg's instructions, including putting the file iframe-style.css into your top-level TNG folder (where your TNG files reside). Use the two files gbook.php and gbook_insert.php, which have to be placed in the top-level TNG folder (where your TNG files reside). You can download a working version at https://vitter.org/familytree/gbook.txt and https://vitter.org/familytree/gbook_insert.txt and then change the filenames to end with .php rather than .txt. They assume that the guestbook subfolder is named myPHPGuestbook, so you should follow that convention.

Other Tweaks

  1. The final thing to do is install MyPHP Guestbook (from myphp_guestbook_v13.0.0.0.zip). The mod changes genlib.php to Include the main myPhp Guestbook Include file (only) when your guestbook page is loaded.

If desired (but not necessary), here is a tweak that appears in the guestbook implementation at https://vitter.org/familytree:

  1. For the PHP-embedded version of the guestbook, the site credits at the very bottom of the webpage do not print correctly on the posting page because of conflicting use of the PHP variable $text by both TNG and myPHP Guestbook. I modified stdsitecredit.php to use the PHP variable $JSVtext rather than $text for various text strings. The strings involving $JSVtext are defined in the cust_text.php files in the various language directories, such as languages/English-UTF8.

TNG Sites using myPHP Guestbook

If you have installed myPHP Guestbook, please add your TNG site to the table below:

URL User Note myPHP Guestbook Version TNG Version TNG User languages
Vitter-Weaver Genealogy Jeff Vitter PHP 7.3.27 4.10.6 13.0.3 EN, FR, DE, IT, NO, CH, ES
Wilkinson Family Nick Wilkinson 4.10.6 13.0.3 EN