Admin Media Search
Admin Media Search | |||
---|---|---|---|
Summary | Adds numerous features to Admin>>Media>>Search, including new run-time search and display option. Perhaps most significantly, it adds hyperlinks to all objects shown in the "Links To" (i.e. medialinks) column and shows tag details for Citation Medialinks. | ||
Validation | |||
Mod Updated | 17 Jul 2020 | ||
Download link | 12.2.0.13.zip
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 | 12.2.0.13 | ||
Min TNG V | 10.1 | ||
Max TNG V | 12.3 | ||
Files modified | admin_media.php, English cust_text.php, admin_genconfig.php, admin_updateconfig.php
May Install rrshared_innermodmenu3.php, rrshared_modsettingsblocks3.php, rrshared_wikilogo.gif | ||
Related Mods | |||
Notes | # There is no benefit to upgrading from Admin Media Searchv.12.0.0.12c to 12.2.0.12c1 if you use TNGv12.2. |
Purpose of the Mod
This distinctly complex mod is intended to make the Admin>>Media>>Search form more powerful and useful. To a significant degree, you can think of this mod as turning the search form into a report-generator. Among its features are:
- In the search form:
- The search string can be a regular expression
- You can control which database fields to search.
- You can select several database fields to be added to the results table
- There are sort order options
- You can control the number of results per page
- In the search results
- The Tree name is shown in a new column when more than one tree is searched (as in other Admin programs).
- Very significantly - This mod converts all of the medialinks in the "Linked To" column into hyperlinks
- For citation medialinks, the tagnames of events supported by the citation are displayed. (See the Citation Medialinks section below.
- In mod version 13, some messages are printed in the Thumnnail column when there is no thumbnail.
More Features
- Search form:
- An HTML fieldset border is drawn around the search form to help distinguish the search form from the action buttons below the form.
- The "File Ext" text field has been changed to a "File Type" drop-down list.
- A mod option determines which database fields can be searched, and which are searched by default
- New search options include:
- Radio buttons that limit the search to media items with thumbnails, or without them.
- A checkbox that limits the search to items that have bodytext.
- Checkboxes to select optional result values: Geocodes, the file path, the MediaID, and/or the Mediakey.
- Some fields utilize single-charter "field button" shortcuts, but only if the Field Button mod is installed.
- Search results
- The geocodes and file path are displayed in their own columns if they are selected in the search form.
- When the file path has not been selected for display, the file extension (the 'FORM' attribute) is displayed in the "Title,Description" column.
- The mediaid and mediakey share a column when they are selected in the search form.
- A button in the "Linked To" column heading toggles the display of the event tags.
- Messages in the thumbnail column:
- Invalid image filename
- Missing file
- The filename extension (well, really, the 'FORM' attribute) for non-images (based on a mod option)
- Other features
- The standard TNG Inner Menu now contains a drop-down menu that provides handy links to information about the mod and a direct link to the mod options editor. I call this menu an Inner Mod Menu, and most of my mods now (or will soon) add Inner Mod Menus to the programs that they alter significantly.
Finer Details:
- The "Linked to" column is allowed to wrap, thus allowing the "Title,Description" column to wrap less.
- Long mediakey values such as filenames are displayed as short links that pop up the full value.
- What was a file extension textbox in the native code is now a "File Type" selection box.
- When the Geocodes column is displayed, it uses abbreviations so that it is narrower than the native Geocoordinates column.
- Under the assumption that, when you print the Admin>>Media>>Search page, you are focusing on the search results, several parts of the web page are omitted when the Admin>>Media>>Search page is sent to a printer. Among the areas excluded from printing are the search form, the Action and Select columns, the page navigation buttons, and the action buttons above the results table. To print these parts of the page, you can do a screen capture and print the resulting screenshot image.
- The reset button resets all of the new search form options to the values they had when the page was loaded, not to the defaults they would have in a new browser session.
Mod Options
This mod's options are implemented as custom TNG settings, in a new 'Mod Settings Block at Admin>>Setup>>General Settings>>Robin's Mods. The options and their effects are described here, and shown in the visualizations.
The options in Admin Media Search version 12* are organized into three groups:
- Media fields that can be searched, and whether they are searched by default.
- The fields that you chose as fields that "can be searched" are presented on the search form as checkboxes.
- Among those fields, the options define which are checked on the search form by default.
- Then, in the search form, you can check and uncheck the checkboxes to control which fields are searched by in a given search.
- Options for Event Tags associated with Citation Medialinks in the LinkedTo column.
This mod can display the tags for events that are supported by a citation medialink. Two options affect this behavior.- Start with the tags visible
- Add a button to toggle the display of the tags.
Note that if both options are unchecked, the tags cannot ever be seen. (There is no run-time option to supersede these mod options.)
- Options for new information to place in the Thumbnails column.
When a media item has no thumbnail path, the results table cell for the thumbnail image is necessarily blank. Under the control of these options, some messages can be displayed in that otherwise blank space.- Check for missing file extension in media and thumbnail paths
- Ordinarily, image file paths must have a filename extension such as .jpg, .png, or .gif, and the absence of a file extension in a media path is an error condition. However, it is possible to use a script to generate or retrieve an image, and it is possible to define scripts that have no filename extentions. If you happen to use such scripts in local path, then you should turn this option off. This test is not performed on external paths (those beginning with' http:' or 'https:').
- Show Mediatypes where there is no thumbnail path value
- This is just a way to use otherwise empty space to display some information about media items that do not have thumbnails. This would almost always include, for example, PDF, DOC, and HTML files, but could include image files, too.
- Show error conditions. Error conditions displayed in otherwise-empty cells in the thumbnail column are distinguished by parentheses and a brown color. Each error message has more information in title text that pops up when you hover over the message. The error messages include:
- (No media file) - The media path is empty and there is no bodytext.
- (No file type) - There is a media path, but the file type (the 'FORM' attribute) is not defined.
- (Bad filename) - The thumbnail path does not have a filename extension, and the Check for missing file extension in media and thumbnail paths option is set.
- (Missing) - There is a thumbnail path, but the file is missing.
- ({filename extension}) - There is no file type, but there is a file extension in the media path.
- Check for missing file extension in media and thumbnail paths
Admin Media Search version 13 has essentially the same features and options as version 12 of the mod. The primary effect of mod version 13 is to reorganize the (too-)many options so that (I hope) they are simpler to manage. The options in Admin Media Search version 13 are divided into seven groups, three of which are single options, and four of which allow
- The entire group of options to be set to values that achieve the native Admin>>Setup>>Search functionality; (i.e. to disable the features handled by the group),
- The entire group of options to be set to recommended settings,
- The entire group of options to be ignored,
- Each option to be edited.
The mod options block initially looks like this:
(The colored borders help you keep track of the options groups as they jump around on the screen a bit when you open and close the groups.)
I'll focus on group 1 to illustrate details.
Here's what you see if you click both the "See Native Behavior" and "See Recommended Behavior" buttons.The descriptions give you a glimpse of how the settings would affect the Admin>>Media>>Search behavior, without requiring you to look at and make decisions about each option. If you just want to make sure that the program takes on the native or recommended behavior, you still don't have to see all of the options in their form fields. You can just click "Apply" and ignore those details.
Here are the form fields for group 1, after they are opened by by the 'Show Settings' button. Unfortunately, the options program cannot tell you whether the option values are set to the native settings, the recommended settings, or custom settings. I've looked into doing that, but would take too much time to implement. But still, the point is that you don't have to deal with all of the options individually - saying, in effect, 'Don't bother me with the details".Citation Medialinks
TNGv12 introduced the ability for TNG to record medialinks to citations, but didn't fully implement them in programs that display information about citations or medialinks. TNGv12.2 added citation medialink-handling in admin_media.php.
Citation medialinks are kind of funky, and it isn't really clear how they should be presented, especially in the context of other medialinks.
A little background:
- A citation links a source with a single event
- The event then links to a person or family.
Thus, when a source (such as a census), provides information about the name, birthdate, and place of residence for, say, five members of a family, plus the date of the parents' marriage, there will be there will be 16 citations - 3 events x 5 people, plus one family event. And the media item (in this case, an image of the census page) would have 16 largely redundant citation medialinks.
To complicate matters, depending on how the data is loaded into TNG, for a given media item, 1. Medialinks directly to the people, the family, and the source might be derived from the citations, and 2. Medialinks directly to the people and the family, and maybe, but less likely, to the source could be created independently.
Lets take an example where there are
- 3 people in the 1930 census, which is source S30, and provides an approximate marriage date,
- The census page image is M301
- The parents have personID's I1 and 2, and the child is I3. We'll pretend that their names are Pop, Mom, and Son.
- The census provides support for each person's name (NAME), birth (BIRT), and place of residence (RESI).
- Then census also supports the parents' marriage, which is S1
- We'll also link the 1920 census to its place, say Dover, Spring Co, OH
For media item M301, we want to see
- Pop (I1)
S30, BIRT, NAME, RESI - Mom (I2)
S30, BIRT, NAME, RESI - Son (I3)
S30, BIRT, NAME, RESI - Pop/Mom (F1)
S30, MARR - 1930 Census (S30)
- Dover, Spring, OH
If there are direct links from the census image to the person, family, and source, we want to see the exact same thing.
To accomplish this, the medialink SQL query joins medialinks to their direct links (People, Family, Sources, Repositories, Places, and Citations), and then joins the citations to their sources and events, and the event to their people and families. There are four sort keys:
- A contrived numeric key that sorts all People first, then Families, Sources, Repositories, and Places
- PersonIDs & FamilyIDs in numeric, not string order (e.g. I2 is converted to I000002 so that it comes before I21 which is converted to I000021),
- Citation sourceID within each PersonID and FamilyID
- Event tags within each PersonID/sourceID and FamilyID/sourceID
Assuming no direct medialinks to the people, family, or source, we get this result set
ID | Source | Tag | Fullname | Husband | Wife | Title |
---|---|---|---|---|---|---|
P1 | S30 | BIRT | Pop | 1930 Census | ||
P1 | S30 | NAME | Pop | 1930 Census | ||
P1 | S30 | RESI | Pop | 1930 Census | ||
P2 | S30 | BIRT | Mom | 1930 Census | ||
2 more P2 results | ||||||
3 P3 results | ||||||
F1 | S30 | Marr | Pop | Mom | 1930 Census | |
Dover, Spring, OH |
To print what is shown above, we have to
- Recognize that the second and third rows have the same personID and sourceID so that we do not reprint the person's name, and so that we do not start a new line for each event tag.
- Remember the sourceID and title, so that we can a print a line for the source after the people and families
Now, if there are also direct medialinks from the census image to each person and family, and to the source, we'll get four more query results, which are sorted appropriately within the result set
ID | Source | Tag | Fullname | Husband | Wife | Title |
---|---|---|---|---|---|---|
P1 | Dad | |||||
P2 | Mom | |||||
P3 | Son | |||||
F1 | Pop | Mom | ||||
S30 | 1930 Census |
But, because we are making sure that we don't print a name, family, or source more than once, we get exact the same display as before.
Finally, note that the result set above also gives us the data we need to turn each person, family, source, and place into a hyperlink to the appropriate TNG pages.
Compatibility
This mod is fully compatible with Unused Media and Private Media Mod.
Related Mods
- Admin Media Predefined Search, which is dependent on this mod, adds a search feature to Admin Media Search that is helpful in a particular situation - in short, when a TNG site mixes files of different Mediatypes (documents, photos, histories, etc.) in a single media folder. This situation generally occurs when a genealogy applications that feeds data to TNG cannot handle multiple folders. Family Tree Maker is one such application.
- Media Bodytext (which has not been released as I write this) changes some features of admin_editmedia.php and showmedia.php - especially with respect to BodyText values.
- This mod saves data that can be used by the optional Show Mod Names utility mod, but this mod is not dependent on Show Mod Names.
Installation
Files Installed
This mod is packaged with a mod subfolder that is shared with several other mods. The shared folder RR-shared_mod_includes_v12.0.0.4 contains files that help to manage mod options in many of my mods:
- rrshared_innermodmenu4.php - Inner Mod Menus
- rrshared_modsettingsblocks4.php - Mod Settings Blocks
- img/rrshared_wikilogo.gif - An icon that links to a mod's TNG Wiki page from an Inner Mod Menu or Mod Settings Block
Each mod that contains the shared folder may install some or all of its shared files, depending on whether those files already exist. Once a file from the shared folder has been installed (by any mod), that file will not be overwritten or removed by the subsequent installation or un-installation of any mod (including this one), nor will its presence or absence generate any Mod Manager errors.
If you unzip mod distribution files directly into your mods folder, then the presence of the shared subfolder and the installation of its files should be invisible to you. But if you generally copy mod subfolders to your mods folder after you have unzipped the distribution file, then you need to make sure to copy the folder RR-shared_mod_includes_v12.0.0.4 (well, unless you are confident that it is already in your mods folder because it was part of another mod).
[Show Installation Details]
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
- Remove and delete previous version of this mod.
- Backup the files updated by this mod. They are listed in the panel at the upper right.
- Download the .zip file, Extract its .cfg file to the mods folder.
- Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files.
Problems?
- Try using the Mod Manager Remove capability
- Contact me through My Mod Support form.
Visualizations
1. Admin>>Media>>Search BEFORE
|
2. Admin>>Media>>Search AFTER, with most of the run-time display options unchecked, and with the options that display extra information in the thumbnail column unchecked.
|
3. Admin>>Media>>Search AFTER, with a few run-time options.
In the search form, as indicated by the red outlines
In the results table, as indicated by the green outlines
|
4. Admin>>Media>>Search AFTER, with a few other options.
In the search form, as indicated by the red outlines
In the results table, as indicated by the green outlines
|
5. Admin>>Media>>Search AFTER, the Inner Mod Menu
This shows the Inner Mod Menu when two mods that affect Admin>>Places>>Search have been installed. For both mods, the Inner Mod Menu provides hyerlinks to
(The Inner Mod Menus of some other mods provide additional links.) |
6. Admin>>Media>>Search AFTER - Mod Options
The options are described in some detail up in the Mod Options section of this article. The Wiki logo next to the mod name is a hyperlink to the mod's Wiki article. Significantly, when you go to Admin>>Setup>General Settings, and select Robin's Mods, you'll see the options for all of the mods that have placed options in this subform. But when you link to a mod's options through the Inner Mod Menu shown in the previous visualization, you'll see what you see in this screen shot - just the one Mod Setting Block. If you click the subform heading (the triangular arrow or the label Robin's Mods) in this screen clip, all of the mods in the subform will be displayed. Then, if you click the heading again, all of the mod settings will be hidden. |
Styles
My mods generally do not add style rules to genstyle.css because
- genstyle.css has SO MANY rules already,
- The rules added by most mods affect only one or two programs, and just take up space in genstyle.css for other programs, and
- Keeping mod-generated rules separate helps to avoid classname conflicts between mods.
Some of my mods define stand-alone .css files, but most of my mods (like this one) define an inline style sheet.
/*Suppress printing on a printer */
@media print {
.rramsnoprinter {display:none;}
}
/* Move labels closer to checkboxes and radio buttons */
input[type='checkbox'], input[type='radio'] {margin-right:1px;}
/******* Format popup help text that is displayed in a LITbox ******/
.rrlitboxhint {font-family:sans-serif;
font-size:108%;
padding:0 5px;
}
/* Use bold and a background color to emphasize <code> elements in my litbox hints. */
.rrlitboxhint code {background-color:lightBlue;
font-weight:bold; white-space:no-wrap;
}
/* Make sure that there is not too much vertical spacing around <ol> elements. */
.rrlitboxhint ol {margin-top:1ex; margin-bottom:0;
margin-right:5px;
}
/* Position the title in the litbox title bar */
#LB_titletext {padding: 3px 0 0 3px;
}
/* A footnote in help text litboxes */
.rrlitboxhint footer {font-size:85%;
margin-top:1ex;
border-top:1px solid gray;
font-family: sans-serif;
text-align:center;
}
/* Right-justify the labels in the first column of the search form layout table */
.rramslabels {text-align:right; padding-right:.6em;
padding-top:4px;
}
/* Position the Search and Reset buttons to the right inside the search form. */
.rramssubmit {float:right; text-align:right;
padding-left:2em;
}
/* Give the links column a minimum width, and its list elements a smaller indentation */
.rramslinks {min-width:16em;}
.rramslinks ul {margin-left:12px; padding-left:0px;}
/* A button in the linked to column to hide event tags */
#tagsbutton {float:right; padding:1px 2px; cursor:pointer;}
/* For spans with explicit popups or click events */
.rramspoint {cursor:pointer}
.rramspointerr {cursor:pointer; color:brown;} /* Errors */
/* The show/hide tags buttons */
.rrtagsshow,.rrtagshide {float:right; padding:1px 2px; cursor:pointer;}
<?php
if ($rrconfig['MediaStartWithCiteTags'])
echo ".rrtagsshow{display:none}\n";
else echo ".rrtags,.rrtagshide{display:none}\n";
?>
Note that the last two styles are generated by PHP code. Those styles control the visibility of the citation medialink event tags on the basis of the mod option that controls whether the tags are displayed or hidden as the page is loaded.
If you want to override any of these rules, you can add supplemental rules to your template's mytngstyle.css file, or to the bottom of your genstyle.css. (As it turns out, it takes a JQuery document.ready trick to allow you to override my inline style rules this way. That trick is described in a Technical Note in my TNG Wiki home page.)
Revision History
Mod Version | TNG Version | Date | Note |
---|---|---|---|
12.2.0.12c1 | 12.2 - 12.3 | 25Feb2020 | No Functional Changes.
|
12.0.0.12c | 12.0 - 12.2 | 15Dec2019 | No Functional Changes. Just upgraded to version 3 of the shared mod libraries and fixed a bug that was using the media item tree instead of a medialink tree. (They are rarely different, but they can be.) |
12.0.0.12b | 12.0 - 12.2 | 30Oct2019 |
(See also the revision notes for v12.0.0.12 and v12.0.0.11, which were pretty short-lived.) |
12.0.0.12 | 12.0 - 12.2 | 24Oct2019 | This version needed immediate repair by version 12a, so it cannot be downloaded.
[Minor changes]
Small presentation enhancements:
[Hide details]
|
12.0.0.11 | 12.0 - 12.1 | 30Sep2019 | (This version was pretty short-lived. Several of its new features are handled much better in version 12.0.0.12a, which is also more fault-tolerant.)
[Less significant changes]
[Hide details]
|
12.0.0.10 | 12.0+ | 4May2018 | No functional changes; made compatible with TNGv12. |
10.1.0.10 | 10.1 - 11.1.2 | 17Dec2017 |
- Added the size of the Bodytext field to the filepath column if it is being displayed, and to the "Title, Description" column otherwise |
10.1.0.9b | 10.1 - 11.1+ | 10May2017 |
|
10.1.0.8 download | 10.1 - 10.1.3 | 21 Feb 2016 | Added thumnbnail search option, and missing thumbnail message. Displays media key.
Also now depends on Show Mod Names v2+. |
10.1.0.7c | 10.1 - 10.1.1 | 12Jul2015 | Made this mod compatible with Rick Bisbee's new Showfolio Mod by tweaking a code fragment. No other changes. |
10.1.0.7b | 10.1 - 10.1.1 | 5Jun2015 | Made this mod compatible with Chris Moss's new Private Media Mod. No changes other than the inclusion of the new Private Media flag created by Private Media Mod. |
10.1.0.7 | 10.1 - 10.1.1 | 11May2015 | - Added showfilename and showgeocode parameters to display or suppress columns - Added abbreviations for latitude and longitude. - Added tree column - Added hyperlinks to all linked objects, including places - Added no-space breaks in the filename column to allow the path to wrap a bit. - Allowed the linked object names to wrap, but specified a minimum column width. |
10.1.0.5 | 10.1 | 30Dec2014 | No functional changes, just changed database references for TNG v10.1 compatibility. |
9.0.0.4 download | 9.0.0 - 10.0.0.3 | 26 Dec 2014 | Fixed a bug that was preventing the program from recognizing when the collection was changes, and from changing the collection Add/Edit buttons and fields in response. |
9.0.0.3 | 9.0.0 - 10.0.0.3 | 11Dec2014 | No functional changes; no visualization changes. Cleaned up mod directives for the TNGv10.3 alpha release. Added better annotation to the code changes. Eliminated a duplicate checkbox in the search. Places cust_text insertions at the end of cust_text.php instead of at the beginning. |
9.0.0.1 | 9.0.0 - 10.0.0.3 | 08 May 2014 | 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 | Mod developer | 12.2.0.12c | 12.3 | English |
Total Family History | Scott Bennett | Private Site (For right now) | V9.0.0.1 | TNG 10.0.1 - 11.1.2 | EN |
Wortelboer Genealogy | Bernard Wortelboer | Public site | 10.1.0.8 | 11.0.0 | NL/EN |
De Zoethouten van Woudsend | John Zoethout | Public site | 10.1.0.5 | 10.1.0 | Dutch/English |
Hooley Family Links | Rick Hooley | Public/Private | See Here | See Here | EN |
DJCM.DK | Claus Martinussen | Public site | 12.0.0.10 | 12.0 | DA/EN |
Bisbee Family Connection | Rick Bisbee | Public site | 10.1.0.7(c) | 10.1.2 | English |
Adler-Wien | Herbert Fischer | Public site | 12.2.0.12c1 | 12.3 | DE,(EN) |
Stamboom Jongman | Roel Jongman | Public/Private site | 10.1.0.9(b) | 10.1.3 | NL, DE, EN |
Our Family History | Paul Barrett | Public/Private site | 10.1.0.9b | 11.1.2 | EN |
Roots & Relatives Remembered | Ron Krzmarzick | Public & Private | See Here | See Here | EN,DE,CS,ES |
Cole / Tanner Family Tree | David Cole | Public/Private | see here | see here | English |