Lazarus Guest Book - Multi-lingual Installation
0 bytes removed
02:25, 17 August 2008
Lazarus Guest Book - installation hints
<font color=gray><div align="center" style="text-align: center;font-size: 200%; font-weight: bold; margin: 10px auto;">
'' How to: Install the Lazarus Guest Book inside TNG"
== First of all, you can see how it works ==
Access my website at www.ourfamilylinks.org[http://www.ourfamilylinks.org]
Any questions, please send me an e-mail -- ChuckFilteau@gmail.com
== Obtaining the Lazarus Guest Book ==
First of all, you must obtain the Lazarus Guest Book files from http://carbonize.co.uk/Lazarus/download.php
and store them on your PC
*Be sure to download the '''''additional''''' languages if your TNG site supports languages other than English
== Creating the Lazarus folder at your TNG server site ==
* Go to your server and create a folder (let's call it '''lazarusgb''') on the same folder level that you used to install your TNG product.
<font color=red>I prefer to send the zipped file(s) to my server and unzip them at the server level, but you might prefer to unzip them on your pc and download each of the files and folders separately.</font>
* Upload all the lazarus files to the '''lazarusgb''' folder
* Unzip them, if necessary, in that same folder
== Word of caution when making changes to files ==
* you must always make a backup copy of any file you expect to modify, just in case you make an error.
== If you have '''''multi-language''''' support in TNG ==
<font color=green>This step can be '''skipped''' if your site is only supporting one language.</font>
You must add language-dependent text to '''''each''''' TNG language folder
* For '''''each''''' language folder (English, French, etc) you must edit the '''text.php''' file
Near the bottom of the '''text.php''' file you will find the words
Insert two lines ''above'' that statement to give the proper language spellings. Here is the '''English''' example.
// Text to appear in the TNG menus for the linkage to the Guestbook
$text['MYgblink'] = "Guest Book";
// Text to appear in the title on the Guestbook page:
$text['MYgbtitle'] = "Welcome, please sign our Guest Book";
* <font color=red> Be sure to SAVE the file, and then repeat the same process for '''''each''''' language folder, using the correct language for the text inside the double-quotes.
== Creating a php file in TNG to access your guest book ==
* Using the folder that you used to install TNG
Create a ''new file'' (let's call it '''Ourguestbook.php''')
* Edit that file, using the following example.
Note - I obtained the following example from Ken Roy and modified it slightly
(I put a horizontal rule under the tng_coreicons)
* Note the include for the '''lazarusgb/gbinclude.php '''
$database_username,$database_password) or exit;
// * * * *
// tng_header( "$text['MYgbtitle'] ", $flags );
// If using multiple languages in TNG, use the example above
// to change the line below
tng_header("Welcome, please sign our Guest Book",$flags );
<p class="header"> </p>
// NOTE - the original include had 2 dots in front, i.e., ../lazarus ...
// YOU might need the extra dot
<?php tng_footer( "" ); ?>
<font color=red> Be sure to save it! </font>
== Testing your newly defined GuestBook panel ==
* at this point in time, you only want to verify that your GuestBook can come up in '''English'''.
* you should be able to test your TNG guestbook panel directly from the file manager on your server
* Or you can test it from your browser on your pc by opening a new window (or tab) and keying the complete url path to your guest book
* If you get any errors, go back and make the appropriate corrections.
== Modifying the TNG files so that it can access your guestbook panel ==
* Modify the '''index.php''' that belongs to your TNG installation and '''''any other secondary php files''''', as necessary.
Somewhere, in an appropriate place on TNG's home panel, insert the following text:
<font color=red> use the following code if your TNG uses only '''one''' language</font>
echo "<li><a href=\"Ourguestbook.php \">Please sign our Guest Book</a></li>\n";
<font color=red> use the following code if your TNG site is '''multi-lingual''' </font>
echo "<li><a href=\"Ourguestbook.php \">$text[Mygblink]</a></li>\n";
* be sure to save the file after you have changed it
== Verifying you can access the guestbook from your home panel ==
* Using your browser, access your web site
* Select the guest-book-linkage that you just added to your menu
<font color=green> Congratulations. You have successfully installed the Lazarus Guest Book with TNG. At this time you are finished with the TNG update process if your site supports only '''one''' language.
The Lazarus '''Administration''' function is an entirely different matter. It can control if and how CAPTCHA is used, among other things. Hopefully, someone (''maybe me in the near future'') will post that information in this forum.</font>
* Hopefully, you will have no errors; otherwise, you will have to go back and fix any errors in the file(s) and test it/them again.
* '''But there is still more to do if your TNG site is '''''multi-lingual'''''.'''
== Determining the name of the cookie that TNG sets when a user has set a language in TNG ==
<font color=red> Apparently, various releases of TNG and various servers use different styles of naming conventions for cookies. </font>
* So here is my solution to determine the name of the cookie that contains the language
First of all, you need to get a copy of Firefox and install it on your computer
Then you need to install a copy of some web developer tool that will let you see "stuff" such as cookies.
I used http://chrispederick.com/work/web-developer/
Note - the web developer toolbar can be toggled on/off by accessing '''View/Toolbars''' at the top of the Firefox window
* Now that you have the tools, let's proceed to discover the name of your language cookie
1) Using the '''Firefox''' browser (''not'' '''IE''') access your TNG website and set the language to English or French or some other language.
2) On the '''''Web developer toolbar''''', click on the '''Cookies''' pull down and select '''View Cookie Information'''.
3) that will activate a window in another tab.
4) Inspect that output looking for a cookie that has a '''name''' starting with "'''tnglang'''..."
5) the '''Value''' of that cookie should be the same as the language you chose in your TNG session
6) <font color=blue>'''''copy'''''</font> the text following the '''name''' of that cookie
<br/>(you will need it to make Lazarus multi-lingual)
== Making the Lazarus Guest Book multilingual ==
<font color=red> '''TNG''' uses a capital letter for its language (such as <font color=black>'''F'''rench</font>).
'''Lazarus''' uses a lower case letter for its language (such as <font color=black>'''f'''rench</font>).
* The following information worked for me. I hope it works for you.
Unfortunately, the post on the Lazarus web site has some incorrect information:
The process described is correct, but the cookie that is named is incorrect.
* Here is the correct modification to the Lazarus code
open the '''lazarusgb/lib/vars.class.php''' and replace the following '''4''' lines of code:
if (isset($_COOKIE['lang']) && !empty($_COOKIE['lang']))
with these '''5''' lines of code:
(''''paste'''' the cookie name (<font color=blue>'''copied'''</font> from above)
into the '''''paste-the-cookie-name-here''''' in the code below
$cookiestring = "paste-the-cookie-name-here";
if (isset($_COOKIE[$cookiestring]) && !empty($_COOKIE[$cookiestring]))
<font color=red> Note the extra ( ) because of the strtolower function </font>
* Be sure to save the changes.
* Additional Information about the $cookiestring text.
The first part of the string is usually something like "tnglang_home" or "tnglang_var"
The last part of the string is the path name to your TNG application:
It will usually be three levels if you installed TNG into a folder (e.g, genealogy)
or only two levels if you installed TNG without using a folder.
== And that is all there is to do. By now it should be working. ==
* Try it out and verify that any language switch you make in TNG will always change the language in the Guestbook and vice versa.
I hope this helps you avoid all the aggravation I had when I tried to make it work.
== Aside - Maybe someone can get this to work ==
1) The language definition in TNG is capitalized, (i.e., French);
<br> the language definition in Lazarus is lower case, (i.e, french).
2) '''A simple solution to the uppercase/lowercase problem might be a simple name change to the files.'''
Keep the upper case naming convention used by TNG and
rename all the Lazarus php files from
english.php to English.php
codes-english.php to codes-English.php
and apply the same naming style to every other language files.
If that were done, the '''strtolower''' function might not be needed.
3) '''Another possible, much simpler, solution might be able to eliminate the access to the TNG cookie.'''
* The above solution to make Lazarus multi-lingual depended upon access to a ''COOKIE'' and you must know the '''name''' of the cookie.
But, internally, '''TNG''' also sets a '''''global variable''''' called '''$mylanguage''' whenever it creates the ''cookie''.
'''So the question is''': could the variable '''$mylanguage''' be used ''instead of accessing the cookie'' by '''name'''?
I tried a couple of different ways, but could not make it work. But maybe someone else will come up with a simpler way to set the Lazarus language.
Newer edit →
Retrieved from "
Main page (English)
- in German
- in French
- in Spanish
TNG Wiki Sitemap
Items of Interest
Tips and Tricks
How TNG Works
How to Code
Tips and Tricks
TNG Wiki How To
TNG Mail Archives
Mail Searchable Index