Integrating Retrospect-GDS with Wordpress
Update: These instructions do not work with the Retrospect 2.0. I will be updating these instructions as soon as I get time.
It turns out that integrating Retrospect-GDS with Wordpress is pretty easy. If you’d like to display your family’s genealogy inside Wordpress this article will tell you how to do it.
Assumptions & Requirements
I am assuming that you have already have Wordpress installed and working and that you are comfortable editing the Wordpress and Retrospect-GDS template files. Your server needs to support mod_rewrite and url rewriting needs to be turned on in Wordpress. These instructions may work without url rewriting, but I haven’t tested it.
Retrospect-GDS Configuration
First, install Retrospect-GDS onto your server by following the Retrospect-GDS installation instructions. From here on I will assume that you installed into a directory called /retrospect. Now login to Retrospect-GDS as admin and change the admin password, then upload and publish a gedcom file. Take a few minutes to browse a few Retrospect-GDS pages to make sure everything is working, because it will be much easier to fix any problems while it’s running standalone then once we’ve started the integration.
Select a virtual directory for use with Wordpress. I chose /genealogy. This will make my genealogy pages available at http://www.infused.org/genealogy
Edit /retrospect/index.php and: Delete the line containing session_start(); Delete the line containing error_reporting(E_ALL); Change this line: <div class="code">$smarty->assign_by_ref(‘PHP_SELF’, $_SERVER[‘PHP_SELF’]);</div>To this (if you selected a different virtual directory, replace /genealogy/ with the one you selected): <div class="code">$smarty->assign(‘PHP_SELF’, ‘/genealogy/’);</div>
One of Retrospect-GDS’s internal functions conflicts with Wordpress, so we’ll just delete it. Edit /retrospect/core/f_misc.php and delete these 4 lines:
Edit /retrospect/core/modules/surnames.php and locate the following line (around line 57):
Change it to:
Edit /retrospect/core/modules/pedigree.php and change the require_once line (around line 28) to read:
require_once(CORE_PATH.'atree.class.php');
Wordpress Configuration
Make a copy of your archives.php template and call it retrospect.php. Change the Template Name: at the top of the file to Retrospect. Get rid of all the archive specific stuff and include the main retrospect index.php file like so:
include ('/fullpathtoretrospect/retrospect/index.php') ?>
Save the file on your server.
Using the Wordpress admin interface, write a new page (Page, not Post). Enter Genealogy in the Page Title box. Select Retrospect from the Page Template combobox. Enter genealogy in the page slug box. Leave the Page Content blank.
Now go to the Permalinks page under Options and click the Update Permalink Structure button. (If your .htaccess file is not writable, you will need to update it manually).
Now if you browse to your genealogy virtual directory you should get a garbled mix of Wordpress and Retrospect. Try browsing to http://www.domain.tld/genealogy/ (replace domain.tld with your domain name)
Retrospect-GDS Template
Edit the retrospect/themes/default/index.tpl file and replace the entire contents with the following line: <div class="code">{include file=”$module.tpl”}</div>
This will make sure that the header and footer are not being loaded twice. Now it’s just a matter of editing the default Retrospect-GDS template files to match the look and feel of your existing site. It took me about 1 day to tweak things to look right within my fixed width Wordpress template.
I hope all this makes sense! Please post a comment if you have any problems.
Other Issues:
It seems that Wordpress and Retrospect-GDS use the same constant names for the database connection parameters. If you are using the same database for both, then you probably won’t have any problem. If you have each of them configured to use different databases you will need to rename the connection constants in Retrospect-GDS. Do a search and replace on DB_HOST and change it to something else – maybe RGDS_DB_HOST.