Joomla Integration

From TNG_Wiki
Jump to navigation Jump to search
Obsolete Obsolete page!

Note: The Joomla CMS Genealogy Component (TNG) bridge as described here was abandoned in 2013 and is no longer supported. This entry remains here only for historical purposes. (updated 13 Jan 2020 by TK)



The TNG - Joomla Bridge component allowed users of Joomla to integrate TNG as a component. Since TNG is a stand alone product it is not feasible to integrate TNG as a full Joomla component. It had been done, but it was a lot of work. See John Vickers work in the TNG Forums. It is great work that actually embeds TNG into Joomla. The only problem is, unless you know how to program you will be stuck with an older version of TNG unless the author feels like rewriting most of TNG to work with Joomla.

A more feasible solution is to have a bridge component that passes information from Joomla to TNG and allows for a single login of both Joomla and TNG. This allows TNG to stand alone on it's own. This is a non-destructive passive approach which has worked well for some. If you have experience with Joomla you will have no problem integrating TNG.

Joomla is a very powerful CMS that is used across the globe and has a strong support network worldwide. There are many "free" components available for Joomla such as various gallery, news, and forum components. This sets the stage for any serious family researcher who wants to create a fairly easy to use, but very powerful content management system in order to stay in contact with family members and fellow researchers across the globe.

Since genealogy research is not wildly popular (yet), no one has ever seriously worked on a genealogy component for Joomla [1]. The TNG - Joomla bridge fills that gap and combines the best of of CMS and Genealogy

This bridge is currently working with TNG 6, TNG 7, and Joomla 1.5.x. Older bridges found within the forum works with TNG 6, TNG 7 and Joomla 1.0.x and Joomla 1.5.x in legacy mode.

The only requirement that might hinder the use of this component is that you must have PHP 5 or greater running on your server. I have not tried running this with PHP 4 or less and it probably will not run reliably on anything less than php 5. This component was meant to run on Linux flavor platforms. Some folks have gotten this to work on a Windows platform, but there have been known issues of Windows running php and apache servers and certain adjustments may have to be made depending on the Windows server package you are using. It is beyond the scope of this tutorial to cover this.

Also, I have not made this component to open the TNG administrative backend in the Joomla Wrapper. The TNG backend has it's own template design and probably will be corrupted and not fully open in an iframe in the Joomla wrapper. It is best to open your TNG admin backend by going directly to the url for TNG administration.

For help or more information there is a Joomla section in the forums in which other folks may help you if you have problems installing or running the component.

TNG Community CMS Joomla Forum

Download the bridge from TNG Joomla Bridge for Joomla 1.5.x and TNG 7.x then unzip it.

There should be three files contained within the zipped file:

1) (do not unzip this file)

2) A TNG folder containing the file index_joomla.php, and

3) a help file.

Fresh Install

1) You Must have both Joomla and TNG already set up before you install the bridge. Make sure that your user name and password for the Super Administrator (you) are the same in both Joomla and TNG.

I find it easiest to install TNG in a subdirectory of Joomla. You can install it wherever you like, but you will have to know your relative path when you configure the bridge component on the Joomla administrative backend.

After you unziped the file you downloaded Place the index_joomla.php file (found in the unzipped TNG folder) into the root of your tng directory.

2) Next, log into your Joomla administrative backend and install as you would any other Joomla component.


3) After install go to Components --> TNG Genealogy --> edit config menu and make sure the configuration is correct. The configuration file is automatically set up as:

url = /tng

joomla prefix = jos_

tng prefix = tng_


a. Enter the correct parameters

b. Click on save

c. You will see a message stating configuration saved.

If for some reason this does not work, check to make sure the you have read/write permissions set for the file config.tng.php is writable. This file can be found in the directory Joomla-->administrator-->components-->com_tng

4) The next step is to create a menu item. Most people typically set it up the component on the main menu', but you can add the component to any menu.


Go to add new menu item then Click on the component radio button and click next. You will then be presented with the screen below.

Name your menu item accordingly, highlight TNG Genealogy, set the access level to what you want and, dont forget to publish the item.


That's all there is to it.

You should then be able to access the menu item on your Joomla front end. Here is a couple of pictures of my site below showing my Joomla Front page and then next showing my TNG database page integrated into Joomla.




Uninstall the old TNG Bridge Component and install the new component if you previously installed it.

The older bridge component did not use Joomla to assign id's to the TNG database. Because of this and you upgrade it is very likely you will get a duplicate keys error.

This can be fixed in a couple of different ways.


The easiest is to to edit the tng.php file and find around line 58 the code:

$adding = "INSERT INTO $users_table VALUES ('$f_id', '$f_utype', '$f_username', '$f_pass', '', 0, 0, 0, 0, 0, 1, 1, '', '$f_rname', '', '$f_usermail', '', '', '', '', '', '', Now(), '$f_rdate', '$f_act','','' );";

You want to remove the variable $f_id as seen in the code above. Leave the quotes so the code looks like this:

$adding = "INSERT INTO $users_table VALUES ('', '$f_utype', '$f_username', '$f_pass', '', 0, 0, 0, 0, 0, 1, 1, '', '$f_rname', '', '$f_usermail', '', '', '', '', '', '', Now(), '$f_rdate', '$f_act','','' );";

With this technique you can leave your TNG users in place. New information will not be added to your existing users in the TNG back end such as Real Name, description, etc, because the bridge component is made to be non-destructive.


The other way to fix this issue is also easy. You can delete all you users except the Super Administrator (you) in your TNG administrative back end.

When people log into Joomla then click on your TNG Genealogy link it will automatically pull all the information into the TNG user database. They will be totally unaware of this. The only problem with this is that if you assigned special privileges to a user such as administrative rights for full editing you will have to reset their privileges.

What's New

TNG-Joomla Bridge 7.1.5b

1. TNG-Joomla Bridge is now Native for Joomla 1.5

2. Cleaned up some of the code and a few bugs.

3. Updated code to comply with php 5.x Joomla 1.5.x

4. Joomla email now imports into TNG users

5. Last login is synched from Joomla to TNG users

6. Built in function to check if TNG Joomla Bridge configuration file is writable.

TNG-Joomla Bridge 7.0.2

1) Cleaned up some of the code and fixed a few bugs.

2) Got rid of random password generation as it is not needed since the password now pulls directly from joomla.

3) Updated code to work with php 5 and up.

4) Joomla User level now imports into TNG users under "description"

5) "Real Name" imports from Joomla to TNG

6) TNG user id is synchronized with Joomla user id

7) Killed automatic menu generation as I meant to do in previous version but forgot to.

8.) If user or joomla admin changes user information in Joomla it also changes/updates in the TNG database.

History and Credits

This idea originated from a few individuals on the TNG Forums. Cas Nuy wrote the initial single login component for Mambo in 2005. Cas Nuy had also written other single sign on components for other CMS'. Most notably was for for the postNuke CMS in 2004. The script served as a basic outline for a TNG integration into Mambo. The sign on mechanism was later added to and improved by Mark Fleeson in 2006 on the TNG Forums.

Joomla developers split from Mambo and Mambo components would still run under Joomla. The original code which was written for Mambo started to become obsolete as php, Joomla, and TNG started adding new features. The original code basically stopped working. The changes needed were becoming scattered throughout the TNG Forums and support was basically nonexistent after 2007 as those who had interest moved towards other CMS integrations. At that time Joe Cox who was deeply entrenched in Joomla took the code for the original Mambo component and with the support of those on the forums updated, rewrote, and re-packaged the original Mambo component in order for it to integrate more easily into Joomla.

Joe Cox sifted through all the code on the TNG forums and put in countless hours trying to turn the code into a workable component that would easily plug into Joomla without having to either modify Joomla code or TNG code. Thus the TNG-Joomla bridge was born in Apr 2 2006. Joe Cox was using Joomla 1.0.08 and TNG 4.x at the time. The component was then written on Apr 10, 2006 for Joomla 1.08 and TNG 5. The component was then updated on Apr 14 2007 following the introduction of TNG 6.

With the release of TNG 7 the old component worked as it did with TNG 6 and joomla 1.0.x. There were a few bugs and sloppy code left over from the Mambo days and some remnants left over from older TNG integration. See changes above. This is the most drastic rewrite to date for the component working under Joomla 1.5.x.

Many good folks have helped with the code and did troubleshooting. The component is by no means perfect, but it is functional and hopefully will only get better with age.

License To Use

Keeping with the tradition of Joomla this software/code is GPL and free to use and do anything you want with it. [2] Just give me credit where credit is due.

If you have done any changes, enhancements, or fixes please share this with the the rest of us users in the forums.

Future Enhancements

There is another component/bridge being worked on by Sean Schwoer with the same idea of having a native Joomla Component in which the user will not have to hack either Joomla or TNG to get the two to work together nicely. This work is in beta currently as of 03/18/2009 and is about 95% functional. It actually plugs into the Joomla API and therefore does not run within an iframe (as does the current bridge) and easily passes variables between TNG and Joomla through the Joomla API. The project is on hold due to the fact that TNG uses a different javascript scheme that is in direct conflict with Joomla's javascript scheme. These conflicts cause some pages in TNG to not be rendered within Joomla.

If anyone is a javascript wizard and has good php programming skills please contact Sean on the TNG forum so this new component/bridge can be brought to fruition.

Questions and Answers

Q. "I log into TNG and it does not put the user information into Joomla"

A. The bridge is exactly what it says it is. It bridges Joomla to TNG. You must turn off user login in the TNG administrative back end. All accounts must be created through Joomla and if you set up the bridge correctly as outlined above, it will pass the Joomla account information to TNG. It does not pass information from TNG to Joomla at this time, sorry.

Q. "The administrator page of TNG is not opening up in a full window within the firefox web browser. What's going on?"

A. See this thread. Interesting issue with Firefox only and Admin

Q. "I've created the TNG menu link within Joomla and when I click on it it states Not Found."

A. See this thread. Link not found

If you are using a Windows platform look at this thread: Windows Platform considerations

Q. "I am getting this error: Warning: mysql_query() [function.mysql-query]: Access denied for user 'nobody'@'localhost' (using password: NO) in ......"

A. Your server or ISP has turned off persistent connections. Go here for the fix. Fix Persistent Connections

Q. "How do I setup Joomla Bridge to use the URLs that TNG would show?"

A. See this thread: How do I setup Joomla Bridge to use the URLs that TNG would show

Q. "Where is the path/directory to my TNG installation?"

A. I don't know where did you place it on your server?

Q. "The bridge doesn't work."

A. That was not a question, but a statement. Read, Read, and then Read again - then ask your question if you cannot find it on this Wiki or in the forums.

Sorry to sound like a "smarty pants" on that, but most problems would be solved if the person read this Wiki first or searched in the forums for answers to their questions. Most likely, you will not get a response to these kinds of statements since most issues have been addressed.


Setting Permissions

The component is set up automatically to globally allow all users who login to view living individual data and to be able to download gedcoms. This is my personal preference and you can change this if you wish by studying the information below.

When a user clicks on the Joomla link to the TNG database it will Automatically log a user into the TNG database and give them rights to view living individuals and to be able to download gedcoms.

If you want to set this up differently you must edit the file called index_joomla.php that you placed into your TNG directory when you initially set the component up.

You will see some code around line 58 that will look like:

$adding = "INSERT INTO $users_table VALUES ('$f_id', '$f_utype', '$f_username', '$f_pass', '', 0, 0, 0, 0, 0, 1, 1, '', '$f_rname', '', '$f_usermail', '', '', '', '', '', '', Now(), '$f_rdate', '$f_act','','' );";

This line corresponds to the TNG Users table in the TNG database. This sets the permissions for the TNG user.

Currently the TNG 7 users_table has 27 fields. Go ahead count the fields in the above code...there should be 27. Look at the table below as it shows all the fields in the TNG users table found in the TNG database.

Study it, memorize it if you must.


Now look back at that line of code:

$adding = "INSERT INTO $users_table VALUES ('$f_id', '$f_utype', '$f_username', '$f_pass', '', 0, 0, 0, 0, 0, 1, 1, '', '$f_rname', '', '$f_usermail', '', '', '', '', '', '', Now(), '$f_rdate', '$f_act','','' );";

Going down the table in the "Field Name" column and going across the line of code above lets pair up the TNG fields with the joomla variables (which pull from the Joomla database table jos_users).

Field 1: UserID = $f_id (joomla User ID)

Field 2: description = $f_utype (pulls Joomla User Type into TNG database, ie. Super Admin, Admin, Author, etc - do not change)

Field 3: username = $f_username (pulls Joomla User Name into TNG database - do not change)

Field 4: password = $f_pass (pulls Joomla password into TNG database - do not change)

Field 5: gedcom = '' (null - not used)

Field 6: allow_edit = 0 (change this to 1 if you want all users to be able to fully edit your files)

Field 7: allow_add = 0 (change this to 1 if you want all users to be able to upload gedcom files)

Field 8: tentative_edit = 0 (change to 1 if you want all users to be able to tentatively to edit files)

Field 9: allow_delete = 0 (change to 1 if you want all users to be able to delete information in your database)

Field 10: allow_lds = 0 (change this to 1 if you want all users to see lds information.

Field 11: allow_ged = 1 (change to 0 if you do not want users to be able to download a gedcom file of your database)

Field 12: allow_living = 1 (change to 0 if you do not want all logged in users to see living people in your database - people that are not logged in will not see living individuals)

Field 13: branch = '' (null - not used)

Field 14: realname = $f_rname )(pulls Joomla Real Name into TNG database)

Field 15: phone = '' (null - not used)

Field 16: email = $f_usermail (pulls email from Joomla database - do not change)

Field 17: address = '' (null - not used)

Field 18: city = '' (null - not used)

Field 19: state = '' (null - not used)

Field 20: zip = '' (null - not used)

Field 21: country = '' (null - not used)

Field 22: website = '' (null - not used)

Field 23: lastlogin = Now() (when user last logged in - do not change)

Field 24: dt_registered = $f_rdate (user registration date in Joomla - do not change)

Field 25: dt_activated = $f_act (date account activated in Joomla)

Field 26: no_email = '' (null - not used)

Field 27: note = '' (null - not used)

Hopefully after looking at this a few times this makes sense to you.

Keep in mind that user persmissions can be set in the administrative backend of TNG without having to change this code.

Only use this hack if you feel comfortable peeking into and editing your files.

TNG User Related feedback

Example Websites

In no particular order: