Jump to content
TNG Community

automation


Snakeskin

Recommended Posts

Snakeskin

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

stillborn 1.jpg

stillborn 2.jpg

Link to comment
Share on other sites

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.

image.png

 

Edited by Katryne
typo
Link to comment
Share on other sites

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):

Screenshot 2026-02-03 064833.png

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...