$fathname"; } else $fatherlink = ""; if( $fathrow[allow_living] ) $fatherlink .= $birthinfo; //CHANGED: 1 line: for determining age father if( ( $fathrow[firstname] || $fathrow[lastname] ) && $fathrow[allow_living] && $age != NULL) $fatherlink .= " ($age ) "; $persontext .= showEvent( array( "text"=>$text[father], "fact"=>$fatherlink ) ); mysql_free_result( $gotfather ); } //CHANGED: 1 line: for determining age mother //$query = "SELECT personID, lastname, lnprefix, firstname, prefix, suffix, nameorder, birthdate, birthplace, altbirthdate, altbirthplace, deathdate, deathplace, burialdate, burialplace, $people_table.living, $people_table.branch FROM $people_table, $families_table WHERE $people_table.personID = $families_table.wife AND $families_table.familyID = \"$parent[familyID]\" AND $people_table.gedcom = \"$tree\" AND $families_table.gedcom = \"$tree\""; $query = "SELECT personID, lastname, lnprefix, firstname, prefix, suffix, nameorder, birthdate, birthdatetr, birthplace, altbirthdate, altbirthplace, altbirthdatetr, deathdate, deathdatetr, deathplace, burialdate, burialdatetr, burialplace, $people_table.living, $people_table.branch FROM $people_table, $families_table WHERE $people_table.personID = $families_table.wife AND $families_table.familyID = \"$parent[familyID]\" AND $people_table.gedcom = \"$tree\" AND $families_table.gedcom = \"$tree\""; $gotmother = mysql_query($query) or die ("$text[cannotexecutequery]: $query"); if( $gotmother ) { $mothrow = mysql_fetch_assoc( $gotmother ); $birthinfo = getBirthInfo( $mothrow ); //CHANGED: 1 line: for determining age mother $age = age ( $mothrow[birthdatetr], $mothrow[birthdate], $mothrow[altbirthdatetr], $mothrow[altbirthdate], $mothrow[deathdatetr], $mothrow[deathdate], $mothrow[burialdatetr], $mothrow[burialdate], $mothrow[living] ); $mothrow[allow_living] = !$mothrow[living] || $livedefault == 2 || ( $allow_living && checkbranch( $mothrow[branch] ) ) ? 1 : 0; if( $mothrow[firstname] || $mothrow[lastname] ) { $mothname = getName( $mothrow ); $motherlink = "$mothname"; } else $motherlink = ""; if( $mothrow[allow_living] ) $motherlink .= $birthinfo; //CHANGED: 1 line: for determining age mother if( ( $mothrow[firstname] || $mothrow[lastname] ) && $mothrow[allow_living] && $age != NULL) $motherlink .= " ($age )"; $persontext .= showEvent( array( "text"=>$text[mother], "fact"=>$motherlink ) ); mysql_free_result( $gotmother ); } if( $row[allow_living] && $parent[relationship] ) $persontext .= showEvent( array( "text"=>$text['relationship2'], "fact"=>$parent['relationship'] ) ); if( $row[allow_living] && $allow_lds && $tngconfig['pardata'] < 2 ) setEvent( array( "text"=>$text[sealedplds], "date"=>$parent[sealdate], "place"=>$parent[sealplace], "event"=>"SLGC", "entity"=>"$personID::$parent[familyID]", "type"=>"C", "nomap"=>1), $parent[sealdatetr] ); $query = "SELECT living, branch, marrdate, marrdatetr, marrplace, divdate, divdatetr, divplace, familyID FROM $families_table WHERE $families_table.familyID = \"$parent[familyID]\" AND $families_table.gedcom = \"$tree\""; $gotparents = mysql_query($query) or die ("$text[cannotexecutequery]: $query"); $parentrow = mysql_fetch_assoc( $gotparents ); mysql_free_result($gotparents); $parent[personID] = ""; if($tngconfig['pardata'] < 2) { $rightfbranch = checkbranch( $parentrow[branch] ) ? 1 : 0; $parent[allow_living] = !$parentrow[living] || $livedefault == 2 || ( $allow_living && $rightfbranch ) ? 1 : 0; if($parent[allow_living]) { setEvent( array( "text"=>$text[married], "fact"=>$stdexf[MARR], "date"=>$parentrow[marrdate], "place"=>$parentrow[marrplace], "event"=>"MARR", "entity"=>$parentrow[familyID], "type"=>"F", "nomap"=>1 ), $parentrow[marrdatetr] ); setEvent( array( "text"=>$text[divorced], "fact"=>$stdexf[DIV], "date"=>$parentrow[divdate], "place"=>$parentrow[divplace], "event"=>"DIV", "entity"=>$parentrow[familyID], "type"=>"F", "nomap"=>1 ), $parentrow[divdatetr] ); if(!$tngconfig['pardata']) doCustomEvents($parent['familyID'],"F",1); ksort( $events ); foreach( $events as $event ) $persontext .= showEvent( $event ); if(!$tngconfig['pardata']) { $fammedia = getMedia($parent,"F"); foreach( $mediatypes as $mediatype ) { $mediatypeID = $mediatype[ID]; $persontext .= writeMedia( $fammedia, $mediatypeID ); } } } } $persontext .= showEvent( array( "text"=>$text[familyid], "date"=>$parent[familyID], "place"=>"$text[groupsheet]", "np"=>1 ) ); $persontext .= showBreak(); } mysql_free_result($parents); } //do marriages if( $spouseorder ) $query = "SELECT $spouse, familyID, living, branch, marrdate, marrdatetr, marrplace, marrtype, divdate, divdatetr, divplace, sealdate, sealdatetr, sealplace, DATE_FORMAT(changedate,\"%d %b %Y\") as changedate FROM $families_table WHERE $families_table.$self = \"$personID\" AND gedcom = \"$tree\" ORDER BY $spouseorder"; else $query = "SELECT husband, wife, familyID, living, branch, marrdate, marrdatetr, marrplace, marrtype, divdate, divdatetr, divplace, sealdate, sealdatetr, sealplace, DATE_FORMAT(changedate,\"%d %b %Y\") as changedate FROM $families_table WHERE $families_table.husband = \"$personID\" AND gedcom = \"$tree\" UNION SELECT husband, wife, familyID, living, branch, marrdate, marrdatetr, marrplace, marrtype, divdate, divdatetr, divplace, sealdate, sealdatetr, sealplace, DATE_FORMAT(changedate,\"%d %b %Y %H:%i:%s\") as changedate FROM $families_table WHERE $families_table.wife = \"$personID\" AND gedcom = \"$tree\""; $marriages= mysql_query($query) or die ("$text[cannotexecutequery]: $query"); $marrtot = mysql_num_rows($marriages); if( !$marrtot ) { $query = "SELECT husband, wife, familyID, living, branch, marrdate, marrdatetr, marrplace, marrtype, divdate, divdatetr, divplace, sealdate, sealdatetr, sealplace, DATE_FORMAT(changedate,\"%d %b %Y\") as changedate FROM $families_table WHERE $families_table.husband = \"$personID\" AND gedcom = \"$tree\" UNION SELECT husband, wife, familyID, living, branch, marrdate, marrdatetr, marrplace, marrtype, divdate, divdatetr, divplace, sealdate, sealdatetr, sealplace, DATE_FORMAT(changedate,\"%d %b %Y\") as changedate FROM $families_table WHERE $families_table.wife = \"$personID\" AND gedcom = \"$tree\""; $marriages= mysql_query($query) or die ("$text[cannotexecutequery]: $query"); $marrtot = mysql_num_rows($marriages); $spouseorder = 0; } $marrcount = 1; while ( $marriagerow = mysql_fetch_assoc( $marriages ) ) { $famnotes = getNotes( $marriagerow[familyID], "F" ); getCitations( $marriagerow[familyID] ); $stdexf = getStdExtras( $marriagerow[familyID] ); if( $marriagerow[marrtype] ) { if( !is_array( $stdexf[MARR] ) ) $stdexf[MARR] = array(); array_unshift( $stdexf[MARR], "$text[type]: $marriagerow[marrtype]" ); } if( !$spouseorder ) $spouse = $marriagerow[husband] == $personID ? wife : husband; unset($spouserow); unset($birthinfo); if( $marriagerow[$spouse] ) { //CHANGED 29-6-2008: 1 line: determine age partner //$query = "SELECT personID, lastname, lnprefix, firstname, prefix, suffix, nameorder, birthdate, birthplace, altbirthdate, altbirthplace, deathdate, deathplace, burialdate, burialplace, living, branch FROM $people_table WHERE personID = \"$marriagerow[$spouse]\" AND gedcom = \"$tree\""; $query = "SELECT personID, lastname, lnprefix, firstname, prefix, suffix, nameorder, birthdate, birthdatetr, birthplace, altbirthdate, altbirthplace, altbirthdatetr, deathdate, deathdatetr, deathplace, burialdate, burialdatetr, burialplace, living, branch FROM $people_table WHERE personID = \"$marriagerow[$spouse]\" AND gedcom = \"$tree\""; $spouseresult= mysql_query($query) or die ("$text[cannotexecutequery]: $query"); $spouserow = mysql_fetch_assoc( $spouseresult ); $birthinfo = getBirthInfo( $spouserow ); //CHANGED 29-6-2008: 2 lines: determine age partner $age = age ( $spouserow[birthdatetr], $spouserow[birthdate], $spouserow[altbirthdatetr], $spouserow[altbirthdate], $spouserow[deathdatetr], $spouserow[deathdate], $spouserow[burialdatetr], $spouserow[burialdate], $spouserow[living] ); $spouserow[allow_living] = !$spouserow[living] || $livedefault == 2 || ( $allow_living && checkbranch( $spouserow[branch] ) ) ? 1 : 0; if( $spouserow[firstname] || $spouserow[lastname] ) { $spousename = getName( $spouserow ); $spouselink = "$spousename"; } if( $spouserow[allow_living] ) $spouselink .= $birthinfo; //CHANGED 29-6-2008: 1 line: determine age partner if( $spouserow[allow_living] && $age != NULL) $spouselink .= " ($age )"; } else $spouselink = ""; $marrstr = $marrtot > 1 ? " $marrcount" : ""; if( $spouserow[allow_living] ) $persontext .= showEvent( array( "text"=>"$text[family]$marrstr", "fact"=>$spouselink, "entity"=>$marriagerow[familyID], "type"=>"F" ) ); else $persontext .= showEvent( array( "text"=>"$text[family]$marrstr", "fact"=>$spouselink ) ); $rightfbranch = checkbranch( $marriagerow[branch] ) ? 1 : 0; $marriagerow[allow_living] = !$marriagerow[living] || $livedefault == 2 || ( $allow_living && $rightfbranch ) ? 1 : 0; $fammedia = getMedia($marriagerow,"F"); if( $marriagerow[allow_living] ) { resetEvents(); setEvent( array( "text"=>$text[married], "fact"=>$stdexf[MARR], "date"=>$marriagerow[marrdate], "place"=>$marriagerow[marrplace], "event"=>"MARR", "entity"=>$marriagerow[familyID], "type"=>"F" ), $marriagerow[marrdatetr] ); setEvent( array( "text"=>$text[divorced], "fact"=>$stdexf[DIV], "date"=>$marriagerow[divdate], "place"=>$marriagerow[divplace], "event"=>"DIV", "entity"=>$marriagerow[familyID], "type"=>"F" ), $marriagerow[divdatetr] ); if( $allow_lds ) { setEvent( array( "text"=>$text[sealedslds], "fact"=>$stdexf[SLGS], "date"=>$marriagerow[sealdate], "place"=>$marriagerow[sealplace], "event"=>"SLGS", "entity"=>$marriagerow[familyID], "type"=>"F" ), $marriagerow[sealdatetr] ); } doCustomEvents($marriagerow['familyID'],"F"); ksort( $events ); foreach( $events as $event ) $persontext .= showEvent( $event ); $famnotes2 = ""; if( !$notestogether ) $famnotes2 = buildNotes( $famnotes, $marriagerow[familyID] ); else $famnotes2 = buildGenNotes( $famnotes, $marriagerow[familyID], "--x-general-x--" ); if( $famnotes2 ) { $persontext .= "
| $ifkids | $kidcount. $childname, "; if( $child[allow_living] ) $persontext .= " $birthinfo, "; if( $child[allow_living] && $age != NULL ) $persontext .= " $deathinfo ($age )"; $persontext .= " |