Menu

Include your family tree in your webpage

28 Mai 2011 - Genealogy, PHP

Yesterday I’ve posted for all interested genealogists and webmaster, how they can create a database out of their gedcom file. But how you can display this information on your website?

In this post I want to explain, how I do this and share you my PHP code for free to use it on your website. I only please you for let my link in the code, that I have also something out from it.In the zipfile are a lot of PHP files. You can use them nearly unchanged. Only in the dbConnect.php you have to include your own database connection.

$hostport = "localhost"; // host of your database
$user = "root"; // the username to connect to your database
$password = ""; // your password to connect

To use your own website design, you can change the header and the footer file. I have also in these two files the whole design of my webpage. If you want to change the design of the family tree itself, you can customize the stammbaum.css file. there are all styles for the family tree stored in.

To display the family tree in the browser, you have to call the stammbaum.php. For the list of all person in your database, alphabetically ordered, you have to call the personen.php. For the list of all last names, you can call the familiennamen.php. Here are all last names listed which are stored in your database. When you click on one of the names, the personenpart.php is called. Then there is a list of all persons with this last name shown.

The default start ID is your I1 from your Gedcom file. When you click on a person in one of the above described lists, this person is shown as start person in the tree view.

In the tree view are always 5 past levels shown. If you want to go deeper in the past, you can click on one of the arrows which are pointing to the right. The you go on level deeper in the past.

A mouse over effect over the person in the tree view shows you all available information about this person. Also by mouse over you can see a list of the partners of this person and a list of the childs. These persons (pertners and childs) are clickable too. Then the tree is rebuild with tis person as start person.

Persons, who are not dead, are only displayed as „Living, Living“ because of data security. If no death date is included the age of this person is calculated. If the person is older than 110 Years, then its death will be provided and all information of this person is shown.

I’m sorry for using a lot of german words in the php files and file names. I created this scripts in the past when my english was not as good as today.

Now I wish you a lot of fun with implementing my code in your website that you can show the results of your genealogical research to the world. Please note, that is necessary to use the database like in „Post „Create a database from your GEDCOM file“ described.

An example how the script can be used, is shown in http://www.genealogiearchiv.de.

familytree php files for download

Print Friendly, PDF & Email

One thought on “Include your family tree in your webpage

Hem Singh

Please send me Data base script

Reply

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.