Lazarus Guest Book - Installation

From TNG_Wiki
Jump to: navigation, search

Installation of Lazarus Guestbook

In this example I name the folder where the Lazarus software is stored lazarusgb and the TNG file for the guestbook ourguestbook.php. These names can be changed individually but then they must be replaced accordingly in the code.

Download the software (latest Sep 2017):

Guestbook: http://carbonize.co.uk/Lazarus/download.php (V1.24)
Update (beta): http://carbonize.co.uk/Lazarus/Forum/index.php?topic=2730.0 (V1.25 b 1) -- ZIP file at the end of the first post
Language pack(z.B. german or french): http://carbonize.co.uk/Lazarus/download.php

--> The Server is currently not available! (26 Nov 2017)

Load the software to the server

Load the Lazarus software into the new folder lazarusgb in the TNG directory. All files must be overwritten by the update.
Copy the language files (two for each language) in to the Lazarus folder lang.

Settings

Open the file lazarusgb/admin/config.inc.php in an editor and set the access data to your database:

14 /* database settings */
15 
16 $GB_DB['dbName'] = 'database name'; // The name of your MySQL Database
17 $GB_DB['host']   = 'localhost'; // The server your database is on. localhost is usualy correct
18 $GB_DB['user']   = 'user name'; // Your MySQL username
19 $GB_DB['pass']   = 'database password'; // Your MySQL password
20 
21 // You can change this if some of the database table names are already used
22 // or if you want to host more than one guestbook on one database
23 $table_prefix = 'book';
24 
25 // Put your email address here to receive email reports of any errors
26 $TEC_MAIL  = 'you_at_your_domain_dot_com';
27 
28 // If you are using the guestbook as a module in POST-Nuke 0.x or PHP-Nuke 5.x or later set this to true
29 define('IS_MODULE', false);
30 
31 // 
32 // Do not edit below this line unless you know what you are doing
33 //
34 
35 $DB_CLASS  = 'mysql.class.php'; // Change to mysqli.class.php to use mysqli_* functions instead of mysql_* functions

IMPORTANT! If your server use PHP 7, line 35 mysql.class.php must be changed to mysqli.class.php, if it use PHP 5.6 this line will remain as it is.

Activate the software

Call up in your browser: http://www.yourwebsite.com/lazarusgb/install.php
A window opens in which some presettings are displayed:

your base url: http://www.yourwebsite.com/lazarusgb -- OK! This entry can remain as it is (the Lazarus folder)
your guestbook url: http://www.yourwebsite.com/lazarusgb -- this entry must be changed to http://www.yourwebsite.com/ourguestbook.php (the new TNG file for Guestbook)

In this form you can also enter details for the admin access (Username and Password). If the fields remain empty the Username is: test and the Password is: 123.

After you have confirmed with RUN INSTALLER the lines for the guestbook are generated in the database and a confirmation screen is displayed.
Please follow the important instructions, displayed in red: The file install.php must be deleted for safety reasons!

Now the first test can be done: Open your guestbook in your browser: http://www.yourwebsite.com/lazarusgb.

Make the connection to the TNG page

We now create a new file in an editor, e.g. ourguestbook.php and copy the following code into it:

 1 <?php
 2 include( "./tng_begin.php"); // at the beginning only one point if TNG is on the same level as this file
 3 if( !$cms['support'] )
 4 	$cms['tngpath'] = "./"; // same as above. Otherwise two points if this file is in a subfolder to the main directory
 5 
 6 $yourtitle = "Guestbook"; // or something else
 7 
 8 $yourlink = "/ourguestbook.php"; // do not forget the subfolder if this file is not in the main directory! (/subfolder/ourguestbook.php)
 9 
10 $logstring = "<a href=\"$yourlink\">$yourtitle</a>";
11 writelog($logstring);
12 preparebookmark($logstring);
13 
14 tng_header( $yourtitle, $flags ); 
15 ?>
16 <h1 class="header"><img src="img/tng_hist.gif" class="headericon"/>&nbsp;<?php echo $text['MYgbtitle']; ?></h1><br clear="left"/>
17 <?php include('./lazarusgb/gbinclude.php'); // one point as above. Do not forget the folder name where the file gbinclude.php is located!
18 tng_footer( "" );
19 ?>

This code is taken from the file historytemplate.php from the main directory of TNG and adapted to our needs.

Now save the file and load it into the main directory of TNG.
Make a test: http://www.yourwebsite.com/ourguestbook.php (Now the guestbook should already be displayed in your template!?!).

It's not working? Then try to make changes to the path data (one point, two points), check the correct entry of the subfolder etc.
Or make the file historytemplate.php running (... as it is to read in this file) and next when that has worked, copy line 18 (<?php include ...) into this file.

Set a link to your guestbook on the home page and in the menu "Info"

For this, the following mod can be used, which will insert a link into all currently active templates.

Make the guestbook multilingual

So that the guestbook is switching to the language in the same way as TNG's language is switching, we create a new cookie with the name "lang", which the Lazarus Guestbook understands automatically .
If you use the format UTF8 in your TNG installation you must rename all language files in the guestbook (lazarusgb/lang/) e.g. from english to english-utf8.

IMPORTANT! Now the main language has to be redefined and stored in the guestbook analog to the main language of your TNG (Admin: SETTINGS -> general -> Language; store with "Submit Settings").

Setting the links to the guestbook in your template and inserting the language cookie, all together is done by this Mod:
Lazarus Guestbook Link Mod 11.1.2 tested with TNG-Version 11.1.1. and 11.1.2, supported English, German, French

Finished!


Related Links

For Multi-language implementation see Lazarus Guest Book - Multi-lingual Installation

Many thanks to those who published the codes for the integration of Lazarus Gusetbook many years ago. I have just adapted it and connected it with the latest possibilities.

Sites using the Lazarus Guestbook

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

URL User Note GB-Version TNG-Version User-language
Luithlenfamilie Ingo Wagner PHP 5.6.30 11.1.2 11.1.2 DE, EN, NO, FR