Jump to content
TNG Community
slowjim

Cemetery place link

Recommended Posts

slowjim

I cannot figure out how to programmatically link a record in the tng_cemetery table to a corresponding record in the tng_places table.

At least, that is what I think I need to do.

I have written a very useful tool for myself and would share with anyone who wanted it once it is perfected.

I use rootsmagic 7 to create gedcoms to import my Ancestry data into TNG. One of the great about Rootsmagic is that I don't have to do too much cleanup to the .ged file before I import. Looking at the rootsmagic generated .ged file I noticed that there are _WEBTAGs for all the findagrave entries in the file , however upon import into TNG that information is lost. It was not too difficult to write a small php file that generated a list from that gedfile with the individual's ID and the urls on each line. Then from that info, another php file puts all the findagrave links into TNG as an external link into the individual's page. All done practically instantaneously. 

However, then I decided to carry it a step further. I would put these links into a person's burial section along with the correct cemetery name. So you'd have the findagrave link there and also if you clicked the little magnifying glass next to the burial place you'd get a map and below it everyone else who was buried there. To do this, I wrote a file which read all the lines in the list I generated of the person's ID, and findagrave link. The program loads the link (findagrave) page, finds the cemetery name and location from the memorial page, then loads the cemetery page and retrieves the gps coordinates from a meta tag on that page and generates a new list with all that info on it. I could get a couple of hundred before their server stops me, times out or something, and then I'd have to do it again with the remaining entries. It took a few minutes and three runs before I got the whole list of 517 burials in 217 cemeteries. Then I created another php file which reads that list and puts all that into the website programmatically and instantly..

The problem is that when you click the magnifying glass next to the burial location it shows the cemetery name and every person buried there, but no map!

I solved that on my website by going to admin >  cemeteries and going to the edit page of each of the 217 cemeteries and checking the box to 'Copy the geocode information below to this place' and now they all work correctly. Even though they are all now working correctly on my site, having to manually edit each entry kind of takes a little out of the whole idea. I want to do the whole thing without editing anything.

Now to be clear, even when this current problem is solved, the program still needs a lot of cleanup. I found a couple of places on findagrave.com where there was a memorial, but no cemetery, which would cause an error in my program. That's what error-handling is for, so I am sure that and a couple of other details can be cleaned up. 

I am hopeful that someone out there with more knowledge of how tng works, and also more programming expertise will tell how I can do this all without having to manually edit afterwords.

Thanks
https://thebrownfamilytree.info

burial.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×