Difference between revisions of "TNG Mod Manager"

From Genwiki

Jump to: navigation, search
m
m
Line 80: Line 80:
 
  %target:filename_to_change.php%
 
  %target:filename_to_change.php%
 
  %location:%
 
  %location:%
This must be a unique section of code in the target source file.   
+
  This must be a unique section of code in the target source file.   
If you have a choice, select snippits that are likely to be the  
+
    If you have a choice, select snippits that are likely to be the  
same from TNG version to version.  It is all the code between the %location:%
+
  same from TNG version to version.  It is all the code between the %location:%
and the %end:%.  White space before and after this section will be trimmed
+
  and the %end:%.  White space before and after this section will be trimmed
before trying to locate it in the source file.
+
  before trying to locate it in the source file.
 +
    You may repeat the  %location:% -- %end:%  %insert:before% -- %end:%
 +
  sequences for each segment of code you wish to change in the same target.
 +
    You can also have as many %target% sections as required.
 
  %end:%
 
  %end:%
 
  %insert:before%
 
  %insert:before%
This is the new code that will be inserted immediately before
+
  This is the new code that will be inserted immediately before
the %location:% code.  The directive can be %insert:before%,  %insert:after%, or %replace:%
+
  the %location:% code.  The directive can be %insert:before%,  %insert:after%, or %replace:%
  If code is being replaced in-line and you do not want line breaks to interfere with the code, you can also use the directives  %triminsert:before%,  %triminsert:after%,  %trimreplace:%.
+
   
 +
  If code is being replaced in-line and you do not want line breaks to interfere with the code,  
 +
  you can also use the directives  %triminsert:before%,  %triminsert:after%,  %trimreplace:%.
 
  %end:%   
 
  %end:%   
 
   
 
   

Revision as of 21:21, 27 May 2009

Overview

This TNG Mod Manager is intended to provide a more integrated way to install/remove and manage Modifications to the TNG software package that have been coded to work with this manager. Once installed, it may be connected into the TNG Administrative page for easy access. The Mod Manager consists of a single script that is copied to the TNG admin folder. A sub folder in the TNG admin folder must also be created and is used to contain the Mod configuration files and associated Mod support files.

  • Rev 2.0b May 26 2009 - Correction included for the $$manage_mods_v1.3.cfg file. It was giving an improper error message and would not install
  • Rev 2.0a May 18 2009 - Update to the gendex form mod to include English only.
  • Rev 2.0 May 18 2009 - Upgrades for stability and compatibility and several new keywords
  • Rev 1.0 Apr 26 2009 - Initial public release
  • Rev 0.2 Apr 15 2009 - Continued Testing with small user group, added a parameter editing directive allowing easier customization of mod variables
  • Rev 0.1 Mar 28 2009 - Beta Release to small user group (contact me if you wish to assist with this testing)
  • Rev 0.0 Mar 21 2009 - Pre-Release Testing
  • Rev A.0 Mar 20 2009 - Dev Testing

Screen Shot of the Mod Manager

Operation

The Mod Manager examines the mod_folder and reads each "cfg" file that it finds. The "cfg" files are directive files that describe the mod, the files and locations to be modified, and the code that is used in the modification.

The Mod Manager checks the following:

  • ensures the user is logged in
  • examines each code location and change
    • ensures the location can be found
    • ensures the target location is unique
    • identifies whether the target location has already been installed
  • identifies new files to be created
    • if the new file already exists, it examines the version level
  • if the mod is not yet installed and the target locations can be identified, then the option to install is presented
  • if the mod is completely installed, the option to remove the Mod is presented and the option to edit parameters if any exist
  • if the mod is partially installed, the option to clean the Mod is presented. A Clean operation will attempt to remove any inserted code, restore and replaced code, and remove any created file.

Installation

  1. Download the current version of the Mod Manager from Mod_Manager_V2.0b.zip
  2. Unzip the archive and examine the contents.
  3. Extract the manage_mods.php script and copy it to your TNG admin folder
  4. Create a new sub folder in the TNG admin folder and name it "mod_folder"
  5. Create a new sub folder in the main TNG folder and name it "extensions", ensure it has write permission
  6. Extract the remaining .cfg files and copy them to the mod_folder

Using the Manager

  • The Mod Manager may be called directly via your browser by adding /manage_mods.php to the end of your admin folder url. For example, my site would be "http://genealogy.mcfadyen.ca/admin/manage_mods.php"
  • After running the script for the first time, you should install the $$mod_manager mod, this will create a link to the Mod Manager in the left hand administrative menu and a "Mod Manager" button in the main window menu.


Mod Directive Files

The following Mod Directive Files are available and included in the download zip

  • Gendex Search Form for the Advanced Search Page
  • Place Search Form for the Advanced Search Page
  • Private Notes Display for Administrators
  • Lastname Comma Firstname display format
  • Geocoding Assistant
  • MediaWiki Links


For Mod Developers

Creating Mod Configuration Files

The following outlines a typical configuration file and the associated keywords. Note that the % character is used to assist in delimiting the fields and keywords.


%name:Insert Mod Title Here%
%version:V1.0%
%description:Insert the description of your mod here.
Include any special notes or even links to your support page.
The percent sign marks the end of the description%

%target:filename_to_change.php%
%location:%
  This must be a unique section of code in the target source file.  
    If you have a choice, select snippits that are likely to be the 
  same from TNG version to version.  It is all the code between the %location:%
  and the %end:%.  White space before and after this section will be trimmed
  before trying to locate it in the source file.
    You may repeat the  %location:% -- %end:%  %insert:before% -- %end:%
  sequences for each segment of code you wish to change in the same target.
    You can also have as many %target% sections as required.
%end:%
%insert:before%
  This is the new code that will be inserted immediately before
  the %location:% code.  The directive can be %insert:before%,  %insert:after%, or %replace:%

  If code is being replaced in-line and you do not want line breaks to interfere with the code, 
  you can also use the directives  %triminsert:before%,  %triminsert:after%,  %trimreplace:%.
%end:%  


%newfile:placesearchform.php%
%fileversion:2.0%
This would be the contents of a new file to be created.    
The fileversion above is used to compare against a possible version number
in the newfile if it already exists. The new file contents will be
everything between the %fileversion:$ directive and the %fileend:% directive.
The new file should have a %version:% directive as shown below.
// New File Contents
// More Comments
// %version:2.0%
Code
Code
%fileend:%
%copyfile:new_icon_file.gif%

The %copyfile: directive is used to copy a file from mod_folder to the main TNG folder.

%copyfile2:new_file.gif:extensions\new_file.gif%

The %copyfile2: directive is used to copy a file to an alternate folder.


Additional Directives

  •  %fileoptional:% - used after a %target:% keyword to indicate that if the file does not exist, no error should be generated. This is useful when describing parameters in a file that will be created during the mod
  •  %parameter - see cfg files for examples or contact the author
  •  %desc - see cfg files for examples or contact the author
Personal tools