Admin Media Thumbnails

From TNG_Wiki
(Redirected from Admin Thumbnails)
Jump to navigation Jump to search
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.
Mod Updated 3 Dec 2020
Download link Admin Media Thumbnails v13.0.0.5a
TNG 13.0
Admin Thumbnails v12.0.0.4a
TNG 13.0
TNG 12.0
See the Revision History for older versions
Download stats
Author(s) Robin Richmond
Homepage this page
Mod Support My Mod Support form or TNG Community Forums
Contact Developer My Mod Support form
Latest Mod v13.0.0.5a
Min TNG V 10.1
Max TNG V 13.0.1
Files modified
admin_generatethumbs.php, admin_thumbnails.php, English cust_text.php
Related Mods

Purpose of the Mod

To make the the generation of thumbnails quicker, and to be able to focus on specific trees and mediatypes. 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

In TNGv13, this mod's option is defined in a Mod Settings Block at Admin>>Setup>>General Settings, in a subform named "Mod Settings Blocks".

Skip files larger than this size, in KB. The default is the native 1000KB.
PHP crashes badly if it runs out of memory when trying to create a thumbnail, so the program does not try to process image files larger than a specified size, which is hard-coded as 1MB in the native code. I have found that I can generally get by with 2.5MB (2500KB) on my servers, but that's no guarantee that you will be able to do so.


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

Related Mods

  1. 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. The Mod Settings Blocks is a prerequisite for this mod; it must be installed before this mod can be installed.
  2. The optional mod Inner Mod Menus displays an "Inner Mod Menu" in the TNG "inner menu" (just below the tab menu). The Inner Mod Menu that is defined by this mod is visible only if Inner Mod Menus mod is installed. Inner Mod Menus are visible only to TNG administrators; never to end-users. I highly recommend that you install the Inner Mod Menus mod because Inner Mod Menus provide links to handy information - particularly to the mod settings blocks for this mod's options.
  3. The Field Buttons mod activates little one-letter buttons that are attached to specific fields in the modified search form. These "Field Buttons" provide single-click execution of field editing tasks such as clearing the field, returning to the value the field had when the program was loaded, and selecting a default value. Field Buttons is not required; if it is not installed, the field buttons simply do no appear on the web page.
  4. This mod gathers data that can be used by the optional mod Show Mod Names, but there is no dependency on Show Mod Names


In TNGv13, this mod includes a typical mod subfolder, with the same base name as the mod's .cfg file. The subfolder is atypical in that no files in it are installed to working TNG folders. However, it does contain critical files that contain the mod's language strings, which the mod does not add to standard cust_text.php files. Instead, the PHP code modified by this mod loads the language strings from files in the mod's languages/ subfolder. Read more about this technique.

[Show Installation Details]


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


  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.


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


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.

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.
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.
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.
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.


Revision History

Mod Version TNG Versions Date Note
Admin Media Thumbnails 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 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 - 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 - 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 Richmond's Genealogy Database Robin Richmond Admin page; not accessible English
Wortelboer Genealogy Bernard Wortelboer Admin page; not accessible NL,EN
Eskeland and Haugland Family User:helland71 Admin page; not accessible NO, EN
Hooley Family Links Rick Hooley Public/Private See Here EN
Généalogie Malvache Cédric Malvache Public/Private FR
Stammbaum der Familien Klein,Landgraf,Eckarts Michael Klein Public/Private DE, EN
The Cole / Tanner Family Tree David Cole Public/Private see here EN, DE, FR, ES, NL
Bastiaanssen Genealogy Jan Bastiaanssen Public / Private NL, EN, ES