Exemple #1
0
function show_person($personDb)
{
    global $dbh, $db_functions, $index_list, $selected_place, $language, $user;
    global $bot_visit, $humo_option, $uri_path, $search_database, $list_expanded;
    global $selected_language, $privacy, $dirmark1, $dirmark2, $rtlmarker;
    global $select_birth, $select_bapt, $select_place, $select_death, $select_buried;
    global $selectsort;
    $pers_tree_prefix = $personDb->pers_tree_prefix;
    $db_functions->set_tree_prefix($pers_tree_prefix);
    $db_functions->set_tree_id($personDb->pers_tree_id);
    if (CMS_SPECIFIC == 'Joomla') {
        $start_url = 'index.php?option=com_humo-gen&task=family&database=' . $pers_tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber;
    } elseif ($humo_option["url_rewrite"] == "j") {
        // *** url_rewrite ***
        // *** $uri_path made in header.php ***
        $start_url = $uri_path . 'family/' . $pers_tree_prefix . '/' . $personDb->pers_indexnr . '/' . $personDb->pers_gedcomnumber . '/';
    } else {
        $start_url = CMS_ROOTPATH . 'family.php?database=' . $pers_tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber;
    }
    // *** Person class used for name and person pop-up data ***
    $person_cls = new person_cls();
    $person_cls->construct($personDb);
    $name = $person_cls->person_name($personDb);
    // *** Show name ***
    $index_name = '';
    if ($name["show_name"] == false) {
        $index_name = __('Name filtered');
    } else {
        // *** If there is no lastname, show a - character. ***
        if ($personDb->pers_lastname == "") {
            // Don't show a "-" by pers_patronymes
            if (!isset($_GET['pers_patronym'])) {
                $index_name = "-  ";
            }
        }
        $index_name .= $name["index_name_extended"] . $name["colour_mark"];
    }
    // *** Show extra colums before a person in index places ***
    if ($index_list == 'places') {
        if ($selected_place != $personDb->place_order) {
            echo '<td colspan="7"><b>' . $dirmark2 . "{$personDb->place_order}</b></td></tr><tr>";
        }
        $selected_place = $personDb->place_order;
        echo '<td valign="top" style="white-space:nowrap;width:90px">';
        if ($select_birth == '1') {
            if ($selected_place == $personDb->pers_birth_place) {
                echo '<span class="place_index place_index_selected">' . __('*') . '</span>';
            } else {
                echo '<span class="place_index">&nbsp;</span>';
            }
        }
        if ($select_bapt == '1') {
            if ($selected_place == $personDb->pers_bapt_place) {
                echo '<span class="place_index place_index_selected">' . __('~') . '</span>';
            } else {
                echo '<span class="place_index">&nbsp;</span>';
            }
        }
        if ($select_place == '1') {
            if ($selected_place == $personDb->pers_place_index) {
                echo '<span class="place_index place_index_selected">' . __('^') . '</span>';
            } else {
                echo '<span class="place_index">&nbsp;</span>';
            }
        }
        if ($select_death == '1') {
            if ($selected_place == $personDb->pers_death_place) {
                echo '<span class="place_index place_index_selected">' . __('&#134;') . '</span>';
            } else {
                echo '<span class="place_index">&nbsp;</span>';
            }
        }
        if ($select_buried == '1') {
            if ($selected_place == $personDb->pers_buried_place) {
                echo '<span class="place_index place_index_selected">' . __('[]') . '</span>';
            } else {
                echo '<span class="place_index">&nbsp;</span>';
            }
        }
        echo '</td>';
    }
    echo '<td valign="top" style="border-right:0px; white-space:nowrap;">';
    // *** Show person popup menu ***
    echo $person_cls->person_popup_menu($personDb);
    // *** Show picture man or wife ***
    if ($personDb->pers_sexe == "M") {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/man.gif" alt="man" style="vertical-align:top">';
    } elseif ($personDb->pers_sexe == "F") {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/woman.gif" alt="woman" style="vertical-align:top">';
    } else {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/unknown.gif" alt="unknown" style="vertical-align:top">';
    }
    // *** Add own icon by person, using a file name in own code ***
    if ($personDb->pers_own_code != '' and is_file("images/" . $personDb->pers_own_code . ".gif")) {
        echo $dirmark1 . '<img src="' . CMS_ROOTPATH . 'images/' . $personDb->pers_own_code . '.gif" alt="' . $personDb->pers_own_code . '">&nbsp;';
    }
    echo '</td><td style="border-left:0px;">';
    // *** Show name of person ***
    echo ' <a href="' . $start_url . '">' . $index_name . '</a>';
    //*** Show spouse/ partner ***
    if ($list_expanded == true and $personDb->pers_fams) {
        $marriage_array = explode(";", $personDb->pers_fams);
        $nr_marriages = count($marriage_array);
        for ($x = 0; $x <= $nr_marriages - 1; $x++) {
            $fam_partnerDb = $db_functions->get_family($marriage_array[$x]);
            // *** This check is better then a check like: $personDb->pers_sexe=='F', because of unknown sexe or homosexual relations. ***
            if ($personDb->pers_gedcomnumber == $fam_partnerDb->fam_man) {
                $partner_id = $fam_partnerDb->fam_woman;
            } else {
                $partner_id = $fam_partnerDb->fam_man;
            }
            $relation_short = __('&amp;');
            if ($fam_partnerDb->fam_marr_date or $fam_partnerDb->fam_marr_place or $fam_partnerDb->fam_marr_church_date or $fam_partnerDb->fam_marr_church_place or $fam_partnerDb->fam_kind == 'civil') {
                $relation_short = __('X');
            }
            if ($fam_partnerDb->fam_div_date or $fam_partnerDb->fam_div_place) {
                $relation_short = __(') (');
            }
            if ($partner_id != '0' and $partner_id != '') {
                $partnerDb = $db_functions->get_person($partner_id);
                $partner_cls = new person_cls();
                $name = $partner_cls->person_name($partnerDb);
            } else {
                $name["standard_name"] = __('N.N.');
            }
            if ($nr_marriages > 1 and $x > 0) {
                echo ',';
            }
            echo ' <span class="index_partner" style="font-size:10px;">';
            if ($nr_marriages > 1) {
                if ($x == 0) {
                    echo __('1st');
                } elseif ($x == 1) {
                    echo __('2nd');
                } elseif ($x == 2) {
                    echo __('3rd');
                } elseif ($x > 2) {
                    echo $x + 1 . __('th');
                }
            }
            echo ' ' . $relation_short . ' ' . rtrim($name["standard_name"]) . '</span>';
        }
    }
    // *** End spouse/ partner ***
    echo '</td><td style="white-space:nowrap;">';
    $info = "";
    if ($personDb->pers_bapt_date) {
        $info = __('~') . ' ' . date_place($personDb->pers_bapt_date, '');
    }
    if ($personDb->pers_birth_date) {
        $info = __('*') . ' ' . date_place($personDb->pers_birth_date, '');
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td>';
    $info = "";
    if ($personDb->pers_bapt_place) {
        $info = __('~') . ' ' . $personDb->pers_bapt_place;
    }
    if ($personDb->pers_birth_place) {
        $info = __('*') . ' ' . $personDb->pers_birth_place;
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td style="white-space:nowrap;">';
    $info = "";
    if ($personDb->pers_buried_date) {
        $info = __('[]') . ' ' . date_place($personDb->pers_buried_date, '');
    }
    if ($personDb->pers_death_date) {
        $info = __('&#134;') . ' ' . date_place($personDb->pers_death_date, '');
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td>';
    $info = "";
    if ($personDb->pers_buried_place) {
        $info = __('[]') . ' ' . $personDb->pers_buried_place;
    }
    if ($personDb->pers_death_place) {
        $info = __('&#134;') . ' ' . $personDb->pers_death_place;
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    // *** Show name of family tree, if search in multiple family trees is used ***
    if ($search_database == 'all_trees' or $search_database == 'all_but_this') {
        $treetext = show_tree_text($pers_tree_prefix, $selected_language);
        echo '</td><td>';
        echo '<i><font size="-1">' . $treetext['name'] . '</font></i>';
    }
    echo '</td></tr>';
}
function printchart()
{
    global $dbh, $tree_id, $db_functions, $genarray, $size, $tree_prefix_quoted, $language, $chosengen, $keepfamily_id, $keepmain_person, $uri_path, $database;
    global $vbasesize, $hsize, $vsize, $vdist, $hdist, $user, $direction, $dna;
    global $dirmark1, $dirmark2, $rtlmarker, $alignmarker, $base_person_gednr, $base_person_name, $base_person_sexe, $base_person_famc;
    // YB: -- check browser type & version. we need this further on to detect IE7 with it's widely reported z-index bug
    $browser_user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
    global $hourglass, $divlen, $divhi;
    if ($hourglass === false) {
        // find rightmost and bottommost positions to calculate size of the canvas needed for png image
        $divlen = 0;
        $divhi = 0;
        for ($i = 0; $i < count($genarray); $i++) {
            if ($genarray[$i]["x"] > $divlen) {
                $divlen = $genarray[$i]["x"];
            }
            if ($genarray[$i]["y"] > $divhi) {
                $divhi = $genarray[$i]["y"];
            }
        }
        $divlen += 200;
        $divhi += 300;
        // the width and length of following div are set with $divlen en $divhi in java function "showimg"
        // (at bottom of this file) otherwise double scrollbars won't work.
        echo '<div id="png">';
        //======== HELP POPUP ========================
        echo '<div id="helppopup" class="' . $rtlmarker . 'sddm" style="position:absolute;left:10px;top:10px;display:inline;">';
        echo '<a href="#"';
        echo ' style="display:inline" ';
        echo 'onmouseover="mopen(event,\'help_menu\',0,0)"';
        echo 'onmouseout="mclosetime()">';
        echo '<b>' . __('Help') . '</b>';
        echo '</a>&nbsp;';
        //echo '<div style="z-index:40; padding:4px; direction:'.$rtlmarker.'" id="help_menu" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
        echo '<div class="sddm_fixed" style="z-index:10; padding:4px; text-align:' . $alignmarker . ';  direction:' . $rtlmarker . ';" id="help_menu" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
        echo __('<b>USE:</b>
<p><b>Hover over square:</b> Display popup menu with details and report & chart options<br>
<b>Click on square:</b> Move this person to the center of the chart<br>
<b>Click on spouse\'s name in popup menu:</b> Go to spouse\'s family page<br><br>
<b>LEGEND:</b>');
        echo '<p><span style="background-image: linear-gradient(to bottom, #ffffff 0%, #81bef7 100%); border:1px brown solid;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;' . __('Male') . '</br>';
        echo '<span style="background-image: linear-gradient(to bottom, #ffffff 0%, #f5bca9 100%); border:1px brown solid;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;' . __('Female') . '</br>';
        if ($dna == "ydna" or $dna == "ydnamark" or $dna == "mtdna" or $dna == "mtdnamark") {
            echo '<p style="line-height:3px"><span style="background-image: linear-gradient(to bottom, #ffffff 0%, #81bef7 100%); border:3px solid #999999;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;' . __('Male Y-DNA or mtDNA carrier (Base person has red border)') . '</p>';
            echo '<p style="line-height:10px"><span style="background-image: linear-gradient(to bottom, #ffffff 0%, #f5bca9 100%); border:3px solid #999999;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;' . __('Female MtDNA carrier (Base person has red border)') . '</p>';
        }
        echo '<p><span style="color:blue">=====</span>&nbsp;' . __('Additional marriage of same person') . '<br><br>';
        echo __('<b>SETTINGS:</b>
<p>Horizontal/Vertical button: toggle direction of the chart from top-down to left-right<br>
<b>Nr. Generations:</b> choose between 2 - 15 generations<br>
(large number of generations will take longer to generate)<br>
<b>Box size:</b> Use the slider to choose display size (9 steps): <br>
step 1-3: small boxes with popup for details<br>
step 4-7: larger boxes with initials of name + popup for details<br>
step 8:   rectangles with name inside + popup with further details<br>
step 9:   large rectangles with name, birth and death details + popup with further details');
        echo '</div>';
        echo '</div>';
        //=================================
        if ($dna == "none") {
            echo '<div class="standard_header fonts" style="align:center; text-align: center;"><b>' . __('Descendant chart') . __(' of ') . $genarray[0]["nam"] . '</b>';
        } elseif ($dna == "ydna" or $dna == "ydnamark") {
            echo '<div class="standard_header fonts" style="align:center; text-align: center;"><b>' . __('Same Y-DNA as ') . $base_person_name . '</b>';
        } elseif ($dna == "mtdna" or $dna == "mtdnamark") {
            echo '<div class="standard_header fonts" style="align:center; text-align: center;"><b>' . __('Same mtDNA as ') . $base_person_name . '</b>';
        }
        echo '<br><input type="button" id="imgbutton" value="' . __('Get image of chart for printing (allow popup!)') . '" onClick="showimg();">';
        echo '</div>';
        if ($direction == 0) {
            $latter = count($genarray) - 1;
            $the_height = $genarray[$latter]["y"] + 130;
        } else {
            $hgt = 0;
            for ($e = 0; $e < count($genarray); $e++) {
                if ($genarray[$e]["y"] > $hgt) {
                    $hgt = $genarray[$e]["y"];
                }
            }
            $the_height = $hgt + 130;
        }
        echo '<style type="text/css">';
        echo '#doublescroll { position:relative; width:auto; height:' . $the_height . 'px; overflow: auto; overflow-y: hidden;z-index:10; }';
        echo '</style>';
        //print '<div class="wrapper" style="position:relative; direction:'.$rtlmarker.';">';
        //print '<div id="doublescroll" class="wrapper" style="direction:'.$rtlmarker.';"><br style="line-height:50%">';
        print '<div id="doublescroll" class="wrapper" style="direction:' . $rtlmarker . ';">';
        // generation and size choice box:
        if ($dna == "none") {
            $boxwidth = "520";
        } else {
            $boxwidth = "730";
        }
        // DNA charts
        echo '<div id="menubox" class="search_bar" style="margin-top:5px; direction:ltr; z-index:20; width:' . $boxwidth . 'px; text-align:left;">';
        print '<div style="display:inline;">';
        if (CMS_SPECIFIC == 'Joomla') {
            print '<form method="POST" name="desc_form" action="index.php?option=com_humo-gen&task=family&chosensize=' . $size . '&amp;screen_mode=STARSIZE" style="display : inline;">';
        } else {
            print '<form method="POST" name="desc_form" action="' . CMS_ROOTPATH . 'family.php?chosensize=' . $size . '&amp;screen_mode=STARSIZE" style="display : inline;">';
        }
        print '<input type="hidden" name="id" value="' . $keepfamily_id . '">';
        print '<input type="hidden" name="chosengen" value="' . $chosengen . '">';
        print '<input type="hidden" name="main_person" value="' . $keepmain_person . '">';
        print '<input type="hidden" name="database" value="' . $database . '">';
        if ($dna != "none") {
            print '<input type="hidden" name="dnachart" value="' . $dna . '">';
            print '<input type="hidden" name="bf" value="' . $base_person_famc . '">';
            print '<input type="hidden" name="bs" value="' . $base_person_sexe . '">';
            print '<input type="hidden" name="bn" value="' . $base_person_name . '">';
            print '<input type="hidden" name="bg" value="' . $base_person_gednr . '">';
        }
        print '<input id="dirval" type="hidden" name="direction" value="">';
        // will be filled in next lines
        if ($direction == "1") {
            // horizontal
            print '<input type="button" name="dummy" value="' . __('vertical') . '" onClick=\'document.desc_form.direction.value="0";document.desc_form.submit();\'>';
        } else {
            print '<input type="button" name="dummy" value="' . __('horizontal') . '" onClick=\'document.desc_form.direction.value="1";document.desc_form.submit();\'>';
        }
        print '</form>';
        $result = $dbh->query("SELECT pers_sexe FROM humo_persons\n\t\t\tWHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber ='" . $keepmain_person . "'");
        $resultDb = $result->fetch(PDO::FETCH_OBJ);
        if ($dna != "none") {
            echo "&nbsp;&nbsp;" . __('DNA: ');
            echo '<select name="dnachart" style="width:150px" onChange="window.location=this.value">';
            //		echo $selected="selected"; if($dna!="none") $selected="";
            //		echo '<option value="'.$uri_path.'family.php?id='.$keepfamily_id.'&amp;main_person='.
            //				$keepmain_person.'&amp;direction='.$direction.'&amp;database='.$database.'&amp;dnachart='."none".'&amp;chosensize='.
            //				$size.'&amp;chosengen='.$chosengen.'&amp;screen_mode=STAR" '.$selected.'>'.__('All').'</option>';
            if ($base_person_sexe == "M") {
                // only show Y-DNA option if base person is male
                //echo $selected=""; if($dna=="ydna") $selected="selected";
                echo $selected = "selected";
                if ($dna != "ydna") {
                    $selected = "";
                }
                echo '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . "ydna" . '&amp;chosensize=' . $size . '&amp;chosengen=' . $chosengen . '&amp;screen_mode=STAR" ' . $selected . '>' . __('Y-DNA Carriers only') . '</option>';
                //echo $selected="selected"; if($dna!="ydnamark") $selected="";
                echo $selected = "";
                if ($dna == "ydnamark") {
                    $selected = "selected";
                }
                echo '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . "ydnamark" . '&amp;chosensize=' . $size . '&amp;chosengen=' . $chosengen . '&amp;screen_mode=STAR" ' . $selected . '>' . __('Y-DNA Mark carriers') . '</option>';
            }
            if ($base_person_sexe == "F" or $base_person_sexe == "M" and isset($base_person_famc) and $base_person_famc != "") {
                // if base person is male, only show mtDNA if there are ancestors since he can't have mtDNA descendants...
                echo $selected = "";
                if ($dna == "mtdna") {
                    $selected = "selected";
                }
                echo '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . "mtdna" . '&amp;chosensize=' . $size . '&amp;chosengen=' . $chosengen . '&amp;screen_mode=STAR" ' . $selected . '>' . __('mtDNA Carriers only') . '</option>';
                if ($base_person_sexe == "F") {
                    echo $selected = "selected";
                    if ($dna != "mtdnamark") {
                        $selected = "";
                    }
                } else {
                    echo $selected = "";
                    if ($dna == "mtdnamark") {
                        $selected = "selected";
                    }
                }
                echo '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . "mtdnamark" . '&amp;chosensize=' . $size . '&amp;chosengen=' . $chosengen . '&amp;screen_mode=STAR" ' . $selected . '>' . __('mtDNA Mark carriers') . '</option>';
            }
            echo '</select>';
        }
        print '</div>';
        print '&nbsp;&nbsp;';
        print '&nbsp;' . __('Nr. generations') . ': ';
        print '<select name="chosengen" onChange="window.location=this.value">';
        for ($i = 2; $i <= 15; $i++) {
            if (CMS_SPECIFIC == 'Joomla') {
                print '<option value="index.php?option=com_humo-gen&task=family&id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . $dna . '&amp;chosensize=' . $size . '&amp;chosengen=' . $i . '&amp;screen_mode=STAR" ';
            } else {
                print '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . $dna . '&amp;chosensize=' . $size . '&amp;chosengen=' . $i . '&amp;screen_mode=STAR" ';
            }
            if ($i == $chosengen) {
                print "selected=\"selected\" ";
            }
            print ">" . $i . "</option>";
        }
        //NEW - option "All" for all generations
        print '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&amp;main_person=' . $keepmain_person . '&amp;direction=' . $direction . '&amp;database=' . $database . '&amp;dnachart=' . $dna . '&amp;chosensize=' . $size . '&amp;chosengen=All&amp;screen_mode=STAR" ';
        if ($chosengen == "All") {
            print "selected=\"selected\" ";
        }
        print ">" . "All" . "</option>";
        print '</select>';
        print '&nbsp;&nbsp;';
        $dna_params = "";
        if ($dna != "none") {
            $dna_params = '
					bn: "' . $base_person_name . '",
					bs: "' . $base_person_sexe . '",
					bf: "' . $base_person_famc . '",
					bg: "' . $base_person_gednr . '",';
        }
        //NEW min:0 (for extra first step - now 10 steps: 0-9), then twice value +1 so on display first step is shown as 1, not 0
        echo ' 
			<script>
			$(function() {
				$( "#slider" ).slider({
					value: ' . ($size / 5 - 1) . ',
					min: 0,
					max: 9,
					step: 1,
					database: "' . $database . '",
					main_person: "' . $keepmain_person . '",
					id: "' . $keepfamily_id . '",
					chosengen: "' . $chosengen . '",
					direction: "' . $direction . '",
					dna: "' . $dna . '",' . $dna_params . '
					slide: function( event, ui ) {
						$( "#amount" ).val(ui.value+1);
					}
				});
				$( "#amount" ).val($( "#slider" ).slider( "value" )+1 );
			});
			</script>
		';
        //echo '<label for="amount">Zoom in/out:</label>';
        echo '<label for="amount">' . __('Zoom level:') . '</label> ';
        echo '<input type="text" id="amount" disabled="disabled" style="width:15px;border:0; color:#0000CC; font-weight:normal;font-size:115%;" />';
        echo '<div id="slider" style="float:right;width:135px;margin-top:7px;margin-right:15px;"></div>';
        echo '</div>';
    }
    // end if not hourglass
    for ($w = 0; $w < count($genarray); $w++) {
        $xvalue = $genarray[$w]["x"];
        $yvalue = $genarray[$w]["y"];
        var_dump($w, $genarray[$w]["x"]);
        $sexe_colour = '';
        $backgr_col = "#FFFFFF";
        if ($genarray[$w]["sex"] == "v") {
            $sexe_colour = ' ancestor_woman';
            $backgr_col = "#FBDEC0";
            //"#f8bdf1";
        } else {
            $sexe_colour = ' ancestor_man';
            $backgr_col = "#C0F9FC";
            //"#bbf0ff";
        }
        // *** Start person class and calculate privacy ***
        if ($genarray[$w]["gednr"]) {
            $man = $db_functions->get_person($genarray[$w]["gednr"]);
            $man_cls = new person_cls();
            $man_cls->construct($man);
            $man_privacy = $man_cls->privacy;
        }
        //echo '<div style="position:absolute; background-color:'.$bkcolor.';height:'.$vsize.'px; width:'.$hsize.'px; border:1px brown solid; left:'.$xvalue.'px; top:'.$yvalue.'px">';
        $bkgr = "";
        if (($dna == "ydnamark" or $dna == "mtdnamark" or $dna == "ydna" or $dna == "mtdna") and $genarray[$w]["dna"] == 1) {
            $bkgr = "border:3px solid #999999;background-color:" . $backgr_col . ";";
            if ($genarray[$w]["gednr"] == $base_person_gednr) {
                // base person
                $bkgr = "border:3px solid red;background-color:" . $backgr_col . ";";
            }
        } else {
            $bkgr = "border:1px solid #8C8C8C;background-color:" . $backgr_col . ";";
        }
        if ($genarray[$w]["gen"] == 0 and $hourglass === true) {
            $bkgr = "background-color:" . $backgr_col . ";";
        }
        echo '<div class="ancestor_name' . $sexe_colour . '" style="' . $bkgr . 'position:absolute; height:' . $vsize . 'px; width:' . $hsize . 'px; left:' . $xvalue . 'px; top:' . $yvalue . 'px;">';
        $replacement_text = '';
        if ($size >= 25) {
            /*
            if(CMS_SPECIFIC=='Joomla') {
            	$replacement_text.= '<a class="nam" href="index.php?option=com_humo-gen&task=family&id='.$genarray[$w]["fams"].'&amp;main_person='.$genarray[$w]["gednr"].'&amp;chosensize='.$size.'&amp;direction='.$direction.'&amp;screen_mode=STAR"';
            }
            else {
            	$replacement_text.= '<a class="nam" href="'.CMS_ROOTPATH.'family.php?id='.$genarray[$w]["fams"].'&amp;main_person='.$genarray[$w]["gednr"].'&amp;chosensize='.$size.'&amp;direction='.$direction.'&amp;screen_mode=STAR"';
            }
            
            $replacement_text.= ' style="font-size:9px; text-align:center; display:block; width:100%; height:100%" ';
            $replacement_text.= 'onmouseover="mopen(event,\'m1'.$w.'\',0,0)"';
            $replacement_text.= 'onmouseout="mclosetime()">';
            */
            if (strpos($browser_user_agent, "msie 7.0") === false) {
                if ($size == 50) {
                    // *** Show picture ***
                    if (!$man_privacy and $user['group_pictures'] == 'j') {
                        //  *** Path can be changed per family tree ***
                        global $dataDb;
                        $tree_pict_path = $dataDb->tree_pict_path;
                        $picture_qry = $db_functions->get_events_person($man->pers_gedcomnumber, 'picture');
                        // *** Only show 1st picture ***
                        if (isset($picture_qry[0])) {
                            $pictureDb = $picture_qry[0];
                            $picture = show_picture($tree_pict_path, $pictureDb->event_event, 60, 65);
                            //$replacement_text.='<img src="'.$tree_pict_path.$picture['thumb'].$picture['picture'].'" style="float:left; margin:5px;" alt="'.$pictureDb->event_text.'" height="65px">';
                            $replacement_text .= '<img src="' . $tree_pict_path . $picture['thumb'] . $picture['picture'] . '" style="float:left; margin:5px;" alt="' . $pictureDb->event_text . '" width="' . $picture['width'] . '"';
                            //if (isset($picture['height'])) $replacement_text.=' height="'.$picture['height'].'"';
                            $replacement_text .= '>';
                        }
                    }
                    //$replacement_text.= '<strong>'.$genarray[$w]["nam"].'</strong>';
                    //$replacement_text.= '<span class="anc_box_name">'.$genarray[$w]["nam"].'</span>';
                    $replacement_text .= '<span class="anc_box_name">' . $genarray[$w]["nam"] . '</span>';
                    if ($man_privacy) {
                        $replacement_text .= '<br>' . __(' PRIVACY FILTER') . '<br>';
                        //Tekst privacy weergeven
                    } else {
                        //if ($man->pers_birth_date OR $man->pers_birth_place){
                        if ($man->pers_birth_date) {
                            //$replacement_text.= '<br>'.__('*').$dirmark1.' '.date_place($man->pers_birth_date,$man->pers_birth_place);
                            $replacement_text .= '<br>' . __('*') . $dirmark1 . ' ' . date_place($man->pers_birth_date, '');
                        } elseif ($man->pers_bapt_date) {
                            //$replacement_text.= '<br>'.__('~').$dirmark1.' '.date_place($man->pers_bapt_date,$man->pers_bapt_place);
                            $replacement_text .= '<br>' . __('~') . $dirmark1 . ' ' . date_place($man->pers_bapt_date, '');
                        }
                        //if ($man->pers_death_date OR $man->pers_death_place){
                        if ($man->pers_death_date) {
                            //$replacement_text.= '<br>'.__('&#134;').$dirmark1.' '.date_place($man->pers_death_date,$man->pers_death_place);
                            $replacement_text .= '<br>' . __('&#134;') . $dirmark1 . ' ' . date_place($man->pers_death_date, '');
                        } elseif ($man->pers_buried_date) {
                            //$replacement_text.= '<br>'.__('[]').$dirmark1.' '.date_place($man->pers_buried_date,$man->pers_buried_place);
                            $replacement_text .= '<br>' . __('[]') . $dirmark1 . ' ' . date_place($man->pers_buried_date, '');
                        }
                        if ($genarray[$w]["non"] == 0) {
                            // otherwise for an unmarried child it would give the parents' marriage!
                            $ownfam = $db_functions->get_family($genarray[$w]["fams"]);
                            //if ($ownfam->fam_marr_date OR $ownfam->fam_marr_place){
                            if ($ownfam->fam_marr_date) {
                                //$replacement_text.= '<br>'.__('X').$dirmark1.' '.date_place($ownfam->fam_marr_date,$ownfam->fam_marr_place);
                                $replacement_text .= '<br>' . __('X') . $dirmark1 . ' ' . date_place($ownfam->fam_marr_date, '');
                            }
                        }
                    }
                } elseif ($size == 45) {
                    $replacement_text .= $genarray[$w]["nam"];
                } elseif ($size == 40) {
                    $replacement_text .= '<span class="wordwrap" style="font-size:75%">' . $genarray[$w]["short"] . '</span>';
                } elseif ($size >= 25 and $size < 40) {
                    $replacement_text .= $genarray[$w]["init"];
                }
            }
        } else {
            if (isset($genarray[$w]["fams"]) and isset($genarray[$w]["gednr"])) {
                /*
                if(CMS_SPECIFIC=='Joomla') {
                	$replacement_text.= '<a href="index.php?option=com_humo-gen&task=family&id='.$genarray[$w]["fams"].'&amp;main_person='.$genarray[$w]["gednr"].'&amp;chosensize='.$size.'&amp;direction='.$direction.'&amp;screen_mode=STAR"';
                }
                else {
                	$replacement_text.= '<a href="'.CMS_ROOTPATH.'family.php?id='.$genarray[$w]["fams"].'&amp;main_person='.$genarray[$w]["gednr"].'&amp;chosensize='.$size.'&amp;direction='.$direction.'&amp;screen_mode=STAR"';
                }
                $replacement_text.= ' style="display:block; width:100%; height:100%" ';
                $replacement_text.= ' onmouseover="mopen(event,\'m1'.$w.'\',0,0)"';
                $replacement_text.= 'onmouseout="mclosetime()">';
                */
                if (strpos($browser_user_agent, "chrome") !== false or strpos($browser_user_agent, "safari") !== false) {
                    $replacement_text .= "&nbsp;";
                }
                //  (Chrome and Safari need some character here - even &nbsp - or else popup won't work..!
            }
        }
        //$replacement_text.='</a>';
        // *** POP-UP box ***
        $extra_popup_text = '';
        if ($genarray[$w]["2nd"] == 1) {
            $extra_popup_text .= $genarray[$w]["huw"] . "<br>";
        }
        if ($genarray[$w]["non"] != 1) {
            // *** Start person class and calculate privacy ***
            $woman_cls = '';
            // prevent use of $woman_cls from previous wife if another wife is NN
            if (isset($genarray[$w]["spgednr"]) and $genarray[$w]["spgednr"]) {
                @($woman = $db_functions->get_person($genarray[$w]["spgednr"]));
                $woman_cls = new person_cls();
                $woman_cls->construct($woman);
                $woman_privacy = $woman_cls->privacy;
            }
            // *** Marriage data ***
            $extra_popup_text .= '<br>' . $genarray[$w]["htx"] . "<br>";
            if ($woman_cls) {
                $name = $woman_cls->person_name($woman);
                if (isset($genarray[$w]["spfams"]) and isset($genarray[$w]["spgednr"]) and isset($genarray[$w]["sps"])) {
                    if (CMS_SPECIFIC == 'Joomla') {
                        $extra_popup_text .= '<a href="index.php?option=com_humo-gen&task=family&id=' . $genarray[$w]["spfams"] . '&amp;main_person=' . $genarray[$w]["spgednr"] . '">' . '<strong>' . $name["standard_name"] . '</strong></a>';
                    } else {
                        $extra_popup_text .= '<a href="' . CMS_ROOTPATH . 'family.php?id=' . $genarray[$w]["spfams"] . '&amp;main_person=' . $genarray[$w]["spgednr"] . '">' . '<strong>' . $name["standard_name"] . '</strong></a>';
                    }
                } else {
                    $extra_popup_text .= $name["standard_name"];
                }
                if ($woman_privacy) {
                    $extra_popup_text .= __(' PRIVACY FILTER') . '<br>';
                    //Tekst privacy weergeven
                } else {
                    if ($woman->pers_birth_date or $woman->pers_birth_place) {
                        $extra_popup_text .= __('born') . $dirmark1 . ' ' . date_place($woman->pers_birth_date, $woman->pers_birth_place) . '<br>';
                    }
                    if ($woman->pers_death_date or $woman->pers_death_place) {
                        $extra_popup_text .= __('died ') . $dirmark1 . ' ' . date_place($woman->pers_death_date, $woman->pers_death_place) . '<br>';
                    }
                }
            } else {
                $extra_popup_text .= __('N.N.');
            }
        }
        echo $man_cls->person_popup_menu($man, true, $replacement_text, $extra_popup_text);
        echo '</div>';
        // div of square
        if ($direction == 0) {
            // if vertical
            // draw dotted line from first marriage to following marriages
            if (isset($genarray[$w]["2nd"]) and $genarray[$w]["2nd"] == 1) {
                $startx = $genarray[$w - 1]["x"] + $hsize + 2;
                $starty = $genarray[$w - 1]["y"] + $vsize / 2;
                $width = $genarray[$w]["x"] - ($genarray[$w - 1]["x"] + $hsize) - 2;
                print '<div style="position:absolute;border:1px blue dashed;height:2px;width:' . $width . 'px;left:' . $startx . 'px;top:' . $starty . 'px"></div>';
            }
            // draw line to children
            if ($genarray[$w]["nrc"] != 0) {
                $startx = $genarray[$w]["x"] + $hsize / 2;
                $starty = $genarray[$w]["y"] + $vsize + 2;
                print '<div class="chart_line" style="position:absolute; height:' . ($vdist / 2 - 2) . 'px; width:1px; left:' . $startx . 'px; top:' . $starty . 'px"></div>';
            }
            // draw line to parent
            if ($genarray[$w]["gen"] != 0 and $genarray[$w]["2nd"] != 1) {
                $startx = $genarray[$w]["x"] + $hsize / 2;
                $starty = $genarray[$w]["y"] - $vdist / 2;
                print '<div class="chart_line" style="position:absolute; height:' . $vdist / 2 . 'px;width:1px;left:' . $startx . 'px;top:' . $starty . 'px"></div>';
            }
            // draw horizontal line from 1st child in fam to last child in fam
            if ($genarray[$w]["gen"] != 0) {
                $parent = $genarray[$w]["par"];
                if ($genarray[$w]["chd"] == $genarray[$parent]["nrc"]) {
                    // last child in fam
                    $z = $w;
                    while ($genarray[$z]["2nd"] == 1) {
                        //if last is 2nd (3rd etc) marriage, the line has to stop at first marriage
                        $z--;
                    }
                    $startx = $genarray[$parent]["fst"] + $hsize / 2;
                    $starty = $genarray[$z]["y"] - $vdist / 2;
                    $width = $genarray[$z]["x"] - $genarray[$parent]["fst"];
                    print '<div class="chart_line" style="position:absolute; height:1px; width:' . $width . 'px; left:' . $startx . 'px; top:' . $starty . 'px"></div>';
                }
            }
        } else {
            // if horizontal
            // draw dotted line from first marriage to following marriages
            if (isset($genarray[$w]["2nd"]) and $genarray[$w]["2nd"] == 1) {
                $starty = $genarray[$w - 1]["y"] + $vsize + 2;
                $startx = $genarray[$w - 1]["x"] + $hsize / 2;
                $height = $genarray[$w]["y"] - ($genarray[$w - 1]["y"] + $vsize) - 2;
                print '<div style="position:absolute;border:1px blue dashed;height:' . $height . 'px; width:3px; left:' . $startx . 'px;top:' . $starty . 'px"></div>';
            }
            // draw line to children
            if ($genarray[$w]["nrc"] != 0) {
                $starty = $genarray[$w]["y"] + $vsize / 2;
                $startx = $genarray[$w]["x"] + $hsize + 3;
                print '<div class="chart_line" style="position:absolute; height:1px; width:' . ($hdist / 2 - 2) . 'px; left:' . $startx . 'px; top:' . $starty . 'px"></div>';
            }
            // draw line to parent
            if ($genarray[$w]["gen"] != 0 and $genarray[$w]["2nd"] != 1) {
                $starty = $genarray[$w]["y"] + $vsize / 2;
                $startx = $genarray[$w]["x"] - $hdist / 2;
                print '<div class="chart_line" style="position:absolute; width:' . $hdist / 2 . 'px; height:1px; left:' . $startx . 'px; top:' . $starty . 'px"></div>';
            }
            // draw vertical line from 1st child in fam to last child in fam
            if ($genarray[$w]["gen"] != 0) {
                $parent = $genarray[$w]["par"];
                if ($genarray[$w]["chd"] == $genarray[$parent]["nrc"]) {
                    // last child in fam
                    $z = $w;
                    while ($genarray[$z]["2nd"] == 1) {
                        //if last is 2nd (3rd etc) marriage, the line has to stop at first marriage
                        $z--;
                    }
                    $starty = $genarray[$parent]["fst"] + $vsize / 2;
                    $startx = $genarray[$z]["x"] - $hdist / 2;
                    $height = $genarray[$z]["y"] - $genarray[$parent]["fst"];
                    print '<div class="chart_line" style="position:absolute; width:1px; height:' . $height . 'px; left:' . $startx . 'px; top:' . $starty . 'px"></div>';
                }
            }
        }
        // end if horizontal
    }
    echo '</div>';
    // id=png
    print "<br><br></div>";
    // id=doublescroll
    // YB:
    // before creating the image we want to hide unnecessary items such as the help link, the menu box etc
    // we also have to set the width and height of the "png" div (this can't be set before because then the double scrollbars won't work
    // after generating the image, all those items are returned to their  previous state....
    echo '<script type="text/javascript">';
    if ($hourglass === false) {
        echo "\n\t\tfunction showimg() { \n\t\t\tdocument.getElementById('helppopup').style.visibility = 'hidden';\n\t\t\tdocument.getElementById('menubox').style.visibility = 'hidden';\n\t\t\tdocument.getElementById('imgbutton').style.visibility = 'hidden';\n\t\t\tdocument.getElementById('png').style.width = '" . $divlen . "px';\n\t\t\tdocument.getElementById('png').style.height= '" . $divhi . "px';\n\t\t\thtml2canvas( [ document.getElementById('png') ], {  \n\t\t\t\tonrendered: function( canvas ) {\n\t\t\t\t\tdocument.getElementById('helppopup').style.visibility = 'visible';\n\t\t\t\t\tdocument.getElementById('menubox').style.visibility = 'visible';\n\t\t\t\t\tdocument.getElementById('imgbutton').style.visibility = 'visible';\n\t\t\t\t\tvar img = canvas.toDataURL();\n\t\t\t\t\tdocument.getElementById('png').style.width = 'auto';\n\t\t\t\t\tdocument.getElementById('png').style.height= 'auto';\n\t\t\t\t\tvar newWin = window.open();\n\t\tnewWin.document.open();\n\t\tnewWin.document.write('<!DOCTYPE html><head></head><body>" . __('Right click on the image below and save it as a .png file to your computer.<br>You can then print it over multiple pages with dedicated third-party programs, such as the free: ') . "<a href=\"http://posterazor.sourceforge.net/index.php?page=download&lang=english\" target=\"_blank\">\"PosteRazor\"</a><br>" . __('If you have a plotter you can use its software to print the image on one large sheet.') . "<br><br><img src=\"' + img + '\"></body></html>');\n\t\tnewWin.document.close();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t";
    } else {
        echo "\n\t\tfunction showimg() { \n\t\t\tdocument.getElementById('png').style.width = '" . $divlen . "px';\n\t\t\tdocument.getElementById('png').style.height= '" . $divhi . "px';\n\t\t\thtml2canvas( [ document.getElementById('png') ], {  \n\t\t\t\tonrendered: function( canvas ) {\n\t\t\t\tvar img = canvas.toDataURL();\n\t\t\t\tdocument.getElementById('png').style.width = 'auto';\n\t\t\t\tdocument.getElementById('png').style.height= 'auto';\n\t\t\t\tvar newWin = window.open();\n\t\tnewWin.document.open();\n\t\tnewWin.document.write('<!DOCTYPE html><head></head><body>" . __('Right click on the image below and save it as a .png file to your computer.<br>You can then print it over multiple pages with dedicated third-party programs, such as the free: ') . "<a href=\"http://posterazor.sourceforge.net/index.php?page=download&lang=english\" target=\"_blank\">\"PosteRazor\"</a><br>" . __('If you have a plotter you can use its software to print the image on one large sheet.') . "<br><br><img src=\"' + img + '\"></body></html>');\n\t\tnewWin.document.close();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t";
    }
    echo "</script>";
    ?>
	<script type='text/javascript'>
		function DoubleScroll(element) {
			var scrollbar= document.createElement('div');
			scrollbar.appendChild(document.createElement('div'));
			scrollbar.style.overflow= 'auto';
			scrollbar.style.overflowY= 'hidden';
			scrollbar.firstChild.style.width= element.scrollWidth+'px';
			scrollbar.firstChild.style.paddingTop= '1px';
			scrollbar.firstChild.style.height= '20px';
			scrollbar.firstChild.appendChild(document.createTextNode('\xA0'));
			scrollbar.onscroll= function() {
				element.scrollLeft= scrollbar.scrollLeft;
			};
			element.onscroll= function() {
				scrollbar.scrollLeft= element.scrollLeft;
			};
			element.parentNode.insertBefore(scrollbar, element);
		}

		DoubleScroll(document.getElementById('doublescroll'));
	</script>
<?php 
    // here place div at bottom so there is some space under last boxes
    $last = count($genarray) - 1;
    $putit = $genarray[$last]["y"] + 130;
    print '<div style="position:absolute;left:1px;top:' . $putit . 'px;">&nbsp; </div>';
}
} else {
    echo '<div style="height:400px; width:60%; margin-right: 20%; overflow-y: scroll;">';
}
echo '<table class="humo" width="99%">';
echo '<tr class=table_headline>';
echo '<th style="font-size: 90%; text-align: left">' . __('Changed/ Added') . '</th>';
echo '<th style="font-size: 90%; text-align: left">' . __('When changed') . '</th>';
echo '<th style="font-size: 90%; text-align: left">' . __('When added') . '</th>';
echo '</tr>';
$rowcounter = 0;
while (@($person = $person_result->fetch(PDO::FETCH_OBJ))) {
    $rowcounter++;
    echo '<tr>';
    echo '<td style="font-size: 90%">';
    $person_cls->construct($person);
    echo $person_cls->person_popup_menu($person);
    if ($person->pers_sexe == "M") {
        echo '<img src="' . CMS_ROOTPATH . 'images/man.gif" alt="man">';
    } elseif ($person->pers_sexe == "F") {
        echo '<img src="' . CMS_ROOTPATH . 'images/woman.gif" alt="woman">';
    } else {
        echo '<img src="' . CMS_ROOTPATH . 'images/unknown.gif" alt="unknown">';
    }
    echo '<a href="' . CMS_ROOTPATH . 'family.php?database=' . $_SESSION['tree_prefix'] . '&amp;id=' . $person->pers_indexnr . '&amp;main_person=' . $person->pers_gedcomnumber . '">';
    $name = $person_cls->person_name($person);
    echo $name["standard_name"];
    echo '</a>';
    echo '</td><td style="font-size: 90%">';
    echo '<span style="white-space: nowrap">' . strtolower($person->pers_changed_date) . ' - ' . $person->pers_changed_time . '</span>';
    echo '</td><td style="font-size: 90%">';
    echo '<span style="white-space: nowrap">' . strtolower($person->pers_new_date) . ' - ' . $person->pers_new_time . '</span></td>';
function show_person($familyDb)
{
    global $dbh, $db_functions, $tree_id, $selected_place, $language, $user;
    global $bot_visit, $humo_option, $uri_path, $search_database, $list_expanded;
    global $selected_language, $privacy, $dirmark1, $dirmark2, $rtlmarker;
    global $select_marriage_notice, $select_marriage, $select_marriage_notice_religious, $select_marriage_religious;
    if ($familyDb->fam_man) {
        $selected_person1 = $familyDb->fam_man;
    } else {
        $selected_person1 = $familyDb->fam_woman;
    }
    $personDb = $db_functions->get_person($selected_person1);
    $pers_tree_prefix = $personDb->pers_tree_prefix;
    //if (CMS_SPECIFIC=='Joomla'){
    //	$start_url='index.php?option=com_humo-gen&amp;task=family&amp;database='.$pers_tree_prefix.
    //		'&amp;id='.$personDb->pers_indexnr.'&amp;main_person='.$personDb->pers_gedcomnumber;
    //}
    //else
    if ($humo_option["url_rewrite"] == "j") {
        // *** url_rewrite ***
        // *** $uri_path made in header.php ***
        $start_url = $uri_path . 'family/' . $pers_tree_prefix . '/' . $personDb->pers_indexnr . '/' . $personDb->pers_gedcomnumber . '/';
    } else {
        $start_url = CMS_ROOTPATH . 'family.php?database=' . $pers_tree_prefix . '&amp;id=' . $personDb->pers_indexnr . '&amp;main_person=' . $personDb->pers_gedcomnumber;
    }
    // *** Person class used for name and person pop-up data ***
    $person_cls = new person_cls();
    $person_cls->construct($personDb);
    $privacy = $person_cls->privacy;
    $name = $person_cls->person_name($personDb);
    // *** Show name ***
    $index_name = '';
    if ($name["show_name"] == false) {
        $index_name = __('Name filtered');
    } else {
        // *** If there is no lastname, show a - character. ***
        if ($personDb->pers_lastname == "") {
            // Don't show a "-" by pers_patronymes
            if (!isset($_GET['pers_patronym'])) {
                $index_name = "-&nbsp;&nbsp;";
            }
        }
        $index_name .= $name["index_name_extended"] . $name["colour_mark"];
    }
    // *** Show extra colums before a person in index places ***
    if ($selected_place != $familyDb->place_order) {
        echo '<td colspan="7"><b>' . $dirmark2 . "{$familyDb->place_order}</b></td></tr><tr>";
    }
    $selected_place = $familyDb->place_order;
    echo '<td valign="top" style="white-space:nowrap;width:90px">';
    if ($select_marriage_notice == '1') {
        if ($selected_place == $familyDb->fam_marr_notice_place) {
            echo '<span class="place_index place_index_selected">' . __('&infin;') . '</span>';
        } else {
            echo '<span class="place_index">&nbsp;</span>';
        }
    }
    if ($select_marriage_notice_religious == '1') {
        if ($selected_place == $familyDb->fam_marr_church_notice_place) {
            echo '<span class="place_index place_index_selected">' . __('o') . '</span>';
        } else {
            echo '<span class="place_index">&nbsp;</span>';
        }
    }
    if ($select_marriage == '1') {
        if ($selected_place == $familyDb->fam_marr_place) {
            echo '<span class="place_index place_index_selected">' . __('X') . '</span>';
        } else {
            echo '<span class="place_index">&nbsp;</span>';
        }
    }
    if ($select_marriage_religious == '1') {
        if ($selected_place == $familyDb->fam_marr_church_place) {
            echo '<span class="place_index place_index_selected">' . __('x') . '</span>';
        } else {
            echo '<span class="place_index">&nbsp;</span>';
        }
    }
    echo '</td>';
    echo '<td valign="top" style="border-right:0px; white-space:nowrap;">';
    // *** Show person popup menu ***
    echo $person_cls->person_popup_menu($personDb);
    // *** Show picture man or wife ***
    if ($personDb->pers_sexe == "M") {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/man.gif" alt="man" style="vertical-align:top">';
    } elseif ($personDb->pers_sexe == "F") {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/woman.gif" alt="woman" style="vertical-align:top">';
    } else {
        echo $dirmark1 . ' <img src="' . CMS_ROOTPATH . 'images/unknown.gif" alt="unknown" style="vertical-align:top">';
    }
    echo '</td><td style="border-left:0px;">';
    // *** Show name of person ***
    echo ' <a href="' . $start_url . '">' . rtrim($index_name) . '</a>';
    //*** Show spouse/ partner ***
    if ($list_expanded == true and $personDb->pers_fams) {
        $marriage_array = explode(";", $personDb->pers_fams);
        // *** Code to show only last marriage ***
        $nr_marriages = count($marriage_array);
        for ($x = 0; $x <= $nr_marriages - 1; $x++) {
            $fam_partnerDb = $db_functions->get_family($marriage_array[$x]);
            // *** This check is better then a check like: $personDb->pers_sexe=='F', because of unknown sexe or homosexual relations. ***
            if ($personDb->pers_gedcomnumber == $fam_partnerDb->fam_man) {
                $partner_id = $fam_partnerDb->fam_woman;
            } else {
                $partner_id = $fam_partnerDb->fam_man;
            }
            $relation_short = __('&amp;');
            if ($fam_partnerDb->fam_marr_date or $fam_partnerDb->fam_marr_place or $fam_partnerDb->fam_marr_church_date or $fam_partnerDb->fam_marr_church_place) {
                $relation_short = __('X');
            }
            if ($fam_partnerDb->fam_div_date or $fam_partnerDb->fam_div_place) {
                $relation_short = __(') (');
            }
            if ($partner_id != '0' and $partner_id != '') {
                $partnerDb = $db_functions->get_person($partner_id);
                $partner_cls = new person_cls();
                $privacy2 = $person_cls->privacy;
                $name = $partner_cls->person_name($partnerDb);
            } else {
                $name["standard_name"] = __('N.N.');
            }
            if ($nr_marriages > 1) {
                echo ',';
            }
            if (@$partnerDb->pers_gedcomnumber != $familyDb->fam_woman) {
                // *** Show actual relation/ marriage in special font ***
                echo ' <span class="index_partner" style="font-size:10px;">';
            } else {
                echo ' ';
            }
            if ($nr_marriages > 1) {
                if ($x == 0) {
                    echo __('1st');
                } elseif ($x == 1) {
                    echo ' ' . __('2nd');
                } elseif ($x == 2) {
                    echo ' ' . __('3rd');
                } elseif ($x > 2) {
                    echo ' ' . ($x + 1) . __('th');
                }
            }
            echo ' ' . $relation_short . ' ' . rtrim($name["standard_name"]);
            if (@$partnerDb->pers_gedcomnumber != $familyDb->fam_woman) {
                echo '</span>';
            }
        }
    }
    // *** End spouse/ partner ***
    echo '</td><td style="white-space:nowrap;">';
    $info = "";
    if ($familyDb->fam_marr_church_notice_date) {
        $info = __('o') . ' ' . date_place($familyDb->fam_marr_church_notice_date, '');
    }
    if ($familyDb->fam_marr_notice_date) {
        $info = __('&infin;') . ' ' . date_place($familyDb->fam_marr_notice_date, '');
    }
    //echo "<span style='font-size:90%'>".$info.$dirmark1."</span>";
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td>';
    $info = "";
    if ($familyDb->fam_marr_church_notice_place) {
        $info = __('o') . ' ' . $familyDb->fam_marr_church_notice_place;
    }
    if ($familyDb->fam_marr_notice_place) {
        $info = __('&infin;') . ' ' . $familyDb->fam_marr_notice_place;
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td style="white-space:nowrap;">';
    $info = "";
    if ($familyDb->fam_marr_church_date) {
        $info = __('x') . ' ' . date_place($familyDb->fam_marr_church_date, '');
    }
    if ($familyDb->fam_marr_date) {
        $info = __('X') . ' ' . date_place($familyDb->fam_marr_date, '');
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td><td>';
    $info = "";
    if ($familyDb->fam_marr_church_place) {
        $info = __('x') . ' ' . $familyDb->fam_marr_church_place;
    }
    if ($familyDb->fam_marr_place) {
        $info = __('X') . ' ' . $familyDb->fam_marr_place;
    }
    if ($privacy == 1 and $info) {
        echo ' ' . __('PRIVACY FILTER');
    } else {
        echo $info;
    }
    echo '</td></tr>';
}
 function ancestor_chart_person($id, $box_appearance)
 {
     global $dbh, $db_functions, $tree_prefix_quoted, $humo_option, $user;
     global $marr_date_array, $marr_place_array;
     global $gedcomnumber, $language, $screen_mode, $dirmark1, $dirmark2;
     $hour_value = '';
     // if called from hourglass.php size of chart is given in box_appearance as "hour45" etc.
     if (strpos($box_appearance, "hour") !== false) {
         $hour_value = substr($box_appearance, 4);
     }
     $text = '';
     $popup = '';
     if ($gedcomnumber[$id]) {
         @($personDb = $db_functions->get_person($gedcomnumber[$id]));
         $person_cls = new person_cls();
         $person_cls->construct($personDb);
         $pers_privacy = $person_cls->privacy;
         $name = $person_cls->person_name($personDb);
         if ($screen_mode == "ancestor_sheet" or $language["dir"] == "rtl") {
             $name2 = $name["name"];
         } else {
             //$name2=$name["short_firstname"];
             $name2 = $name["name"];
         }
         $name2 = $dirmark2 . $name2 . $name["colour_mark"] . $dirmark2;
         // *** Replace pop-up icon by a text box ***
         $replacement_text = '';
         if ($screen_mode == "ancestor_sheet") {
             // *** Ancestor sheet: name bold, id not ***
             //$replacement_text.=$id.' <b>'.$name2.'</b>';
             $replacement_text .= '<b>' . $name2 . '</b>';
         } else {
             //$replacement_text.='<b>'.$id.'</b>';  // *** Ancestor number: id bold, name not ***
             $replacement_text .= '<span class="anc_box_name">' . $name2 . '</span>';
         }
         // >>>>> link to show rest of ancestor chart
         //if ($box_appearance=='small' AND isset($personDb->pers_gedcomnumber) AND $screen_mode!="ancestor_sheet"){
         if ($box_appearance == 'small' and isset($personDb->pers_gedcomnumber) and $personDb->pers_famc and $screen_mode != "ancestor_sheet") {
             //$replacement_text.= ' <a href="'.$_SERVER['PHP_SELF'].'?id='.$personDb->pers_gedcomnumber.
             //	"&amp;screen_mode=ancestor_chart\">&gt;&gt;&gt;</a> ";
             $replacement_text .= ' &gt;&gt;&gt;' . $dirmark1;
         }
         if ($pers_privacy) {
             if ($box_appearance != 'ancestor_sheet_marr') {
                 $replacement_text .= '<br>' . __(' PRIVACY FILTER');
                 //Tekst privacy weergeven
             } else {
                 $replacement_text = __(' PRIVACY FILTER');
             }
         } else {
             if ($box_appearance != 'small') {
                 //if ($personDb->pers_birth_date OR $personDb->pers_birth_place){
                 if ($personDb->pers_birth_date) {
                     //$replacement_text.='<br>'.__('*').$dirmark1.' '.date_place($personDb->pers_birth_date,$personDb->pers_birth_place); }
                     $replacement_text .= '<br>' . __('*') . $dirmark1 . ' ' . date_place($personDb->pers_birth_date, '');
                 } elseif ($personDb->pers_bapt_date) {
                     //$replacement_text.='<br>'.__('~').$dirmark1.' '.date_place($personDb->pers_bapt_date,$personDb->pers_bapt_place); }
                     $replacement_text .= '<br>' . __('~') . $dirmark1 . ' ' . date_place($personDb->pers_bapt_date, '');
                 }
                 //if ($personDb->pers_death_date OR $personDb->pers_death_place){
                 if ($personDb->pers_death_date) {
                     //$replacement_text.='<br>'.__('&#134;').$dirmark1.' '.date_place($personDb->pers_death_date,$personDb->pers_death_place); }
                     $replacement_text .= '<br>' . __('&#134;') . $dirmark1 . ' ' . date_place($personDb->pers_death_date, '');
                 } elseif ($personDb->pers_buried_date) {
                     //$replacement_text.='<br>'.__('[]').$dirmark1.' '.date_place($personDb->pers_buried_date,$personDb->pers_buried_place); }
                     $replacement_text .= '<br>' . __('[]') . $dirmark1 . ' ' . date_place($personDb->pers_buried_date, '');
                 }
                 if ($box_appearance != 'medium') {
                     $marr_date = '';
                     if (isset($marr_date_array[$id]) and $marr_date_array[$id] != '') {
                         $marr_date = $marr_date_array[$id];
                     }
                     $marr_place = '';
                     if (isset($marr_place_array[$id]) and $marr_place_array[$id] != '') {
                         $marr_place = $marr_place_array[$id];
                     }
                     //if ($marr_date OR $marr_place){
                     if ($marr_date) {
                         //$replacement_text.='<br>'.__('X').$dirmark1.' '.date_place($marr_date,$marr_place); }
                         $replacement_text .= '<br>' . __('X') . $dirmark1 . ' ' . date_place($marr_date, '');
                     }
                 }
                 if ($box_appearance == 'ancestor_sheet_marr') {
                     $replacement_text = '';
                     $marr_date = '';
                     if (isset($marr_date_array[$id]) and $marr_date_array[$id] != '') {
                         $marr_date = $marr_date_array[$id];
                     }
                     $marr_place = '';
                     if (isset($marr_place_array[$id]) and $marr_place_array[$id] != '') {
                         $marr_place = $marr_place_array[$id];
                     }
                     //if ($marr_date OR $marr_place){
                     if ($marr_date) {
                         //$replacement_text=__('X').$dirmark1.' '.date_place($marr_date,$marr_place); }
                         $replacement_text = __('X') . $dirmark1 . ' ' . date_place($marr_date, '');
                     } else {
                         $replacement_text = __('X');
                     }
                     // if no details in the row we don't want the row to collapse
                 }
                 if ($box_appearance == 'ancestor_header') {
                     $replacement_text = '';
                     $replacement_text .= strip_tags($name2);
                     $replacement_text .= $dirmark2;
                 }
             }
         }
         if ($hour_value != '') {
             // called from hourglass
             if ($hour_value == '45') {
                 $replacement_text = $name['name'];
             } elseif ($hour_value == '40') {
                 $replacement_text = '<span class="wordwrap" style="font-size:75%">' . $name['short_firstname'] . '</span>';
             } elseif ($hour_value > 20 and $hour_value < 40) {
                 $replacement_text = $name['initials'];
             } elseif ($hour_value < 25) {
                 $replacement_text = "&nbsp;";
             }
             // if full scale (50) then the default of this function will be used: name with details
         }
         $extra_popup_text = '';
         $marr_date = '';
         if (isset($marr_date_array[$id]) and $marr_date_array[$id] != '') {
             $marr_date = $marr_date_array[$id];
         }
         $marr_place = '';
         if (isset($marr_place_array[$id]) and $marr_place_array[$id] != '') {
             $marr_place = $marr_place_array[$id];
         }
         if ($marr_date or $marr_place) {
             $extra_popup_text .= '<br>' . __('X') . $dirmark1 . ' ' . date_place($marr_date, $marr_place);
         }
         // *** Show picture by person ***
         if ($box_appearance != 'small' and $box_appearance != 'medium') {
             // *** Show picture ***
             if (!$pers_privacy and $user['group_pictures'] == 'j') {
                 //  *** Path can be changed per family tree ***
                 global $dataDb;
                 $tree_pict_path = $dataDb->tree_pict_path;
                 $picture_qry = $db_functions->get_events_person($personDb->pers_gedcomnumber, 'picture');
                 // *** Only show 1st picture ***
                 if (isset($picture_qry[0])) {
                     $pictureDb = $picture_qry[0];
                     $picture = show_picture($tree_pict_path, $pictureDb->event_event, 80, 70);
                     $text .= '<img src="' . $tree_pict_path . $picture['thumb'] . $picture['picture'] . '" style="float:left; margin:5px;" alt="' . $pictureDb->event_text . '" width="' . $picture['width'] . '">';
                 }
             }
         }
         if ($box_appearance == 'ancestor_sheet_marr' or $box_appearance == 'ancestor_header') {
             // cause in that case there is no link
             $text .= $replacement_text;
         } else {
             $text .= $person_cls->person_popup_menu($personDb, true, $replacement_text, $extra_popup_text);
         }
     }
     return $text . "\n";
 }