Admin Media Thumbnails

De TNG_Wiki
Ir a la navegación Ir a la búsqueda
Admin Media Thumbnails
Summary Allows users to control which mediatypes and tree to process, can create thumbnails for larger image files, and can delete thumbnails.
Validation
Mod Updated 23 Sep 2023
Download link v14.0.0.5c
TNG 14.0
Download stats
Author(s) Robin Richmond
Homepage this page
Mod Support My Mod Support form
Contact Developer My Mod Support form
Latest Mod 14.0.0.5c
Min TNG V 10.1
Max TNG V 14
Files modified
admin_generatethumbs.php, admin_thumbnails.php, English cust_text.php
Related Mods
Notes


Purpose of the Mod

  • Primarily, To be able to focus on specific trees and mediatypes rather than always generating all thumbnails
  • Secondarily, to delete thumbnails.

Changes include:

  1. A mod option lets you increase the file size limit (which is normally 1MB), since most servers seem able to process files of 2MB or more.
  2. In the kickoff form, you can specify
    • Which tree to process (or all trees, as the native program always does)
    • Which Mediatypes to process.
    • A limit on the number of thumbnails to process.
    • Whether to create or delete thumbnails.
      • When you create thumbnails, the two native options can be specified.
      • When you delete thumbnails, you can also specify whether to clear the thumbnail path field.
  3. To summarize the results of the generation of thumbnails, the thumbnail process:
    • Generates a list of thumbnails that are generated, and hides it behind a "Show then" button.
    • Displays a list of files that could be process and a "Hide them" button.
  4. The mod now has an Inner Mod Menu, which provides handy access to the mod options as well as information about what the mod has changed.

Some Details: The deletion operation does not delete thumbnails that are obviously not created directly from the media item, but it cannot always tell whether a thumbnail image was uploaded explicitly rather than created from the source media item. It will ignore

  • Thumbnails associated with external media items
  • Thumbnails at a different location from the default thumbnail location for the image. That is, it computes the expected thumbnail path, and will not delete thumbnails whose path is different from the expected path.

A technical note: This mod turns admin_generatethumbs.php into an Include file that is included directly in admin_thumbnails.php, which, in the native code, runs admin_generatethumbs.php through AJAX. Using AJAX causes some errors to be hidden and makes it impractical to interrupt a long-running operations.

Mod Options

There is just one option in this mod:

  • Skip files larger than this size, in KB. The default is the native 6000KB.
    • I'm not sure how important this options is any more. Once upon a time, PHP crashed badly if it tried to create a thumbnail from a file larger than this. But it seems to work much better now. The hard-coded TNG default files ize limit is 5000KB (close to 5MB), but I have not had any problems with the mod setting default of 6000KB.

These mod options are custom TNG settings, defined and edited in a Mod Settings Block in the form at Admin>>Setup>>General Settings, in a new subform named Mod Settings Blocks. The Mod Settings Blocks mod is a prerequisite for the installation of this mod.

Compatibility

This mod is compatible with Unused Media, the only other published mod that affects the programs that are edited by this mod.

Related Mods

The Mod Settings Blocks mod packages this mod's options into what I call a "Mod Settings Block", which is a set of form fields that formatted and labeled so that it stands out among other options in an Admin>>Setting form. Mod Settings Blocks is a prerequisite for this mod; it must be installed before this mod can be installed.

Installation

This mod does not use standard cust_text.php files for language strings. Instead, it stores languages strings in the mod's subfolder, and pages modified by this mod load language strings directly from files in the mod's languages/ subfolder. Read more about this technique and its procedure for handling site-specific language string overrides.

[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

The native Kickoff Form, with only two options. The native program always creates thumbnails for all image files in the Media table.
Admin thumbnails-before1.png
The new Kickoff Form

When the page is loaded, the form defaults to the most recent tree selection, and all mediatypes. Here, you can see that a tree and three mediatypes have been selected.

Thumbnails-kickoff.jpg
The Process Summary

This reflects the results of the kickoff form above.

  • There is no progress count for headtones, because this tree doesn't happen to have any headstones.
  • The number shown for each mediatype reflects the number of media items that are images, and thus for which thumbnails could be processed.
  • After displaying the summary, the program displays a new kickoff form, this time with the same default tree, but no selected mediatypes.
Thumbnails-results.jpg
The Process Summary for a Deletion
  • The process doesn't keep track of and display the thumbnails that were successfully deleted.
  • Errors are rare, because the error is the inability to delete a file.
  • After a deletion process, the kickoff still defaults to "Generate".

here is no progress count for headtones, because this tree doesn't happen to have any headstones.

  • The number shown for each mediatype reflects the number of media items that are images, and thus for which thumbnails could be processed.
  • After displaying the summary, the program displays a new kickoff form, this time with the same default tree, but no selected mediatypes.
Thumbnails-deleteresults.jpg
The Inner Mod Menu

The Inner Mod provides links to

  1. The mod's Wiki article (via the Wiki logo),
  2. The Mod Options section of the Wiki article, and
  3. The mod's Mod Settings Block
  4. A popup summary of what the mod does. That popup is shown in this screenshot.
Thumbnails-imm.jpg
The Mod Settings Block

A Mod Settings Block is an outlined subform within an Admin>>Setup program that contains the options for a single mod. What is most notable about a Mod Settings Block is that a hyperlink directly to a Mod Settings Block displays only that block (i.e. only one mod's options), not all of the other options in the form or subform.

Here, you see the this mod's Mod Settings Block, in admin_genconfig.php, at Admin>>Setup>>General Configuration. The triangular arrow next to the subfolder heading Mod Settings Blocks is pointing to the right, meaning that the subform is not open, and that your site's other mod settings blocks are not visible. If you were to open the subform by clicking on the heading, you would see the mod settings blocks for other mods that you have installed.

Thumbnails-msb.jpg

Revision History

Mod Version TNG Versions Date Note
v14.0.0.5c 14 23 Sep 2023 No functional changes; Improved MM installation logic for informative notes; fixed errors related to new PHP versions
14.0.0.5b

14.0

14 Mar 2023 Upgrade to TNGv14, with new Admin header/footer functions and cleanup of undefined variables.
Admin Media Thumbnails 13.0.0.5a 13.0-13.0.1 03Dec2020 Handled a change in the TNG "Patch for v13.0.1". The mod covers TNGv13.0 and TNGv13.0.1 with and without the patch, and is projected to cover TNGv13.0.2.
Admin Media Thumbnails 13.0.0.5 13 11Nov2020
  1. Converted the mod %parameter to an option in a Mod Settings Block.
  2. Added run-time options (on the kickoff form) to delete thumbnails and to clear the thumbnail paths.
  3. Added a run-time option to limit the number of thumbnails to process.
  4. Added information to the kickoff form
  5. Added a processing results heading showing selections from the kickoff form.
  6. Added something of a progress log - The list of thumbnails processed for each selected tree and mediatype.
  7. Implemented a Mod Settings Block and the Inner Mod Menu
Admin Thumbnails v12.0.0.4a 12.0-13.0.1 16Oct2018 No functional changes; fixed a couple of bugs, and upgraded to TNGv12.

This version also works in TNGv13

10.1.0.3p 10.1.0 - 11.0 14May2016
  • Updated cust_text.php target location search strings to look for the one-line comment that says "Put your own custom messages here, like this: "
  • Cleaned up the code and added some information to the display such as the file size of files that couldn't be processed
  • Added Show Mod Names and the parameter that allows larger files to be processed.
10.1.0.2 10.1.0 - 10.1.1 19Apr2015 Initial release

Sites using this mod

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

URL User Note Mod-Version/TNG-Version User-language
Robin's Roots Robin Richmond Thumbnails page on the authors test site id/pw: a/a 14.0.0.5c / 14.0.3 EN
Wortelboer Genealogy Bernard Wortelboer Admin page; not accessible 10.1.0.3/11.0.1 NL,EN
Eskeland and Haugland Family User:helland71 Admin page; not accessible 12.0.0.4/12.0.2 NO, EN
Hooley Family Links Rick Hooley Public/Private See Here EN
Généalogie Malvache Cédric Malvache Public/Private 12.0.0.4a/12.0.3 FR
Auf den Spuren meiner Ahnen Michael Klein Public/Private 14​.0​.0​.5c/14.0.3 DE, EN
The Cole / Tanner Family Tree David Cole Public/Private see here EN, DE, FR, ES, NL
Bastiaanssen Genealogy Jan Bastiaanssen Public / Private 13.0.0.5a/13.1.2 NL, EN, ES