Media Living and Private Flags

From TNG_Wiki
Jump to navigation Jump to search
Construction This mod is still in a beta status. Please provide feedback about your use of the mod, as described in the Beta Documentation section below Construction
Media Living and Private Flags
Summary Improves the load time of pages that need to prevent unauthorized users from seeing images of living or private individuals.
Validation
Mod Updated 21 Jan 2021
Download link v13.0.0.0c.zip
TNG 13.0
This mod is still in a beta status. Please report how it worked
Download stats
Author(s) Robin Richmond
Homepage Robin Richmond's Genealogy Database
Mod Support My Mod Support form or TNG Community Forums
Contact Developer My Mod Support form
Latest Mod v13.0.0.0c
Min TNG V 13.0
Max TNG V 13.0.2
Files modified
globallib.php, personlib.php, pedbox.php, rpt-utils.php, admin_secondmenu.php, admin_secondary.php, English cust_text.php. Installs rrmedialivingflag_dbsetup.php, rrmedialivingflag_populate.php
Related Mods
Notes


Purpose of the Mod

This mod improves the load time of pages that need to prevent unauthenticated visitors from seeing media items that are linked to living or private individuals. When TNG needs to display a media item of any media type (even a thumbnail), it needs check all the individuals and families linked to that media item to determine whether the item can be viewed. If the media item is linked to numerous individuals or families, it can take TNG a while to decide whether it is safe to display the item. This is a particular problem in the Person Profile, where the profiled person can be linked to numerous media items, and each of those media items must be tested to determine if it can be viewed by the visitor. It affects the end-user media search program (browsemedia.php) in a similar way.

This mod shortens the time required to determine whether an unauthenticated visitor can view a media item by defining two flags for each media item in the database. These flags indicate whether a media item is linked to any living or private individuals or families. When it can, TNG then uses those flags to quickly determine whether the visitor can see the file.

Caveats and Limitations

  1. To define the living and private flags, you must run a process that scans all media items and all of their links. This can take at least a few minutes, depending on the number of media items in your database and the total number of links you have from media items to people and family records.
  2. The flags are "static". That is, if you update the database by defining a new medialink or changing the living or private status of any person in the database, you may invalidate flags and allow users to view media items that the users should not be allowed to see. In its current form the mod really is intended for sites that load their data, including medialinks, from a Gedcom Import. See notes below about using this mod in conjunction with TNG data entry.
  3. The flags do not recognize branch rights. That is, if you assign users to branches and allow users who are assigned to a branch to see living people in the user's branch while forbidding access to living people outside of the user's branch, TNG must revert to the native process of scanning each medialink when branch-assigned users are logged in. To put it another way,
    • Administrative users who can see all media items are not affected by the problem since TNG can quickly figure out that they can see all media items all the time,
    • The flags should improve the page load times for unauthenticated visitors (on pages that would normall exhibit slow load times as described above), but
    • The flags will not help branch-assigned users.

Beta Documentation

While this mod is in beta status, we are trying to find out how long it it is likely to take to define the living and private flags on a given site, and whether it really does help. When you run the "Media Living&Private Flags" secondary procedure, the program will tell you how many media items and medialinks you have (in the selected tree), and how long it takes to populate those flags. It would be very helpful for you to add a row to this table, or submit the information through My Mod Support form.

Date Media Items Medialinks Total Elapsed Time Did it help Notes Admin & Site
20 Jan 2021 10,404 57,314 5:37 Not really I was just testing; I don't have the enough media items in Person Profiles or medialinks for given media items to expect noticeable improvement. Robin (mod author); www.robinrichmond.com
21 Jan 2021 5,094 47,483 3:37 checking Pete TheSmeeFamily.com
17 Feb 2021 12609 36473 3:57 I not sure Maikl11; ahnenklein.com
(date) (media items) (medialinks) (min:sec) (yes/no) (notes) (who and where)
(date) (media items) (medialinks) (min:sec) (yes/no) (notes) (who and where)

I hope to be able to use the number of media items and medialinks to make a rough estimate of the expected run time, but I don't expect it to be very accurate. In particular, the number of media items and medialinks are not especially predictive of whether the mod improves page load times. That factor is driven more by the number of media items in a Person Profile and the number of medialinks for a given media item, both of which vary greatly within a site, and each of which has a complex relationships with the other.

TNG Data Entry

This mod does not update the Media table's living and private flags dynamically as you add or remove media items and medialinks, or change the living or private status of people or families. In effect, it is designed for sites that load their data from Gedcom files.

There's no fundamental reason that it TNG data entry processes couldn't be extended to support the living and private media flags; it's just not easy to implement that support. TNG site admins who use TNG data entry tools and who believe their sites would benefit from this mod could help to expedite a solution by submitting a My Mod Support form request.

In the meantime, it may be useful to know that

  1. You can run the Media Living&Private Flags secondary process as often as you need to (if you can handle the several minutes that the secondary process requires)
  2. For any media item, you can safely add a medialink that points to a non-living, non-private person or family.
  3. For a media item that already links to a living person or family, you can safely add new medialinks to any person or family (living or not). The same is true for links to private records.

But, until the mod is enhanced to handle dynamic changes to people, families, and medialinks, other edits can invalidate the flags for a particular media item, or, more problematically, for all media items that link to a changed person or family.

Still, we do plan to implement those enhancements at some point.

Mod Options

No options.

Mod Conflicts

No known incompatibilities

Related Mods

  1. Admin Secondary Processes changes the workflow of the Admin>>Import>>Secondary Process menu, and has to know about all mod-defined secondary processes. Version 13.0.0.2 of Admin Secondary Processes supports this mod.

Installation

Files Installed

  1. rrmedialivingflag_dbsetup.php - One-time program to create the new living and private flag fields in the Media table.
  2. rrmedialivingflag_populate.php - An Include file that is loaded into admin_secondary.php to assign values to the Media table's living and private flags.

[Show Standard Installation Process]

Requirements

  • A working TNG installation.
  • An installed current version of the Mod Manager.
  • You should backup files listed in the panel on the right.

Procedure

  1. Remove and delete previous version of this mod.
  2. Backup the files updated by this mod. They are listed in the panel at the upper right.
  3. Download the .zip file, Extract its .cfg file to the mods folder.
  4. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files.

Problems?

  1. Try using the Mod Manager Remove capability
  2. Contact me through My Mod Support form.
[Hide Details]


Visualizations

These visualizations all show changes to administrative programs tied to the installation of the mod and the definition of the flags after a Gedcom import. The intended effect of this program for end users does not show up on any TNG page. Instead, it just affects page load times.

The database setup program, which is invoked from a link in the mod's description in the Mod Manager.

Media living and private flags-dbsetup.jpg

The Secondary Procedures mem, with a popup message displayed by the "Media Living & Private Flags" button

Media living and private flags-secondmenu.jpg

Results of the Secondary Procedure:

Media living and private flags-secondresults.jpg

Revision History

Mod Version TNG Version Date Note
v13.0.0.0c.zip 13.0-13.0.1 20 Jan 2020 Beta release.

Sites using this mod

If you download and install this mod, please add your TNG site to the table below:

URL User Note Mod-Version TNG-Version User-language
Robin Richmond's Genealogy Database Robin Richmond Mod developer 13.0.0.0c 13.0.2 English