Age Calculation Mod

From TNG_Wiki
Revision as of 10:43, 30 October 2010 by Ojay (talk | contribs) (→‎Sites using this mod: TNG-Version changed)
Jump to navigation Jump to search
Age Calculation Mod
Summary Adds the age of a person to the Individual page
Validation {{{mod_validation}}}
Mod Updated {{{mod_last_update}}}
Download link age_calculation_v8.1.3.zip for TNG V8.0.1
age_calculation_v8.1.2.zip for TNG V8.0.0
age_calculation_tng7_v1.4.zip for TNG 7
age_calculation_tng6_v1.2.zip for TNG 6
Download stats {{{download_stats}}}
Author(s) Leon Hassing
Config File for TNG V7 was created by Ken Roy and for TNG V6 by Leon Hassing.
Homepage Age Calculation Mod (This page)
Mod Support TNG Forums
Contact Developer {{{mod_contact}}}
Latest Mod 8.1.0 for TNG V8
1.4
Min TNG V 6.0.0
Max TNG V 8.0.0
Files modified
getperson.php
Related Mods
Notes
Both mods can now be installed independently of each other. However, if you are using both mods, you must install the Event Map add children mod first.


Introduction

This TNG modification will calculate and display the age on the Individual (getperson.php) page

  • at death for all deceased persons
  • to current date for all living individuals when the user is allowed to view information on living individuals.

The mod adds a new Age row to the primary individual and shows the age in parentheses for other persons on the Indivual page as shown in the Visualization of this mod

The mod can be installed, using a different version of the config file, on:

  • TNG V8
  • TNG V7 (7.0.0 through 7.1.2) and
  • TNG V6 (tested by Leon on versions 6.2.0, 6.1.3 and 6.0.0.).

Manual install of the mod is documented on Heinz web site.

Note that the Age Calculation Mod and the Event Map add children mod, both modify the same query, therefore there is a restriction on the order of installation and removal of the mod.

Note that even if a person is deceased, if the living flag is set, the age will be calculated to current date. This is not a problem. The living flag takes precedence over the death date. If profiles have no date of death and the living flag is not set, the age-field is not displayed.

Rules for Age Display

These are the rules for displaying the age:

  • When the death date is not filled in and the person has an indication "Not living" then nothing is displayed.
  • When the death date is not filled in and the person has an indication "Living" then the age is not calculated when the user is not logged in (depends on : "show living data" settings in privacy tab)
  • When the user has logged in then the age will be displayed, where the age is the age he/she has today.

The living tag is filled (when no death date present) according the setup in the administration: Import settings, "If no death date, assume deceased if older than xxxx". (Rules provided by Leon on User2 list on 26 Sep 2010)


Developer

Mod developer is Leon Hassing.

Config File for


Revision History

Version Date Contents
v8.1.3_mod Download 22 August 2010 deleted commas in the children line, see thread in the mailing-list
v8.1.3 25 July 2010 update for TNG V8.0.1 originally provided by Joerg Baum
v8.1.2 1 July 2010 updated addition.php portion of the config file to use quoted variables as used by TNG V8
fixed formatting of child descendant indicator
v8.1.1 29 May 2010 updated addition.php portion of the config file to get images from new TNG img/ folder
Note that addition.php still requires update to use quoted variables as used by TNG V8
v8.1.0 24 May 2010 updated config file to remove blank after ($age) parameter since change was dropped in V1.3.

V1.4 config file updated by Ken Roy for TNG V8

v1.4 11 April 2010 updated config file to remove blank after ($age) parameter since change was dropped in V1.3.

V1.4 config file updated by Ken Roy for TNG V8

v1.3 24 September 2009 config file updated by Leon Hassing so that it can be installed independently of the Event Map add children mod
v1.2 23 September 2009 updated config file to remove blank after ($age) parameter
v1.1 19 September 2009 original Mod Manager config file

Requirements

  • A working TNG installation.
  • A backup of your TNG getperson.php and language cust_text.php files.
  • An installed current version of the Mod Manager.

Restriction

Note that the Age Calculation Mod and the Event Map add children mod, both modify the same query. Both mods can now be installed independently of each other.

However, if you are using both mods, you must install the Event Map add children mod first. Mods must be removed in the reverse order, of course.

Behavior

Note that even if a person is deceased, if the living flag is set, the age will be calculated to current date. This is not a problem. The living flag takes precedence over the death date.

Automated Install

  1. Download the appropriate config file for your version of TNG as shown in the summary in the upper right hand corner
  2. Extract the appropriate zip file in your TNG admin/mod_folder (TNG V7 and V6) or mods (TNG V8)
  3. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files to install the appropriate config file.

Custom Text Additions

Note that for TNG V8 the config file includes the changes for the languages/English and languages/English-UTF8 folders.

Note that config file only includes the English language changes, so if you support multiple languages you will need to modify the config file to add the custom text for those other languages, or manually add the $text['years'] to the cust_text.php for all the languages you are using.

The following custom text will be added to your English/cust_text.php file by this mod. If you are using other languages, you must add these lines to each of your language cust_text.php files with appropriate translations of course.

// Age Calculation Mod text
$text['years'] = "years";

For example, you would add to the French/cust_text.php

// Age Calculation Mod text
$text['years'] = "années"

The translation for $text['years'] can be found in the appropriate language text.php file. The reason it is needed in the cust_text.php is because their is a case assignment to the one in the TNG distributed file.

Other Languages

If you use other languages in addition to English, you either need to modify the config files to include the cust_text.php for those languages, or you need to manually add the $text['years'] to the cust_text.php for all the languages you are using.

The translation for $text['years'] can be found in the appropriate language text.php file. The reason it is needed in the cust_text.php is because their is a case assignment to the one in the TNG distributed file.

Visualization of this mod

The following images show how this mod changes the display of the Individual (getperson.php) page by adding:

  • a new row that displays the individual's age at death or if living the individual's current age for users allowed to view information on living individuals as shown in the image below Age calculation mod row added.jpg
  • the age to the parents, spouse, and children as shown in the image below Age calculation mod spouse age.jpg

Sites using this mod

Please add TNG site that you have found that utilize this modification!

URL User Note Mod-Version/TNG-Version User-language
The Genealogy of the Hassing-family Leon Hassing the mod developer's site ... ...
Our Acadian, French-Canadian, and Maine Ancestors Ken Roy 16:35, 19 September 2009 (UTC) V1.4/TNG 7.1.3 EN, FR
The genealogies of the peat or fen colonies in the provinces of Groningen and Drenthe, Netherlands Henny Savenije ... ... NL
The genealogies of Claret Family, France Gilles Claret ... ... F
Teige-Steinrötter-family Olaf Teige (no public site) V8.1.3_mod/8.0.2 D,(NL),(GB)
Fornal Family Tree Bob Fornal ... V8.1.3/TNG 8.0.1 EN
... ... ... ... ...