This is a TNG mod directive file
%name:Gedcom Converter%
%version:13.0.0.16%
%description: Installs a program in the Admin >> Import/Export menu that reads a Gedcom file,
and saves modifications in a new Gedcom file.
The converter has numerous options to convert Gedcom data, and even aspects of the structure of a Gedcom file.
It does not use the TNG database, and thus should be compatible with any version of TNG above TNG12.
%
%wikipage:Gedcom_Converter%
%author:Robin Richmond:https://tng.lythgoes.net/wiki/index.php?title=User:Robinrichm%
*************** Revision History ****************
v13.0.0.15 24 Sep 2020
# Handled three underlying TNGv13 code changes, including the new functions to start and end the <body> of the new pages.
# Upgraded to my TNGv13 Inner Mod Menus mod
********************************************************************
*** See program documentation and additional revision history in readme.php in the mod subfolder ***
********************************************************************
To Do
- To merge duplicate citations, we need a gedcom option, and completion of code that
- grabs media object IDs from the citation being deleted,
- takes those object IDs and adds them to the citation being kept
- looks up the current source record in the dictionary of source records
*********************************************************************
*********************************************************************
%target:admin_dataimport.php%
*************** admin_dataimport.php Location 1 - Top-of-file comments
%location:%
include("begin.php");
%end:%
%insert:before%
##### admin_dataimport.php, modified by ###Gedcom Converter, by Robin Richmond
# Changes the internal tabs to start with a new tab that invokes the Gedcom converter,
# and adds a default value to the server-side filename form parameter, based on a new
# querystring parameter, "serverfilename"
$tngModNames['Gedcom Converter']['admin_dataimport.php'] = '16'; #"Register" the mod
#############################################################################
%end:%
******* admin_dataimport.php Location 2 - Add a tab that invokes the Gedcom converter.
%location:%
$datatabs['0'] = array(1,"admin_dataimport.php",$admtext['import'],"import");
%end:%
%insert:before%
###Gedcom Converter Location 2: Add a tab that invokes the Gedcom Converter, and flag it as new
if (file_exists("rrinnermodmenu_newtab.php"))
include_once('rrinnermodmenu_newtab.php');
elseif (!function_exists('rrimmNewTab')) {function rrimmNewTab($modname){} }
$datatabs['rr-gc'] = array(1, "rrgedcomconverter_form.php", $admtext['rrgc-convert'].rrimmNewTab('Gedcom Converter'), "convert");
###Gedcom Converter Location 2: End of insertion
%end:%
******* admin_dataimport.php Location 3 - Add the new querystring parameter 'serverfilename' as a default for the server filename form field
*** Code fragment replaced with multiple lines, with an HTML comment
%location:%
database" size="50">
%end:%
%trimreplace:%
database" size="50"
value="<?php echo $_GET['serverfilename']; ?>">
<!-- ###Gedcom Converter Location 3: New default value from querystring -->
%end:%
*************** admin_dataimport.php Location 4 - Display mod names
%location:%
</tr>
</table>
</form>
%end:%
%insert:after%
<?php ###Gedcom Converter Location 4: Show Mods
if (file_exists('rrshowmodnames_include.php')) include_once ('rrshowmodnames_include.php');
?>
%end:%
*********************************************************************
*********************************************************************
%target:admin_export.php%
*************** admin_export.php Location 1 - Top-of-file comments
%location:%
include("begin.php");
%end:%
%insert:before%
##### admin_export.php, modified by ###Gedcom Converter, by Robin Richmond
# Changes the tab menu to start with a new tab that invokes the Gedcom converter,
$tngModNames['Gedcom Converter']['admin_export.php'] = '16';
#############################################################################
%end:%
******* admin_export.php Location 2 - - Add a tab for the Gedcom Converter
%location:%
$datatabs[0] = array(1,"admin_dataimport.php",$admtext['import'],"import");
%end:%
%insert:before%
###Gedcom Converter Location 2: Add a tab that invokes the Gedcom Converter, and flag it as new
if (file_exists("rrinnermodmenu_newtab.php"))
include_once('rrinnermodmenu_newtab.php');
elseif (!function_exists('rrimmNewTab')) {function rrimmNewTab($modname){} }
$datatabs['rr-gc'] = array(1, "rrgedcomconverter_form.php", $admtext['rrgc-convert'].rrimmNewTab('Gedcom Converter'), "convert");
###Gedcom Converter Location 2: End of insertion
%end:%
*************** admin_export.php Location 3 - Display mod names
%location:%
</td>
</tr>
</table>
%end:%
%insert:after%
<?php ### Gedcom Converter Location 3: Show Mods
if (file_exists('rrshowmodnames_include.php')) include_once ('rrshowmodnames_include.php');
?>
%end:%
*********************************************************************
*********************************************************************
%target:admin_gedimport.php%
*** The program that executes an import and shows the results
*************** admin_gedimport.php Location 1 - Top-of-file comments
%location:%
@ini_set( "magic_quotes_runtime", "0" );
%end:%
%insert:before%
##### admin_gedimport.php, modified by ###Gedcom Converter, by Robin Richmond
# Changes the tab menu to start with a new tab that invokes the Gedcom converter "kickoff form".
$tngModNames['Gedcom Converter']['admin_gedimport.php'] = '16';
#############################################################################
%end:%
******* admin_gedimport.php Location 2 - Add a tab that invokes the Gedcom converter.
%location:%
$datatabs['0'] = array(1,"admin_dataimport.php",$admtext['import'],"import");
%end:%
%insert:before%
###Gedcom Converter Location 2: Add a tab that invokes the Gedcom Converter, and flag it as new
if (file_exists("rrinnermodmenu_newtab.php"))
include_once('rrinnermodmenu_newtab.php');
elseif (!function_exists('rrimmNewTab')) {function rrimmNewTab($modname){}}
$datatabs['rr-gc'] = array(1,"rrgedcomconverter_form.php",$admtext['rrgc-convert'].rrimmNewTab('Gedcom Converter'),"convert");
###Gedcom Converter Location 2: End of insertion
%end:%
*************** admin_gedimport.php Location 3 - Display mod names
%location:%
echo "</div></div>\n";
%end:%
%insert:after%
###Gedcom Converter Location 3: Show Mod Names
if (file_exists('rrshowmodnames_include.php')) include_once ('rrshowmodnames_include.php');
%end:%
*********************************************************************
*********************************************************************
%target:admin_secondary.php%
*** The program that executes a secondary process and shows the results.
*************** admin_secondary.php Location 1 - Top-of-file comments
%location:%
include("begin.php");
%end:%
%insert:before%
##### admin_secondary.php, modified by ###Gedcom Converter, by Robin Richmond
# Adds a Gedcom Converter tab at the beginning of the tab menu
$tngModNames['Gedcom Converter']['admin_secondary.php'] = '16';
#############################################################################
%end:%
******* admin_secondary.php Location 2 - Add a tab that invokes the Gedcom converter.
%location:%
$datatabs[0] = array(1,"admin_dataimport.php",$admtext['import'],"import");
%end:%
%insert:before%
###Gedcom Converter Location 2: Add a tab that invokes the Gedcom Converter, and flag it as new
if (file_exists("rrinnermodmenu_newtab.php"))
include_once('rrinnermodmenu_newtab.php');
elseif (!function_exists('rrimmNewTab')) {function rrimmNewTab($modname){} }
$datatabs['rr-gc'] = array(1, "rrgedcomconverter_form.php", $admtext['rrgc-convert'].rrimmNewTab('Gedcom Converter'), "convert");
###Gedcom Converter Location 2: End of insertion
%end:%
*************** admin_secondary.php Location 3 - Display mod names
%location:%
echo tng_adminfooter();
%end:%
%insert:before%
###Gedcom Converter Location 3: Show Mods
if (file_exists('rrshowmodnames_include.php')) include_once ('rrshowmodnames_include.php');
%end:%
*********************************************************************
*********************************************************************
%target:admin_secondmenu.php%
*** The menu for secondary processes
*************** admin_secondmenu.php Location 1 - Top-of-file comments
%location:%
include("begin.php");
%end:%
%insert:before%
##### admin_secondmenu.php, modified by ###Gedcom Converter, by Robin Richmond
# Changes the internal tabs to start with a new tab that invokes the Gedcom converter,
$tngModNames['Gedcom Converter']['admin_secondmenu.php'] = '16';
#############################################################################
%end:%
******* admin_secondmenu.php Location 2 - Add a tab for the Gedcom Converter
%location:%
$datatabs[0] = array(1,"admin_dataimport.php",$admtext['import'],"import");
%end:%
%insert:before%
###Gedcom Converter Location 2: Add a tab that invokes the Gedcom Converter, and flag it as new
if (file_exists("rrinnermodmenu_newtab.php"))
include_once('rrinnermodmenu_newtab.php');
elseif (!function_exists('rrimmNewTab')) {function rrimmNewTab($modname){} }
$datatabs['rr-gc'] = array(1, "rrgedcomconverter_form.php", $admtext['rrgc-convert'].rrimmNewTab('Gedcom Converter'), "convert");
###Gedcom Converter Location 2: End of insertion
%end:%
*************** admin_secondmenu.php Location 3 - Display mod names
%location:%
</td>
</tr>
</table>
%end:%
%insert:after%
<?php ###Gedcom Converter Location 3: Show Mods
if (file_exists('rrshowmodnames_include.php')) include_once ('rrshowmodnames_include.php');
?>
%end:%
*********************************************************************
*********************************************************************
%target:languages/English/cust_text.php%
%location:%
//Mods should put their changes before this line, local changes should come after it.
%end:%
%insert:before%
###########################Gedcom Converter: new strings
$admtext['rrgc-convert'] = "Gedcom Converter"; #New tab in Import/Export programs
$admtext['rrgc-modfolder'] = "gedcom_converter_v13.0.0.16"; #New tab in Import/Export programs
###########################Gedcom Converter: End of new strings
%end:%
*********************************************************************
*********************************************************************
%target:languages/English-UTF8/cust_text.php%
%location:%
//Mods should put their changes before this line, local changes should come after it.
%end:%
%insert:before%
###########################Gedcom Converter: new strings
$admtext['rrgc-convert'] = "Gedcom Converter"; #New tab in Import/Export programs
$admtext['rrgc-modfolder'] = "gedcom_converter_v13.0.0.16"; #New tab in Import/Export programs
###########################Gedcom Converter: End of new strings
%end:%
***************************************************************************
***************************************************************************
%target:files%
1. Kickoff form - displays options and launches the converter.
%copyfile:gedcom_converter_v13.0.0.16/rrgedcomconverter_form.php%
2. Program to do the converting
%copyfile:gedcom_converter_v13.0.0.16/rrgedcomconverter.php%
3. Ajax program to save modified options to the config file.
%copyfile:gedcom_converter_v13.0.0.16/rrgedcomconverter_saveoptions.php%
4. Help file linked from the innermenus of rrgedcomconverter_form.php and gedcom2thg.php.
%copyfile2:gedcom_converter_v13.0.0.16/languages/English/rrgedcomconverter_help.php:languages/English/rrgedcomconverter_help.php%
5. Image file used by the help file to show what the Placename Formatting form would look like.
%copyfile2:gedcom_converter_v13.0.0.16/languages/English/rrgedcomconverter_placeoptions.jpg:languages/English/rrgedcomconverter_placeoptions.jpg%
6. Configuration file for the Gedcom Converter options.
(Note that a second config file installed by the Place Name Format mod defines
initial values for the Place Name Formating options.)
%copyfile2:gedcom_converter_v13.0.0.16/extensions/rrgedcomconverter_config-distrib.php:$extspath/rrgedcomconverter_config-distrib.php%
7. Include file that defines a PHP class that copies a selected home computer file to the server for reading.
It is used to read and upload a Gedcom file that is stored on the user's home computer.
%copyfile2:gedcom_converter_v13.0.0.16/extensions/upload.class.php:$extspath/upload.class.php%
8. Configuration file that determines how INDI and FAM level 1 tags will be processed.
There is no program to edit this file. If it must be edited, it must be edited by hand.
%copyfile2:gedcom_converter_v13.0.0.16/extensions/rrgedcomconverter_tagsconfig.php:$extspath/rrgedcomconverter_tagsconfig.php%
*** The mod's subfolder has a "languages" folder with a file that defines language strings.