Jump to content
TNG Community
Morgan

Add tombstone as default photo

Recommended Posts

Morgan

Is there a way to assign a headstone as the default photo in all cases where others photos do not exist?

Share this post


Link to post
Share on other sites
Morgan

Additionally is there a way to REMOVE documents as default photos across the site or do you have to do it one by one?

Share this post


Link to post
Share on other sites
Michel KIRSCH
5 hours ago, Morgan said:

Is there a way to assign a headstone as the default photo in all cases where others photos do not exist?

Yes. Simply add a photo of a tombstone and check the default box.def.JPG

Share this post


Link to post
Share on other sites
Michel KIRSCH
5 hours ago, Morgan said:

Additionally is there a way to REMOVE documents as default photos across the site or do you have to do it one by one?

Don't understand your question. Can you be more explicit?

Share this post


Link to post
Share on other sites
Morgan

Sorry i should have been more explicit - Assign Default Photos under Media > Thumbnails.  I just recently ran the function and for individuals that did not have a photo but had documents attached the default photo is now the first document attached to their id number.  I'd like to remove the ability for documents to be default images and then remove the documents that have been selected across my site (3,000+ individuals now have default images that are documents).

Separately, in the past I could change the code on admin_defphotos.php file to specify that headstones would become the default images rather than photos when utilizing the assign default photos function.  

I have used this function in the past after uploading hundreds of tombstone photos at once.  Today was the first time I had used the assign default photos function in a few years and was unaware that documents were now being utilized as default images when no photo exists.

 

Share this post


Link to post
Share on other sites
tngrlkrz

For such a situation, one option you should have is a full site restore from backups created by your ISP.  BEFORE you did the  'assign default' photos.  This at least will clean up what you don't want.  You said in the past you could change code; what's preventing you from doing it this time?

Share this post


Link to post
Share on other sites
Morgan

Thanks - great thought on the restore.  Unfortunately, the code has changed over the years and it doesn't specify "photo" any longer

The old code in admin_defphotos.php was

$query2 = "SELECT medialinkID FROM ($medialinks_table, $media_table)
WHERE $medialinks_table.mediaID = $media_table.mediaID AND
$medialinks_table.gedcom=\"$tree\" AND personID =
\"{$distinctplink['personID']}\" AND thumbpath != \"\" and mediatypeID =
\"photos\" ORDER BY ordernum";

And I was able to change the "photos" to "headstones", like this:

    $query2 = "SELECT medialinkID FROM ($medialinks_table, $media_table)
WHERE $medialinks_table.mediaID = $media_table.mediaID AND
$medialinks_table.gedcom=\"$tree\" AND personID =
\"{$distinctplink['personID']}\" AND thumbpath != \"\" and mediatypeID =
\"headstones\" ORDER BY ordernum";

Share this post


Link to post
Share on other sites
Michel KIRSCH

to run in your phpMyAdmin :

update tng_medialinks, tng_media SET tng_medialinks.defphoto = '0' WHERE (tng_medialinks.mediaID = tng_media.mediaID) AND tng_media.mediatypeID = 'documents'

This SQL statement will reset the field "defphoto" for all the documents which are as defaultphoto in the tables.

Before run it, make a copy of the two tables "tng_media" and "tng_medialinks" via the TNG interface (Admin/Tools)

If the result is not what you want, restore the two tables via the same interface

Michel

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

×