getFullName(); function print_descendency($pid, $count) { global $show_spouse, $dgenerations, $bwidth, $bheight, $bhalfheight; global $TEXT_DIRECTION, $WT_IMAGE_DIR, $WT_IMAGES, $generations, $box_width, $view, $show_full; if ($count>=$dgenerations) return 0; print "\n"; print ""; print "\n"; print "\n\n"; print "
\n"; $numkids = 0; $famids = find_sfamily_ids($pid); if (count($famids)>0) { $firstkids = 0; foreach($famids as $indexval => $famid) { $famrec = find_family_record($famid, WT_GED_ID); $ct = preg_match_all("/1 CHIL @(.*)@/", $famrec, $match, PREG_SET_ORDER); if ($ct>0) { print "\n"; for($i=0; $i<$ct; $i++) { $rowspan = 2; if (($i>0)&&($i<$ct-1)) $rowspan=1; $chil = trim($match[$i][1]); print "\n"; $twidth = 7; if ($ct==1) $twidth+=3; print "\n"; if ($ct>1) { if ($i==0) { print "\n"; print "\n"; } else if ($i==$ct-1) { print "\n"; print "\n"; } else { print "\n"; } } print "\n"; } print "
\n"; if ($count < $dgenerations-1) { $kids = print_descendency($chil, $count+1); if ($i==0) $firstkids = $kids; $numkids += $kids; } else { print_pedigree_person($chil); $numkids++; } print "\"\"\"\"
\"\"\"\"
\"\"\"\"
\n"; } } print "
\n"; } // NOTE: If statement OK if ($numkids==0) { $numkids = 1; $tbwidth = $bwidth+16; for($j=$count; $j<$dgenerations; $j++) { print "\n"; } } //-- add offset divs to make things line up better if ($show_spouse) { foreach($famids as $indexval => $famid) { $famrec = find_family_record($famid, WT_GED_ID); if (!empty($famrec)) { $marrec = get_sub_record(1, "1 MARR", $famrec); if (!empty($marrec)) { print "
"; } print "

\n"; } } } print_pedigree_person($pid); // NOTE: If statement OK if ($show_spouse) { foreach($famids as $indexval => $famid) { $famrec = find_family_record($famid, WT_GED_ID); if (!empty($famrec)) { $parents = find_parents_in_record($famrec); $marrec = get_sub_record(1, "1 MARR", $famrec); if (!empty($marrec)) { print "
"; $marriage = new Event($marrec); $marriage->print_simple_fact(); } if ($parents["HUSB"]!=$pid) print_pedigree_person($parents["HUSB"]); else print_pedigree_person($parents["WIFE"]); } } } // NOTE: If statement OK if ($count==0) { $indirec = find_person_record($pid, WT_GED_ID); // NOTE: If statement OK if (displayDetailsById($pid, 'INDI') || showLivingNameById($pid)) { // -- print left arrow for decendants so that we can move down the tree $famids = find_sfamily_ids($pid); //-- make sure there is more than 1 child in the family with parents $cfamids = find_family_ids($pid); $num=0; // NOTE: For statement OK for($f=0; $f1)) { print "\n\t\t
"; if ($view!="preview") { print ""; print "\"\""; print ""; } print "\n\t\t
"; print "\n\t\t\t
"; for($f=0; $fgetFullName(); print "\n\t\t\t\t"; print PrintReady($name); print "
"; } } $num = preg_match_all("/1\s*CHIL\s*@(.*)@/", $famrec, $smatch,PREG_SET_ORDER); for($i=0; $i<$num; $i++) { //-- add the following line to stop a bad PHP bug if ($i>=$num) break; $cid = $smatch[$i][1]; $child=Person::getInstance($cid); $name=$child->getFullName(); print "\n\t\t\t\t  < "; print PrintReady($name); print "
"; } } } //-- print the siblings for($f=0; $f
".i18n::translate('Parents')."
"; if (!empty($parents["HUSB"])) { $spid = $parents["HUSB"]; $spouse=Person::getInstance($spid); $name=$spouse->getFullName(); print "\n\t\t\t\t  "; print PrintReady($name); print "
"; } if (!empty($parents["WIFE"])) { $spid = $parents["WIFE"]; $spouse=Person::getInstance($spid); $name=$spouse->getFullName(); print "\n\t\t\t\t  "; print PrintReady($name); print "
"; } } $num = preg_match_all("/1\s*CHIL\s*@(.*)@/", $famrec, $smatch,PREG_SET_ORDER); if ($num>2) print "
".i18n::translate('Siblings')."
"; if ($num==2) print "
".i18n::translate('Sibling')."
"; for($i=0; $i<$num; $i++) { //-- add the following line to stop a bad PHP bug if ($i>=$num) break; $cid = $smatch[$i][1]; if ($cid!=$pid) { $child=Person::getInstance($cid); $name=$child->getFullName(); print "\n\t\t\t\t   "; print PrintReady($name); print "
"; } } } } print "\n\t\t\t
"; print "\n\t\t
"; print "\n\t\t
"; } } } print "
\n"; return $numkids; } function max_descendency_generations($pid, $depth) { global $generations; if ($depth >= $generations) return $depth; $famids = find_sfamily_ids($pid); $maxdc = $depth; foreach($famids as $indexval => $famid) { $famrec = find_family_record($famid, WT_GED_ID); $ct = preg_match_all("/1 CHIL @(.*)@/", $famrec, $match, PREG_SET_ORDER); for($i=0; $i<$ct; $i++) { $chil = trim($match[$i][1]); $dc = max_descendency_generations($chil, $depth+1); if ($dc >= $generations) return $dc; if ($dc > $maxdc) $maxdc = $dc; } } if ($maxdc==0) $maxdc++; return $maxdc; } function print_person_pedigree($pid, $count) { global $generations, $SHOW_EMPTY_BOXES, $WT_IMAGE_DIR, $WT_IMAGES, $bheight, $bhalfheight; if ($count>=$generations) return; $famids = find_family_ids($pid); $hheight = ($bhalfheight+3) * pow(2,($generations-$count-1)); foreach($famids as $indexval => $famid) { print "\n"; $parents = find_parents($famid); $height="100%"; print ""; if ($count<$generations-1) { print "\n"; print "\n"; } print "\n"; print "\n"; print "\n\n\n\n"; if ($count<$generations-1) { print ""; print "\n"; } print "\n"; print "\n"; print "\n"; if ($count<$generations-1) print "\n\n"; print "
\"\"\"\"\n"; print_pedigree_person($parents["HUSB"]); print "\n"; print_person_pedigree($parents["HUSB"], $count+1); print "
\"\"
\"\"\"\"\n"; print_pedigree_person($parents["WIFE"]); print "\n"; print_person_pedigree($parents["WIFE"], $count+1); print "
\"\"
\n"; } } function print_family_book($pid, $descent) { global $generations, $dgenerations, $firstrun; if ($descent==0) return; $famids = find_sfamily_ids($pid); if (count($famids)>0 || empty($firstrun)) { $firstrun = true; $pid=check_rootid($pid); $person=Person::getInstance($pid); $name=$person->getFullName(); print "\n\t

".i18n::translate('Family of: ').PrintReady($name)."

"; print "\n"; //-- descendancy print "\n"; //-- pedigree print "\n"; print "
\n"; $dgenerations = $generations; // $dgenerations = max_descendency_generations($pid, 0); print_descendency($pid, 1); print "\n"; print_person_pedigree($pid, 1); print "
\n"; print "

\n"; print "
\n"; print "

\n"; foreach($famids as $indexval => $famid) { $famrec = find_family_record($famid, WT_GED_ID); $ct = preg_match_all("/1 CHIL @(.*)@/", $famrec, $match, PREG_SET_ORDER); for($i=0; $i<$ct; $i++) { $chil = trim($match[$i][1]); if (showLivingNameById($chil) || displayDetailsById($chil)) print_family_book($chil, $descent-1); } } } } // -- print html header information print_header(PrintReady($name)." ".i18n::translate('Family Book Chart')); if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; // LBox ===================================================================================== if (WT_USE_LIGHTBOX) { require WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; require WT_ROOT.'modules/lightbox/functions/lb_call_js.php'; } // ========================================================================================== if ($view=="preview") { print "

".i18n::translate('Family Book Chart').":   ".PrintReady($name)."

"; } else { print ""; print "
"; print "

".i18n::translate('Family Book Chart').":
".PrintReady($name)."

"; } ?>
 
" />
/>
%   
  
', i18n::translate('Click on any of the boxes to get more information about that person.'), '
'; } } ?>
" style="" > "; print "

\n"; print_footer(); ?>