Difference between revisions of "TNG Mod Manager"

From Genwiki

Jump to: navigation, search
m
m
Line 45: Line 45:
 
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.
 
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.%
 
  
%target:filename_to_change.php%
+
%name:Insert Mod Title Here%
%location:%
+
%version:V1.0%
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.
+
  %description:Insert the description of your mod hereInclude any special notes or even links to your support page.%
%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:%
+
%end:% 
+
  
 +
%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.
 +
%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:%
 +
%end:% 
  
%newfile:placesearchform.php%
+
 
%fileversion:2.0%
+
%newfile:placesearchform.php%
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.
+
%fileversion:2.0%
// New File Contents
+
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.
// More Comments
+
// New File Contents
// %version:2.0%
+
// More Comments
Code
+
// %version:2.0%
Code
+
Code
%fileend:%
+
Code
 +
%fileend:%

Revision as of 21:51, 22 March 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. 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 1.0 Mar 28 2009 - Beta Release to small user group
  • Rev 0.0 Mar 21 2009 - Pre-Release Testing
  • Rev A.0 Mar 20 2009 - Dev Testing


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:

  • ensure 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 indentified, then the option to install is presented
  • if the mod is completely installed, the option to remove the Mod is presented
  • 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

  • Download the current version of the Mod Manager from Mod_Manager_V1.0.zip
  • Unzip the archive and examine the contents.
  • Extract the manage_mods.php script and copy it to your TNG admin folder
  • Create a new sub folder in the TNG admin folder and name it "mod_folder"
  • Extract the Manage_Mods_Ver.cfg configuration file and copy it 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.


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.%
%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.
%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:%
%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:%
Personal tools