Snakeskin Posted January 31 Report Share Posted January 31 Hello TNG specialists, I'd like to automate something. Is it possible to automatically add a picture when the cause of death is listed as "Stillborn"? So, where other children have a portrait picture, I'd like a picture for stillborn babies as well, but there would be too many to do manually. Would this be possible, and if so, how? I can't do it myself, but perhaps someone here can. Thanks, Andreas Quote Link to comment Share on other sites More sharing options...
Katryne Posted February 1 Report Share Posted February 1 (edited) Hello Andreas, I sometimes run maintenance operations in media administration on this page.: admin_thumbnails.php. There I can add a default thumbnail to any person who does not already one. Provided there is at least one media for the person, even if there is no photo. The TNG script will add as default the 1st media it meets, Generally the birth or death certificate. Beware not to choose the option "Regenerate existing thumbnails". It's not exactly what you meant, but it will be done without modifying any existing code. Here is what one can display : For baby Marie Louise, I have only her birth certificate. For grown-up Marie Louise, I have only her photo on a group wedding photo. Edited February 1 by Katryne typo Quote Link to comment Share on other sites More sharing options...
GOGGS Posted Tuesday at 11:58 AM Report Share Posted Tuesday at 11:58 AM Hey Andreas, I tried something on my database that worked (from the phpMyAdmin tool): First, insert records into the medialinks table for all of the people that match your criteria (whatever field has the "stillborn" text). In this example, I assumed it was in the 'title' field: INSERT IGNORE INTO tng_medialinks (personID) SELECT personID FROM tng_people WHERE tng_people.title LIKE '%stillborn%' This will insert a medialink record for every person you marked as stillborn (with no other columns updated yet): Second, update the new records with the rest of the missing info, most importantly the mediaID for your image that represents a stillborn child. UPDATE tng_medialinks SET mediaID = 855, gedcom = 'YourGED', defphoto = 1, linktype = 'I', ordernum = 1 WHERE gedcom = '' You would replace the mediaID and gedcom parameters with your own values, and I used the WHERE clause of gedcom = '' but it could be several other fields in the new records that don't match your others. Hope this helps, Cheers GOGGS Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.