Difference between revisions of "Show Mod Names"

From TNG_Wiki
Jump to navigation Jump to search
(Updates user table)
(45 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 +
{{construction
 +
|notes=Under Construction<br>(The text of this article describes Version 18, but the visualizations are from Version 15.<br>Robin Richmond 28 Sep 2019}}
 +
 +
{{V12_cust_text}}
 
{{TNGmod
 
{{TNGmod
| mod_name        = Show Mod Names
+
| mod_name        = Show Mod Names
| mod_summary    = A utility mod that doesn't change any programs by itself, but creates a function that is used by other mods to reveal to users (perhaps just to admin users) the names of mods that affect TNG programs.  
+
| mod_summary    = A utility mod that doesn't change any programs by itself, but rather installs an include file that is used by other mods to reveal to admins (and potentially all users) the names of (some) mods that affect the running TNG programs.  
 
| mod_validation  =  
 
| mod_validation  =  
| download_link  = For {{Tv1013}}{{Tv1010}}<br />[[Media:show_mod_names_v10.0.0.1.zip|show_mod_names_v10.0.0.1.zip]]
+
| mod_last_update = 28 Sep 2019
 +
| download_link  = [[Media:show_mod_names_v12.0.0.5.zip|v12.0.0.5]]{{Tv120}}
 +
<div>[[Media:show_mod_names_v12.0.0.5.zip|v12.0.0.5 - beta]]</div>
 
| download_stats  =
 
| download_stats  =
 
| mod_author      = [[User:Robinrichm|Robin Richmond]]
 
| mod_author      = [[User:Robinrichm|Robin Richmond]]
Line 9: Line 15:
 
| mod_contact    = [http://www.robinrichmond.com/family/mod_support.php My Mod Support form]
 
| mod_contact    = [http://www.robinrichmond.com/family/mod_support.php My Mod Support form]
 
| mod_support    = [http://www.robinrichmond.com/family/mod_support.php My Mod Support form] or [http://tng.community/ TNG Community Forums]
 
| mod_support    = [http://www.robinrichmond.com/family/mod_support.php My Mod Support form] or [http://tng.community/ TNG Community Forums]
| mod_version    = 10.1.0.1
+
| mod_version    = 12.0.0.8
| min_TNG_ver    = 10.1
+
| min_TNG_ver    = 10.0
| max_TNG_ver    = 10.1.3
+
| max_TNG_ver    = 12.2
|   TNG_file_list  = begin.php, css/cust_text.css
+
| TNG_file_list  = css/cust_text.css, genlib.php, creates rrshowmodnames_include.php, admin_genconfig.php, admin_updateconfig.php <br>Installs shared files: rrinnermodmenu1_include.php, img/rrmodadmin_wikilogo.png
| related_mods   = [[Show Branch Members]] is an example of a mod that uses the function created by this mod.
+
| related_mods   =
| notes    =  
+
| notes          = 
 +
== Purpose of the Mod ==
 +
To generate a list of mods (really just my mods) that affect a particular program while it is running.
 +
'''This mod doesn't do anything by itself; it just installs code that can be used by other mods'''.  It exists as a separate mod only so that each mod that uses this new mod-listing scheme doesn't have to install the necessary code redundantly.   
 
}}
 
}}
 
 
{| style="margin-right:0.5 em;" align="right"  
 
{| style="margin-right:0.5 em;" align="right"  
 
| __TOC__
 
| __TOC__
 
|}
 
|}
  
== Purpose of the Mod ==
+
Note that, when this mod is installed with the default mod parameter values,
To display a list of the mods that affect a particular program.  This is done through a PHP function, '''showModNames($modlist)''', where $modlist is an associative array where the subscript is a mod name, and the value is the mod version number.
+
# Non-admin programs won't look any different at all, since the list of mods that affect such programs is simply generated as an HTML comment.
 +
# Some small "information buttons" in administrative programs are formatted (a blue circle around an i). It doesn't require users of an affected TNG program to do anything different, and end-users typically don't see anything different at all. Site admins who a run a program that uses [[Show Mod Names]] simply see a button that says "Show Mods", and can click on that button to see a list of compliant mods that affect that program.
 +
 
 +
You should install this mod '''only''' if you install one or more other mods that say they utilize this mod.''' (Or, in practice, you should install this mod if you install any of [[User:Robinrichm|Robin Richmond]]'s mods or a mod from other mod programmers who are using this scheme.)
 +
 
 +
This mod (and the overall mod-reporting scheme behind it) is motivated primarily by this problem:<br/>
 +
When mod developers go to a TNG site to track down a reported mod problem, it is often not clear which mods (and which versions) affect the program they are checking outAlthough TNG Mod Manager does a good job of listing which versions of which mods are installed, and its Analyzer shows which mods potentially affect which TNG '''''files''''',  
 +
# It is only available to the administrator of a site, and
 +
# It does not show which mods affect the function libraries used by a '''''program'''''.
 +
 
 +
[[Show Mod Names]], on the other hand, lists
 +
# The mods that affect the files used by the running program, and
 +
# The files that those mods affect ''and that are used by the running program''.
 +
 
 +
So [[Show Mod Names]] ''supplements'' the information provided by the Mod Manager.
  
Note that '''this mod doesn't change the display of any TNG program'''.  It just defines a function that can be called by modded TNG programs to display the mods that affect a given program. If this mod is not installed, mod names "registered" to TNG simply won't be displayed.  
+
[[Show Mod Names]] can also be useful for TNG site administrators as a simple reminder of which mods affect a given program, as it is not easy to remember exactly which features of a program are "pristine" and which are the result of mods.
  
<div style="thin solid grey; background-color:lightgrey; margin:0 2em;">This mod, and the mod-registration scheme behind it ARE NOT (at least not yet) anything close to a TNG standard.  They represent a first effort toward a shared mechanism for helping TNG users know what mods affect the programs they run, and thus to facilitate
+
<div style="border:thin solid grey; background-color:#fcd1f7; margin:0 1.5em;">This mod, and the mod-registration scheme behind it ARE NOT anything close to a TNG standard or conventionI have attempted to implement and [[Show Mod Names Programmer Documentation|document]] it so that it ''could'' be used more widely. Currently there are few mod programmers who are using this scheme.
# debugging when errors do occur, and
 
# some awareness of when non-pristine code is being run.
 
 
</div>
 
</div>
  
== Compatibility And Dependencies ==
+
== Mod Conflicts ==
No known conflicts. But, as noted above, this mod only provides a function that can be used by other mods; it does not change any program's output or appearance by itself.
+
No known conflicts. This mod is not dependent on any other mod, nor is any mod dependent in it.  But almost all of my mods ''can utilize the functionality of Show Mod Names '''if and only if Show Mod Names is installed'''''. Remember that '''there is no benefit to installing this mod unless you also install one of my mods that uses it or a mod from other mod programmers who are using this scheme.'''
  
==Automated Installation==
+
== Mod Options ==
# Uninstall previous version of this mod.
+
The three mod parameters determine how visible the mod list is to users.
# Backup begin.php and css/genstyle.css, the only files directly affected by this mod.
+
# '''$showModNamesAtAll''' determines whether the running program will try to display the mod names on the screen, or just write them to an HTML comment. If it is <b>false</b>, the mod names will always be written to an HTML comment, and will never affect the visible output of any program. It defaults to <b>true</b>.
# Download the .zip file and extract its .cfg file to the mods folder.
+
# '''$showModNamesAdminOnly''' determines whether to display mod information only to administrators.  When it is <b>true</b>, the code will not affect the output of programs run by non-admins. (Note that this parameter's value doesn't matter if the first parameter value is false.) It defaults to <b>true</b>.
# Follow the normal automated installation for Mod Manager, as shown in the example [[Mod Manager - Installing Config Files]].
+
# '''$showLinkToModNames''' causes the list of mods to be hidden behind a button.  (Again, this parameter's value doesn't matter if the first parameter value is false.) It defaults to <b>true</b>.
  
== In the event of a problem ==
+
With the parameters' default values:
# Try using the [[Mod_Manager_-_Installing_Config_Files#Remove_Mod_Steps|Mod Manager Remove]] capability
+
* End users never see information about the mods that affect the program they are running, since the list of mods is placed in an HTML comment.
# Contact the mod author through [http://www.robinrichmond.com/family/mod_support.php My Mod Support form].
+
* Administrators see just a "Show Mods" button in the program footer, and can click on that button to see the list.
  
== Visualization of this Mod ==
+
== Installation ==
 +
This mod uses the standard installation procedure, though it should be noted that this mod contains a mod subfolder that is shared with other mods that implement '''[https://tng.lythgoes.net/wiki/index.php?title=Mod_Settings_Blocks Mod Settings Blocks]'''. Because of the shared subfolder, as you unzip or copy the mod, you might get a warning noting that a file or folder already exists.  You can just ignore that warning.<br>{{RobinInstallationBoilerplate}}
 +
 
 +
== Visualizations ==
  
 
{| border="1" cellspacing="1" cellpadding="2" class="wikitable"
 
{| border="1" cellspacing="1" cellpadding="2" class="wikitable"
 
|-  
 
|-  
! <span style="color: red">'''AFTER:'''</span>
+
! align=left | <span style="color: red">'''AFTER:'''</span>
 
|-  
 
|-  
| Here's a set of mod names at the bottom of the Person Profile, getperson.php. Note that each mod name is a hyperlink to that mod's Wiki page.
+
| <span style="color: red">End Users</span><br/> With the default parameters, there is no visible effect to end-users, but admins will see a "Show Mods" button in the footer of pages produced by programs that have been affected by mods that use [[Show Mod Names]]. The list of mods can be made more or less visible through the mod parameters described above.
[[Image:show_mod_names-after2.png]]
 
 
|-  
 
|-  
! <span style="color: red">'''AFTER:'''</span>
+
| <span style="color: red">Admins running end-user Programs</span><br/>When site admins run end-user programs that use this mod (and that have a template-controlled footer), they will see the "Show Mods" button at the very bottom of the content area of the page. This screen shot shows the bottom of a page using Template 5.
 +
[[Image:show_mod_names-after-enduser.png]]
 
|-  
 
|-  
| And a set of mod names at the bottom of the Gedcom Import form, admin_dataimport.phpAdministrative programs apply the HTML template different from end-user programs, and need different mod target locations to place the mod names at the bottom of the screen.
+
| <span style="color: red">Admin Programs</span><br/>Admin programs that use this mod will display the button on the left side of the page footer.
[[Image:show_mod_names-after.png]]
+
[[Image:show_mod_names-after-admin.png]]
 +
|-
 +
| <span style="color: red">After clicking the "Show Mods" Button</span><br/>Here's how an admin program footer might look after the button is clickedThe version of each mod is shown, and each mod name is a hyperlink to the mod's Wiki article.
 +
[[Image:show_mod_names-after-expanded.png]]
 +
|-
 +
| <span style="color: red">Hovering over a Mod Name</span><br/>As you mouse over one of the mod names, you can see
 +
# The hyperlink to the mod's Wiki page, and
 +
# The mod's Title text, which lists the files that the mod edits, and possibly the PHP function(s) within a file.
 +
[[Image:show_mod_names-after-mouseover.png]]<br/>
 +
There are two pop-ups in the illustration just above,
 +
# The address of the target page (i.e. the mod's Wiki article) on the left, and
 +
# The list of files affected by the mod and used by this program:
 +
#* admin_gedimport.php,
 +
#* gedimport_misc.php,
 +
#* The function ClearData in gedimport_trees.php.
 +
Remember that the selected mod might modify other TNG files, but if those files are not used by the running program, then [[Show Mod Names]] won't know anything about them and won't list them.
 
|}
 
|}
  
== How it works ==
+
== [[Show_Mod_Names_Programmer_Documentation|Programmer Documentation]] ==
 
+
(See the Wiki article [[Show Mod Names Programmer Documentation]].)
=== Registering a mod ===
+
== Revision History ==
When a mod - or really, a modded program, wants to display a list of mods that affect the program, the program (via mods) must first "register" each mod at runtime by saving it to an associative array through a PHP statement such as
 
<syntaxhighlight lang="php" enclose="div">
 
$tngModNames['Show Branch Members'] = '1'; #Register version 1 of the "Show Branch Members" mod.
 
</syntaxhighlight>
 
The mod name should be in the same form as the name of Wiki article that describes it (with or without underscores), and the version number would represent the ''mod version number'' (typically, a single digit; sometimes a number and a letter such as "11f"), not the full filename suffix consisting of a TNG version and mod number (typically, 4 "period-parts").  But when, say, the 4th version of a mod exists in a version for TNG9 and TNG10.0, and another version for TNG10.1, then it might be appropriate to specify the full version string.
 
 
 
It is generally useful, just for the sake of documentation, for mod programmers to put a comment at the beginning of each PHP file that they modify.  It's generally convenient to "register" the mod along with that comment.  For instance, the program admin_dataimport.php has been modified by three different mods, each of which have placed comments at the top of the file, so that the beginning of the file looks like this:
 
<syntaxhighlight lang="php" enclose="div">
 
<?php
 
# This program has been modified by the Gedcom Import Purge mod to:
 
# - Offer a checkbox so the user can or suppress the purge of media links previously
 
#  imported from a Gedcom.
 
# - Add an information hyperlink (a blue circled question mark) next to the new Purge Medialinks checkbox.
 
# - Implement mod parameters that set defaults for the Purge Medialinks field, and the related "Import Media" field.
 
$importmediaParam = true; # Check the "Import media" checkbox
 
$purgemedialinksParam = true; # Check the "Purge medialinks" checkbox
 
$tngModNames['Gedcom Import Purge'] = 1; # Save mod name & version to be displayed at the bottom of the page.
 
 
 
# This program has been modified by the Gedcom Import Monitor mod to (for example):
 
# - Offer a set of radio buttons to control the frequency of import status display.
 
# - Add an information hyperlink (a circled question marks) to a new section of the help page.
 
# - Implement mod parameters that set defaults for the two related form fields.
 
# See the mod's wiki article for a more complete description of the changes.
 
$oldstyleimportParam = true; # Mod parameter - Check the "Old style import" checkbox
 
$frequencyParam = "low"; # Mod parameter - Which radio button to check - low, medium, or high
 
$tngModNames['Gedcom Import Monitor'] = 1; # Save mod name & version to be displayed at the bottom of the page.
 
 
 
# This program has been modified by the Gedcom Import Mediatype mod v1 to:
 
# - Define a mod parameter with the Mediatype (photos, documents, etc.)
 
#  to be used for all new Media Items created by the Gedcom Import.
 
# - Define a new control on the form that kicks off the Gedcom import so that the
 
#  user can confirm that default Mediatype.
 
$mediatypeModParam = "videos"; # Initial definition of the mod parameter
 
$tngModNames['Gedcom Import Mediatype'] = 1; # Save mod name & version to be displayed at the bottom of the page.
 
 
 
include("begin.php");
 
include("adminlib.php");
 
...
 
</syntaxhighlight>
 
 
 
One mod may modify several files, of course, and those files can be separate programs, programs and function libraries, or just function libraries.  You can register the mod in each file, or not, as you wish.  If mod X modifies getperson.php and genlib.php, for example, registering the mod at the beginning of genlib.php would be redundant with registering it with getperson.php ''for the purpose of displaying mods that affect getperson.php'', but other programs that use genlib.php could also be affected by mod X.  So it should generally be useful to either
 
# registering mod X at the beginning of genlib.php, or
 
# register mod X in each modified function.
 
Registering mod X at the beginning of genlib.php would ultimately have the effect of listing mod X as affecting every program that Includes genlib.php, whereas registering mod X in each modified function would have the effect of listing mod X as affecting only those programs that call those same functions (and execute the line of code where mod X is registered).
 
 
 
=== Displaying the Mod Names ===
 
To display the names of all mods that have been registered by that program, the program should '''''conditionally''''' call the function showModNames, and pass it the registration array, $tngModNames, like this:
 
<syntaxhighlight lang="php" enclose="div">
 
### Display the mod name at the bottom of the page.
 
if (function_exists("showModNames")) echo showModNames($tngModNames);
 
</syntaxhighlight>
 
Note that
 
# You should use the PHP function function_exists to make sure that the function actually exists. At any TNG site, the administrator does not have to install [[Show Mod Names]], in which case, the showModNames function will not exist.
 
# If several mods that use this mechanism all modify program Y, then program Y will have multiple instances of this statement.  But the mod names will be displayed only once because showModNames unsets the array.  It is not necessary for the calling program to worry about whether the array exists; showModNames takes care of that.
 
# To assure that each instance of this statement is unique to Mod Manager, you should add a comment that includes the mod name, like this:
 
<syntaxhighlight lang="php" enclose="div">
 
### Show Branch Members mod location 5: Display the mod name at the bottom of the page.
 
if (function_exists("showModNames")) echo showModNames($tngModNames);
 
</syntaxhighlight>
 
See the article section called Placing the Mod Names on the Page for more information.
 
 
 
=== Placing the Mod Names on the Page ===
 
 
 
==== End-User Programs ====
 
TNG end-user programs typically use TNG templates to display page footers, and those templates are typically invoked through the statement
 
<syntaxhighlight lang="php" enclose="div">
 
tng_footer($flags);
 
</syntaxhighlight>
 
So, for end-user program, it is generally pretty easy to know when you have reached the bottom of the content area of the page.
 
In the first illustration above, the following target location was in the mod [[Show Branch Members]], and applied to the target file getperson.php.
 
<div style="border:thin solid grey;background-color:#cdfeda;">
 
%location:%
 
tng_footer( $flags );
 
%end:%
 
%insert:before%
 
### Show Branch Members location 4: Display hyperlinked list of mods
 
if (function_exists("showModNames")) echo showModNames($tngModNames);
 
### Show Branch Members location 4: End of insertion.
 
%end:%
 
</div>
 
Not all mod programmers will want to place two comments around the inserted PHP code, but it is essential that you place some unique information in the insertion text so that different mods do not generate identical code.
 
 
 
==== Admin Programs ====
 
Administrative programs are less consistent in how they lay out the page.  For most Administrative programs, the page footer consists of only a TNG copyright statement, and the HTML that lays out the page isn't part of a template.  Some administrative programs put a table inside a form element, and the form element is the wrapper for the content area.  Other administrative programs use a <div> or a table, or a table cell.  So you'll just have to look at a particular program and try to figure it out.
 
 
 
The second illustration above, using the program admin_dataimport.php above, uses the follow target location to place the call to showModName:
 
<div style="border:thin solid grey;background-color:#fecdaa;">
 
%location:%
 
</td>
 
</tr>
 
</table>
 
%end:%
 
%insert:before%
 
<?php
 
### Gedcom Import Mediatype location 5: Display the mod name at the bottom of the page.
 
if (function_exists("showModNames")) echo showModNames($tngModNames);
 
### Gedcom Import Mediatype location 5: end of insertion
 
?>
 
%end:%
 
</div>
 
Note that we had to switch into PHP mode and then back out because the PHP file was in HTML Mode before and after the PHP code we needed to insert.
 
 
 
== Mod Change History ==
 
  
 
{| border="0" cellspacing="1" cellpadding="2" class="wikitable"
 
{| border="0" cellspacing="1" cellpadding="2" class="wikitable"
 
|-
 
|-
! Mod Version
+
! Mod Version !! TNG Versions !! Date !! Note
! TNG Versions
+
|- style="vertical-align:top;"  <!-- ############################################################## -->
! Date
+
| [[Media:show_mod_names_v10.0.0.5.zip|v10.0.0.5]]
! Note
+
| 12.0-12.2+
|-  
+
| 28 Sep 2019
 +
|
 +
*No functional changes; brought into compliance with TNGv12
 +
*Changed the name of the installed file to be consistent with my naming convention.
 +
*Updated the search text for location 1 of genlib.php because of a TNGv12 change.
 +
|- style="vertical-align:top;"  <!-- ############################################################## -->
 +
| [[Media:show_mod_names_v10.0.0.4.zip|v10.0.0.4]]
 +
| 12.0-12.0.2+
 +
| 25 Oct 2018
 +
| Brought into compliance with TNGv12, and changed the named of the installed file to be consistent with my naming conventions.
 +
|- style="vertical-align:top;"  <!-- ############################################################## -->
 +
| [[Media:show_mod_names_v10.0.0.3b.zip|v10.0.0.3b]]
 +
| 10.0-11.1.2
 +
| 11 Jan 2018
 +
| Removed the second line from the cust_text.php target location search string
 +
|- style="vertical-align:top;"  <!-- ############################################################## -->
 +
| 10.0.0.3
 +
| 10.0-11.0.1
 +
| 18 Jul 2016
 +
| The "Show Mods" button does not print, since it is superfluous when printed.  Also tweaked the style classes added to genstyle.css so that I could use them in other mods.
 +
|- style="vertical-align:top;"  <!-- ############################################################## -->
 +
| 10.0.0.2a
 +
| 10.0-11.0
 +
| 20 Mar 2016
 +
| Tested in TNGv11 and fixed a couple of glitches - It wouldn't display, hide, and then display the mod names again, and there was a possible inaccurate warning message.
 +
|- style="vertical-align:top;"  <!-- ############################################################## -->
 +
| 10.0.0.2
 +
| 10.0-10.1.3
 +
| 13 Feb 2016
 +
| Completely rewritten to use an include file (and include_once), to write the mod names to an HTML comment in most case, and '''to require the installation of [[Show Mod Names]]'''
 +
|- style="vertical-align:top;"  <!-- ############################################################## -->
 
| 10.0.0.1
 
| 10.0.0.1
 
| 10.0-10.1.3
 
| 10.0-10.1.3
| 15 Nov 2015
+
| 6 Dec 2015
 
| New mod.
 
| New mod.
 
|}
 
|}
  
 
== Sites using this mod ==
 
== Sites using this mod ==
If you download and install this mod, please add your site to the table below.
+
If you download and install this mod, please add your TNG site to the table below:
 +
 
 
{| border="0" cellspacing="1" cellpadding="2" class="wikitable"
 
{| border="0" cellspacing="1" cellpadding="2" class="wikitable"
 
|-
 
|-
Line 190: Line 156:
 
! User-language
 
! User-language
 
|-
 
|-
| Not installed
+
| [http://roygen.theroyfamily.com The Roy Family]
| [[User:Robinrichm|Robin Richmond]]
+
| [[User:Rob_Roy|Rob Roy]]
| Mod developer
+
| Public. Used to assist developers with installed Mods using this tool.
| 10.0.0.1
+
| 12.0.0.4
| 10.1.3
+
| 12.1
 +
| EN
 +
|-
 +
| Wamp Server
 +
| [[User:Brett|Brett McPhee]]
 +
| Test install TNG v12.2. Used to identify Mods actually affecting a page.
 +
| 12.0.0.5
 +
| 12.2
 +
| EN
 +
|-
 +
| [https://WokingFamily.com/ Woking Family Tree Project]
 +
| [[User:TBirdUK|Pete Smee]]
 +
| Public/Private
 +
| v12.0.0.4
 +
| v12.1
 
| English
 
| English
 +
|-
 +
| [https://www.ourfamilyhistories.org Our Family Histories]
 +
| [[User:Bsl20b50|Bryan S. Larson]]
 +
| Public - T8 customized
 +
| [[User:Bsl20b50|see here]]
 +
| [[User:Bsl20b50|see here]]
 +
| EN
 +
|-
 
|}
 
|}
  
[[Category:Mods for TNG v10]]
+
[[Category:Mods for TNG v10]][[Category:Mods for TNG v11]][[Category:Mods for TNG v12]]
[[Category:begin.php mods]]
+
[[Category:genstyle.css mods]][[Category:genlib.php mods]]
[[Category:cust_text.css mods]]
+
[[Category:admin_genconfig.php mods]]
 +
[[Category:admin_updateconfig.php mods]]

Revision as of 23:29, 29 September 2019

Construction Under Construction
(The text of this article describes Version 18, but the visualizations are from Version 15.
Robin Richmond 28 Sep 2019
Construction



Ambox notice.png The latest version of this mod uses the guidelines for TNG v12+ cust_text.php files. If you are using TNGv12+, and any cust_text.php file in this mod is marked with a Bad Target error, you need to update your cust_text.php files before you can install this mod. [Show instructions]

If you upgraded to TNGv12+, and did not update your cust_text.php files as instructed in the upgrade readme script, then you must use the TNG Mod Manager to update them. To do so:

  1. Go to Mod Manager, and select its "Recommended Updates" tab.
    (If the "Recommended Updates" tab is not visible, then go to the Mod Manager Options tab, select "Display Settings", and turn on the "Recommended Updates" tab.)
  2. Click the "Update" button in the "Recommended Updates" tab.
    Installed mods do not interfere with the update, and if you already have (or think you may have) run this update, it will not hurt for you to run it again.

[See details in the TNGv12 Change Impacts Article][Hide the instructions]

TNG 14.0
TNG 13.0
TNG 12.0



Show Mod Names
Summary A utility mod that doesn't change any programs by itself, but rather installs an include file that is used by other mods to reveal to admins (and potentially all users) the names of (some) mods that affect the running TNG programs.
Validation
Mod Updated 28 Sep 2019
Download link v12.0.0.5
TNG 12.0
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 12.0.0.8
Min TNG V 10.0
Max TNG V 12.2
Files modified
css/cust_text.css, genlib.php, creates rrshowmodnames_include.php, admin_genconfig.php, admin_updateconfig.php
Installs shared files: rrinnermodmenu1_include.php, img/rrmodadmin_wikilogo.png
Related Mods
Notes
== Purpose of the Mod ==

To generate a list of mods (really just my mods) that affect a particular program while it is running.

This mod doesn't do anything by itself; it just installs code that can be used by other mods. It exists as a separate mod only so that each mod that uses this new mod-listing scheme doesn't have to install the necessary code redundantly.


Note that, when this mod is installed with the default mod parameter values,

  1. Non-admin programs won't look any different at all, since the list of mods that affect such programs is simply generated as an HTML comment.
  2. Some small "information buttons" in administrative programs are formatted (a blue circle around an i). It doesn't require users of an affected TNG program to do anything different, and end-users typically don't see anything different at all. Site admins who a run a program that uses Show Mod Names simply see a button that says "Show Mods", and can click on that button to see a list of compliant mods that affect that program.

You should install this mod only if you install one or more other mods that say they utilize this mod. (Or, in practice, you should install this mod if you install any of Robin Richmond's mods or a mod from other mod programmers who are using this scheme.)

This mod (and the overall mod-reporting scheme behind it) is motivated primarily by this problem:
When mod developers go to a TNG site to track down a reported mod problem, it is often not clear which mods (and which versions) affect the program they are checking out. Although TNG Mod Manager does a good job of listing which versions of which mods are installed, and its Analyzer shows which mods potentially affect which TNG files,

  1. It is only available to the administrator of a site, and
  2. It does not show which mods affect the function libraries used by a program.

Show Mod Names, on the other hand, lists

  1. The mods that affect the files used by the running program, and
  2. The files that those mods affect and that are used by the running program.

So Show Mod Names supplements the information provided by the Mod Manager.

Show Mod Names can also be useful for TNG site administrators as a simple reminder of which mods affect a given program, as it is not easy to remember exactly which features of a program are "pristine" and which are the result of mods.

This mod, and the mod-registration scheme behind it ARE NOT anything close to a TNG standard or convention. I have attempted to implement and document it so that it could be used more widely. Currently there are few mod programmers who are using this scheme.

Mod Conflicts

No known conflicts. This mod is not dependent on any other mod, nor is any mod dependent in it. But almost all of my mods can utilize the functionality of Show Mod Names if and only if Show Mod Names is installed. Remember that there is no benefit to installing this mod unless you also install one of my mods that uses it or a mod from other mod programmers who are using this scheme.

Mod Options

The three mod parameters determine how visible the mod list is to users.

  1. $showModNamesAtAll determines whether the running program will try to display the mod names on the screen, or just write them to an HTML comment. If it is false, the mod names will always be written to an HTML comment, and will never affect the visible output of any program. It defaults to true.
  2. $showModNamesAdminOnly determines whether to display mod information only to administrators. When it is true, the code will not affect the output of programs run by non-admins. (Note that this parameter's value doesn't matter if the first parameter value is false.) It defaults to true.
  3. $showLinkToModNames causes the list of mods to be hidden behind a button. (Again, this parameter's value doesn't matter if the first parameter value is false.) It defaults to true.

With the parameters' default values:

  • End users never see information about the mods that affect the program they are running, since the list of mods is placed in an HTML comment.
  • Administrators see just a "Show Mods" button in the program footer, and can click on that button to see the list.

Installation

This mod uses the standard installation procedure, though it should be noted that this mod contains a mod subfolder that is shared with other mods that implement Mod Settings Blocks. Because of the shared subfolder, as you unzip or copy the mod, you might get a warning noting that a file or folder already exists. You can just ignore that warning.
[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

  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

AFTER:
End Users
With the default parameters, there is no visible effect to end-users, but admins will see a "Show Mods" button in the footer of pages produced by programs that have been affected by mods that use Show Mod Names. The list of mods can be made more or less visible through the mod parameters described above.
Admins running end-user Programs
When site admins run end-user programs that use this mod (and that have a template-controlled footer), they will see the "Show Mods" button at the very bottom of the content area of the page. This screen shot shows the bottom of a page using Template 5.

Show mod names-after-enduser.png

Admin Programs
Admin programs that use this mod will display the button on the left side of the page footer.

Show mod names-after-admin.png

After clicking the "Show Mods" Button
Here's how an admin program footer might look after the button is clicked. The version of each mod is shown, and each mod name is a hyperlink to the mod's Wiki article.

Show mod names-after-expanded.png

Hovering over a Mod Name
As you mouse over one of the mod names, you can see
  1. The hyperlink to the mod's Wiki page, and
  2. The mod's Title text, which lists the files that the mod edits, and possibly the PHP function(s) within a file.

Show mod names-after-mouseover.png
There are two pop-ups in the illustration just above,

  1. The address of the target page (i.e. the mod's Wiki article) on the left, and
  2. The list of files affected by the mod and used by this program:
    • admin_gedimport.php,
    • gedimport_misc.php,
    • The function ClearData in gedimport_trees.php.

Remember that the selected mod might modify other TNG files, but if those files are not used by the running program, then Show Mod Names won't know anything about them and won't list them.

Programmer Documentation

(See the Wiki article Show Mod Names Programmer Documentation.)

Revision History

Mod Version TNG Versions Date Note
v10.0.0.5 12.0-12.2+ 28 Sep 2019
  • No functional changes; brought into compliance with TNGv12
  • Changed the name of the installed file to be consistent with my naming convention.
  • Updated the search text for location 1 of genlib.php because of a TNGv12 change.
v10.0.0.4 12.0-12.0.2+ 25 Oct 2018 Brought into compliance with TNGv12, and changed the named of the installed file to be consistent with my naming conventions.
v10.0.0.3b 10.0-11.1.2 11 Jan 2018 Removed the second line from the cust_text.php target location search string
10.0.0.3 10.0-11.0.1 18 Jul 2016 The "Show Mods" button does not print, since it is superfluous when printed. Also tweaked the style classes added to genstyle.css so that I could use them in other mods.
10.0.0.2a 10.0-11.0 20 Mar 2016 Tested in TNGv11 and fixed a couple of glitches - It wouldn't display, hide, and then display the mod names again, and there was a possible inaccurate warning message.
10.0.0.2 10.0-10.1.3 13 Feb 2016 Completely rewritten to use an include file (and include_once), to write the mod names to an HTML comment in most case, and to require the installation of Show Mod Names
10.0.0.1 10.0-10.1.3 6 Dec 2015 New mod.

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
The Roy Family Rob Roy Public. Used to assist developers with installed Mods using this tool. 12.0.0.4 12.1 EN
Wamp Server Brett McPhee Test install TNG v12.2. Used to identify Mods actually affecting a page. 12.0.0.5 12.2 EN
Woking Family Tree Project Pete Smee Public/Private v12.0.0.4 v12.1 English
Our Family Histories Bryan S. Larson Public - T8 customized see here see here EN