Difference between revisions of "Burial Website Media Import"

From TNG_Wiki
Jump to navigation Jump to search
Line 278: Line 278:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
=== Example Custimization ===
 +
<syntaxhighlight lang="php" enclose="div">
 +
// Mod: Burial Website Media Import
 +
$text['BWMI_web']['GTNL']['enable']  = 1;        // Enable 'graftombe.nl'
 +
$text['BWMI_web']['GTNL']['event']  = 'death';  // Look in Death field for citations for this website
 +
$text['BWMI_web']['BGPNL']['enable'] = 1;        // Enable 'online-begraafplaatsen.nl'
 +
$text['BWMI_web']['BGPNL']['event']  = 'death';  // Look in Death field for citations for this website
 +
$text['BWMI_web']['FAG']['enable']  = 0;        // Disable 'Find A Grave'
 +
$text['BWMI_web']['BG']['enable']    = 0;        // Diable 'Billion Graves'
 +
</syntaxhighlight>
 
==In the event of a problem with your TNG site==
 
==In the event of a problem with your TNG site==
  

Revision as of 13:58, 11 October 2014

Burial Website Media Import
Summary Adds Find-A-Grave and BillionGraves external media links to burials with burial Source/Citations that reference a Find-A-Grave Memorial or BillionGraves record.
Validation Admin application not validated.
Mod Updated {{{mod_last_update}}}
Download link for
TNG 10.0
TNG 9.0
burial_website_media_import_v9.0.0.3.zip
Download stats
Author(s) Wendel Voigt
Homepage Burial Website Media Import
Mod Support TNG Forums
Contact Developer My Mod Support
Latest Mod 9.0.0.3 for TNG V9 and up
Min TNG V 9.0.0
Max TNG V 10.0.0+
Files modified
Related Mods
none
Notes


Introduction

Inspired by Linking_To_Find_A_Grave but not inspired enough to individually add all the links by hand, I wanted an easier way to add Find A Grave external media links to burial events. Since I was already adding Find A Grave Source/Citations to individuals, I focused on using the burial citations to automatically add the Find A Grave links. Since the introduction of this mod, it has been expanded to include BillionGraves records as well. This mod does the following:

  • Adds a custom 'Find A Grave' media type if it does not already exist
  • Adds a custom 'Billion Graves' media type if it does not already exist
  • For each website ('findagrave.com' and 'billiongraves.com')
    • Searches through all the burial events looking for Source/Citations that contain the webite address (i.e., 'findagrave.com' or 'billiongraves.com'). This can be in the Source or the Citation and is not case sensitive.
    • For each of those found, look for a Memorial/Record number in the burial Citation. If found, go to the website, get the page, and extract the title. Then either add or update the media with the information and make sure it is linked to the person's burial event.

To use this mod, go to 'Administration', then 'Import/Export', then 'Secondary Processes' tab and finally click the 'Burial Website Media Import' button.

Source / Citations Requirements

  1. The Source/Citation must be attached to a Burial.
  2. The Source or Citation must include the keywords 'findagrave.com' or 'billiongraves.com'. The following fields are examined:
    1. Source Long Title
    2. Source Short Title
    3. Source Publisher
    4. Source Actual Text
    5. Source Call Number
    6. plus the citation fields below
  3. The Citation must included a recognized Memorial or Record Number. The following fields are examined:
    1. Citation Page
    2. Citation Actual Text
    3. Citation Note
    4. Citation Description

Recognized Memorial or Record Numbers

The Memorial numbers recognized automatically in the Citation can take the following forms:

  1. GRid=<digits> // as found in a Find A Grave URLs
  2. /record/<chars>/<digits> // as found in a BillionGraves URLs
  3. Memorial <number> <digits> // all case insensitive with zero or more spaces between the parts
  4. Record <number> <digits> // all case insensitive with zero or more spaces between the parts

where:

  • <digits> = one or more numbers 0 to 9. This is assumed to be the Find A Grave memorial number or the BillionGraves record number.
  • <number> = #, number, nummber, nr, nr., nbr, nbr., no, no., or blank/nothing/empty. Case Insensitive.
  • <chars> = one or more characters a to z and A to Z with no spaces

Examples of recognized Memorial Numbers:

www.findagrave.com/cgi-bin/fg.cgi?page=gr&GRid=122620107
billiongraves.com/pages/record/number/122620107
Memorial #122620107
Memorial 122620107
Memorial No. 122620107 
memorial     no.     122620107
MeMoRiAl#122620107
record    122620107
Record   Nbr 122620107
ReCoRd   Number122620107

and remember, either in the Source or in the Citation the keyword 'findagrave.com' or 'billiongraves.com' (case insensitive) needs to be found. Examples include:

Findagrave.com
FindAGrave.com
www.BILLIONGRAVES.com
www.billiongraves.com
www.findagrave.com/cgi-bin/fg.cgi?page=gr&GRid=122620107
billiongraves.com/pages/record/number/122620107

NOTE: Simply having the URL to a specific Find-A-Grave Memorial or BillionGraves Record in one of the Citation fields (e.g., Page or Note) will satisfy all the criteria for detection.

Requirements

  • A working TNG installation. This mod was initially tested on TNG Versions 9.2.2 and 10.0.3.
  • An installed current version of the Mod Manager.

Revision History

Version Date Contents
V9.0.0.3 11 October 2014
  • Changed the website specific items into the $text['BWMI_web'] array. This will allow for easier user addition of other websites.
  • Added unique site matching parameters for matching record numbers in URLs, the terms for Records, Numbers, and Number abbreviations.
  • Gave many common website parameters most often used defaults.
  • Added the ability to disable a website.
  • Added Dutch sites graftombe.nl and www.online-begraafplaatsen.nl as example, but default is disabled.
  • Moved Success or Fail message to the beginning of the line to make it easier to sort afterwards.
  • Added media "Owner" as the website name.
  • Added logging to {mod directory}/burial_website_media_import/log.txt. Can be disabled.
  • Bug fix: now handles cases where the media is used by more than one person.

burial_website_media_import_v9.0.0.3.zip

V9.0.0.2 10 September 2014
  • Made sure external source was checked for all versions of TNG (was only below v 10.0.3 in previous versions)
  • Added $text['BWMI_NewWindow'] = 1 (default). 1=open link in new window. 0=open in existing window.
  • Added lat/lng information from BillionGraves to media (experimental).
  • Added default values to more media fields. abspath, alwayson, status. This Fixed compatibility problem with Submit Headstone Photo Mod.
  • Changed mediatype liketype field to be 'headstones' instead of 'photos' (experimental).

burial_website_media_import_v9.0.0.2.zip

V9.0.0.1 08 September 2014
  • Renamed to Burial Website Media Import.
  • Added support for BillionGraves.com
  • Changed collection type icon to be the same as headstones
  • Changed media thumbnail to a small version of the website icon
  • Changed the findagrave icon
  • Added more ways to get to website depending upon system setup. First tries curl, then file_get_contents, then provides an error if those do not work.

burial_website_media_import_v9.0.0.1.zip

V9.0.0.0 06 September 2014
  • Original version called Findagrave Media Link Import.

findagrave_import_v9.0.0.0.zip

Automated Installation

For TNG V9 and above

TNG version: 9.0
  1. Download the appropriate zip file from the Mod Summary in the upper right hand corner
  2. After downloading the zip file, unzip it into your mods folder
  3. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files to install the living_flag_backup.cfg.

Upgrade to new version

  1. In the Mod Manager, uninstall the Mod
  2. Install the new version of the mod using the Automated Install procedure

Visual of mod

A typical burial field on a person's page before the mod. Burial Website Media Import


The same burial field on a person's page after the Find A Grave media has been added. Burial Website Media Import


The addition of the 'Find-A-Grave Import' button on the Import/Export >> Secondary Processes menu. Burial Website Media Import


Example lists of the new media imported by the mod. Note the use of the Collection name to narrow down the list of media displayed. Burial Website Media Import Burial Website Media Import

Custimization

Note the items below already have the default values shown included in the mod. No changes are automatically made to English/cust_text.php or English-UTF8/cust_text.php. But if you want to make changes to the behavior of the mod or to the language, you can manually add these to your customconfig.php file or if you prefer, your language/<language>/cust_text.php file. You only need to add entries that you want to change.

Burial Website Definition

// Find A Grave
$text['BWMI_web']['FAG']['name']           = 'Find A Grave';             // Name of website
$text['BWMI_web']['FAG']['search']         = 'FindAGrave.com';           // Primary search - case does not matter
$text['BWMI_web']['FAG']['url']            = "http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GRid=%s";
$text['BWMI_web']['FAG']['title']          = 'Find A Grave Memorial';    // Default title if can't get real one
$text['BWMI_web']['FAG']['thumb']          = 'findagrave_small.png';     // Displays on Media list
$text['BWMI_web']['FAG']['type_thumb']     = 'findagrave.png';}          // Displays on getperson
$text['BWMI_web']['FAG']['match_url']      = "[?&]GRid=";                // record prefix in URL
$text['BWMI_web']['FAG']['type_ID']        = 'findagrave';
    
// Billion Graves
$text['BWMI_web']['BG']['name']            = 'Billion Graves';           // Name of website
$text['BWMI_web']['BG']['search']          = 'BillionGraves.com';        // Primary search - case does not matter
$text['BWMI_web']['BG']['url']             = "http://billiongraves.com/pages/record/number/%s";
$text['BWMI_web']['BG']['title']           = 'BillionGraves Record';     // Default title if can't get real one
$text['BWMI_web']['BG']['thumb']           = 'billiongraves_small.png';  // Displays on Media list
$text['BWMI_web']['BG']['type_thumb']      = 'billiongraves.png';        // Displays on getperson
$text['BWMI_web']['BG']['match_url']       = "/record/[a-zA-Z]+/";       // record prefix in URL
$text['BWMI_web']['BG']['type_ID']         = 'billiongraves';
    
// graftombe.nl
$text['BWMI_web']['GTNL']['enable']        = 0;                             // Disable by default
$text['BWMI_web']['GTNL']['name']          = 'Graftombe';                   // Name of website
$text['BWMI_web']['GTNL']['search']        = 'graftombe.nl';                // Primary search - case does not matter
$text['BWMI_web']['GTNL']['url']           = "http://graftombe.nl/names/info/%s";
$text['BWMI_web']['GTNL']['title']         = 'Graftombe Graf';              // Default title if can't get real one
$text['BWMI_web']['GTNL']['match_url']     = "/names/info/";                // record prefix in URL
$text['BWMI_web']['GTNL']['match_record']  = "Graf|Grafsteen|id|id-nummber";// record references
$text['BWMI_web']['GTNL']['type_ID']       = 'graftombe';
    
// www.online-begraafplaatsen.nl
$text['BWMI_web']['BGPNL']['enable']       = 0;                              // Disable by default
$text['BWMI_web']['BGPNL']['name']         = 'Online Begraafplaatsen';       // Name of website
$text['BWMI_web']['BGPNL']['search']       = 'online-begraafplaatsen.nl'     // Primary search - case does not matter
$text['BWMI_web']['BGPNL']['url']          = "http://www.online-begraafplaatsen.nl/zerken.asp?g=%s"; 
$text['BWMI_web']['BGPNL']['title']        = 'Online Begraafplaatsen Graf';  // Default title if can't get real one
$text['BWMI_web']['BGPNL']['match_url']    = "[?&]g=";                       // record prefix in URL
$text['BWMI_web']['BGPNL']['match_record'] = "Graf|Grafsteen|id|id-nummber"; // record references 
$text['BWMI_web']['BGPNL']['type_ID']      = 'begraafplaatsen';

// Default setting for all websites. Only need to add to definition if different.
$text['BWMI_web']['x']['enable']        = 1;
$text['BWMI_web']['x']['event']         = 'BURI';  // Event Type:  Burial = 'BURI' or 'Burial';  Death = 'DEAT' or 'Death'
$text['BWMI_web']['x']['match_url']     = "[?&]GRid=|/record/[a-zA-Z]+/";
$text['BWMI_web']['x']['match_record']  = "Memorial|Record|Item";
$text['BWMI_web']['x']['match_number']  = "number|nummer";
$text['BWMI_web']['x']['match_numabbr'] = "nr|nbr|no|n";
$text['BWMI_web']['x']['type_ordernum'] = 0 ;
$text['BWMI_web']['x']['type_path']     = 'img';
$text['BWMI_web']['x']['type_liketype'] = 'headstones';
$text['BWMI_web']['x']['type_form']     = 'html';
$text['BWMI_web']['x']['type_display']  =  $text['BWMI_web']['x']['name'];    // Default to the same as name
$text['BWMI_web']['x']['type_icon']     = 'img/tng_hs.gif';                 // Displays on menu pulldown
$text['BWMI_web']['x']['type_thumb']    = 'tombstone_color_small.png';      // Displays on getperson
$text['BWMI_web']['x']['thumb']         = 'tombstone_color_small.png';      // Displays on Media list
$text['BWMI_web']['x']['exportas']      =  $text['BWMI_web']['x']['type_ID']; // Default to the same as type_ID
$text['BWMI_web']['x']['type_disabled'] =  0 ;

// Required settings for each website
$text['BWMI_web']['x']['name']            = 'Web Site Name';                             // Name of website
$text['BWMI_web']['x']['search']          = 'website.com';                               // Primary search - case does not matter
$text['BWMI_web']['x']['url']             = "http://website.com/pages/record/number/%s"; // %s is for record number
$text['BWMI_web']['x']['title']           = 'Website Record';                            // Default title if can't get real one
$text['BWMI_web']['x']['type_ID']         = 'website';                                   // Unique name (no spaces)

Various Constants

$text['BWMI_NewWindow']      = 1; // 1 = open link in new window, 0 = use same window
$text['BWMI_log']            = 1; // 1 = log to {mods directory}/burial_website_media_import/log.txt, 0 = do not log
                                  // Only change these if you are having trouble getting to websites.
$text['BWMI_connecttimeout'] = 5; // Connection timeout in seconds to the website.
$text['BWMI_timeout']        = 4; // Page timeout in seconds to load a web page.

Text

$text['BWMI_txt_eol']          = "\r\n";
$text['BWMI_txt_exists']       = "Media type '%s' already exists.  No need to add.";
$text['BWMI_txt_insert']       = "Media type addition of '%s' %s.";
$text['BWMI_txt_look']         = "Examine all %s ('%s') citations...";
$text['BWMI_txt_noID']         = "No Memorial or Record found in the citation.";
$text['BWMI_txt_record']       = "Person:%s/%s, Citation:%s, ";
$text['BWMI_txt_data']         = "Web:(%s) '%s'";
$text['BWMI_txt_timeout']      = "Web:(%s) WEBSITE ERROR %s: %s";
$text['BWMI_txt_media']        = "mediaID:%s %s, medialinkID:%s %s, ";
$text['BWMI_txt_results']      = "%s: %s";
$text['BWMI_txt_succeeded']    = 'SUCCESS';
$text['BWMI_txt_failed']       = 'FAILED';
$text['BWMI_txt_warning']      = 'WARNING';
$text['BWMI_txt_updated']      = 'updated';
$text['BWMI_txt_update_error'] = 'update Error';
$text['BWMI_txt_added']        = 'added';
$text['BWMI_txt_add_error']    = 'add Error';
$text['BWMI_txt_nochange']     = 'no change';
$text['BWMI_txt_errors0']      = "had no errors";
$text['BWMI_txt_errors1']      = "had trouble with getting website information";
$text['BWMI_txt_errors2']      = "had trouble with the TNG database";
$text['BWMI_txt_errors3']      = $text['BWMI_txt_errors1']." and ".$text['BWMI_txt_errors2'];
$text['BWMI_txt_errsummary']   = "SUMMARY: Citations:%s, Media Adds:%s, Media Updates:%s, Media Errors: %s, MediaLink Adds:%s, MediaLink Updates:%s, MediaLink Unchanged:%s, MediaLink Errors:%s, Website Errors:%s";

Example Custimization

// Mod: Burial Website Media Import
$text['BWMI_web']['GTNL']['enable']  = 1;        // Enable 'graftombe.nl'
$text['BWMI_web']['GTNL']['event']   = 'death';  // Look in Death field for citations for this website
$text['BWMI_web']['BGPNL']['enable'] = 1;        // Enable 'online-begraafplaatsen.nl'
$text['BWMI_web']['BGPNL']['event']  = 'death';  // Look in Death field for citations for this website
$text['BWMI_web']['FAG']['enable']   = 0;        // Disable 'Find A Grave'
$text['BWMI_web']['BG']['enable']    = 0;        // Diable 'Billion Graves'

In the event of a problem with your TNG site

  1. Try using the Mod Manager to remove the mod
  2. copy your backup admin_secondmenu.php and admin_secondary.php files

Removal of the media is a manual process. But it is not too difficult. For example, to remove the 'Find A Grave' media:

  1. In administration, go to Media
  2. Set the Collection to 'Find A Grave'
  3. You can now click 'Select All' followed by 'Delete Selected' to remove the new media. Repeat for each page of 'Find A Grave' media.
  4. To remove the 'Find A Grave' media type, simply click on 'Delete' once you set the Collection to 'Find A Grave'

Developer

This mod was developed by Wendel Voigt

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
VoigtWorld.com ... Wendel is the developer of the Burial Website Media Import Mod 9.0.0.2 9.2.2 English
BradyFamilyTree.org ... Western Australia 9.0.0.2 10.0.0.3 English
Sorenson-Robey.org ... United States of America 9.0.0.2 9.1.1 English
Mitchell Families Online ... A great mod, very well though out! 9.0.0.2 10.0.3 English

Related Links

TNG Modules Involved

In TNG V9 and above, this mod modifies the following files:

  • admin_secondmenu.php
  • admin_secondary.php files