</form>'; echo '<h4>Публикации:</h4>'; if (isset($_POST['upload'])) { $name = $_POST['name']; $picture = $_FILES['picture']['tmp_name']; publish($conn, $_SESSION['user_id'], $name, $picture); header('Location: published.php'); } $pub = show_publications($_SESSION['user_id'], $conn); for ($i = count($pub['PDATE']) - 1; $i >= 0; $i--) { echo substr($pub['PDATE'][$i], 0, -15) . '</br>' . substr($pub['PDATE'][$i], 9, -7) . ' <b>' . $pub['NAME'][$i] . '</b> <a href="profile.php?d_p_id=' . $pub['ID'][$i] . '">(удалить)</a></br>'; #$row = show_picture($pub['ID'][$i], $conn); #$img = $row->load(); #print('<img src="data:image/png;base64,'.base64_encode($img).'" />'); $source = show_picture($pub['ID'][$i], $conn); $img1 = $source->load(); print '<img src="data:image/png;base64,' . base64_encode($img1) . '" />'; } if (isset($_GET['d_p_id'])) { delete_publication($_GET['d_p_id'], $conn); header('Location/profile.php'); } } else { echo ' <html> <body> <h1>Социальная сеть</h1> <a href="index.php">Войти</a> </body> </html>';
function person_popup_menu($personDb, $extended = false, $replacement_text = '', $extra_popup_text = '') { global $dbh, $tree_prefix_quoted, $db_functions, $bot_visit, $humo_option, $uri_path, $user, $language; global $screen_mode, $dirmark1, $dirmark2, $rtlmarker; global $selected_language, $hourglass; $text = ''; $privacy = $this->privacy; // *** Show pop-up menu *** if (!$bot_visit and $screen_mode != "PDF" and $screen_mode != "RTF") { // *** Family tree for search in multiple family trees *** $tree_prefix = safe_text($personDb->pers_tree_prefix); $db_functions->set_tree_prefix($tree_prefix); if (CMS_SPECIFIC == 'Joomla') { $start_url = 'index.php?option=com_humo-gen&task=family&database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber; } elseif ($humo_option["url_rewrite"] == "j") { // *** $uri_path made in header.php *** $start_url = $uri_path . 'family/' . $tree_prefix . '/' . $personDb->pers_indexnr . '/' . $personDb->pers_gedcomnumber . '/'; } else { $start_url = CMS_ROOTPATH . 'family.php?database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber; } $family_url = $start_url; // *** Change start url for a person in a graphical ancestor report *** if ($screen_mode == 'ancestor_chart' and $hourglass === false) { if (CMS_SPECIFIC == 'Joomla') { $start_url = 'index.php?option=com_humo-gen&task=ancestor&database=' . $tree_prefix . '&id=' . $personDb->pers_gedcomnumber . '&screen_mode=ancestor_chart'; } else { $start_url = CMS_ROOTPATH . 'report_ancestor.php?database=' . $tree_prefix . '&id=' . $personDb->pers_gedcomnumber . '&screen_mode=ancestor_chart'; } } // *** Change start url for a person in a graphical descendant report *** if (($screen_mode == 'STAR' or $screen_mode == 'STARSIZE') and $hourglass === false) { if (CMS_SPECIFIC == 'Joomla') { $start_url = 'index.php?option=com_humo-gen&task=family&database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&screen_mode=STAR'; } else { $start_url = CMS_ROOTPATH . 'family.php?database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&screen_mode=STAR'; } } // *** Change start url for a person in an hourglass chart *** if (($screen_mode == 'STAR' or $screen_mode == 'STARSIZE' or $screen_mode == 'ancestor_chart') and $hourglass === true) { if (CMS_SPECIFIC == 'Joomla') { $start_url = 'index.php?option=com_humo-gen&task=hourglass&database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&screen_mode=HOUR'; } else { $start_url = CMS_ROOTPATH . 'hourglass.php?database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&screen_mode=HOUR'; } } $text .= '<div class="' . $rtlmarker . 'sddm" style="display:inline;">' . "\n"; $text .= '<a href="' . $start_url . '"'; if ($extended) { //$text.= ' class="nam" style="font-size:9px; text-align:center; display:block; width:100%; height:100%" '; $text .= ' class="nam" style="z-index:100;font-size:10px; display:block; width:100%; height:100%" '; } $random_nr = rand(); // *** Generate a random number to avoid double numbers *** $text .= ' onmouseover="mopen(event,\'m1' . $random_nr . $personDb->pers_gedcomnumber . '\',0,0)"'; $text .= ' onmouseout="mclosetime()">'; if ($replacement_text) { $text .= $replacement_text; } else { $text .= '<img src="' . CMS_ROOTPATH . 'images/reports.gif" border="0" alt="reports">'; } $text .= '</a>'; // *** Remove standard background color from links *** //echo ' //<style> //.ltrsddm div a{ background:none; } //</style> //'; // *** Added style="z-index:40;" for ancestor and descendant report *** $text .= '<div style="z-index:40; border:1px solid #999999;" id="m1' . $random_nr . $personDb->pers_gedcomnumber . '" class="sddm_fixed person_popup" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">'; $name = $this->person_name($personDb); //$text.=$dirmark2.'<span style="font-size:14px; font-weight:bold; color:blue;">'.$name["standard_name"].$name["colour_mark"].'</span><br>'; $text .= $dirmark2 . '<span style="font-size:13px; font-weight:bold; color:blue;">' . $name["standard_name"] . $name["colour_mark"] . '</span><br>'; if ($extended) { $text .= '<table><tr><td style="width:auto; border: solid 0px; border-right:solid 1px #999999;">'; } $text .= '<b>' . __('Text reports') . ':</b>'; $text .= $dirmark1 . '<a href="' . $family_url . '"><img src="' . CMS_ROOTPATH . 'images/family.gif" border="0" alt="' . __('Family group sheet') . '"> ' . __('Family group sheet') . '</a>'; if ($user['group_gen_protection'] == 'n' and $personDb->pers_fams != '') { // *** Only show a descendant_report icon if there are children *** $check_children = false; $check_family = explode(";", $personDb->pers_fams); for ($i = 0; $i <= substr_count($personDb->pers_fams, ";"); $i++) { //@$check_childrenDb=$db_functions->get_family($check_family[$i]); @($check_childrenDb = $db_functions->get_family($check_family[$i])); if ($check_childrenDb->fam_children) { $check_children = true; } } if ($check_children) { if (CMS_SPECIFIC == 'Joomla') { $path_tmp = 'index.php?option=com_humo-gen&task=family&database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&descendant_report=1'; } else { $path_tmp = CMS_ROOTPATH . 'family.php?database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&descendant_report=1'; } $text .= '<a href="' . $path_tmp . '"><img src="' . CMS_ROOTPATH . 'images/descendant.gif" border="0" alt="' . __('Descendant report') . '"> ' . __('Descendant report') . '</a>'; if (CMS_SPECIFIC == 'Joomla') { $path_tmp = 'index.php?option=com_humo-gen&task=outline&database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&descendant_report=1'; } else { $path_tmp = CMS_ROOTPATH . 'report_outline.php?database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber; } $text .= '<a href="' . $path_tmp . '"><img src="' . CMS_ROOTPATH . 'images/outline.gif" border="0" alt="' . __('Outline report') . '"> ' . __('Outline report') . '</a>'; } } if ($user['group_gen_protection'] == 'n' and $personDb->pers_famc != '') { // == Ancestor report: link & icons by Klaas de Winkel (www.dewinkelwaar.tk) == if (CMS_SPECIFIC == 'Joomla') { $path_tmp = 'index.php?option=com_humo-gen&task=ancestor&database=' . $tree_prefix . '&id=' . $personDb->pers_gedcomnumber; } else { $path_tmp = CMS_ROOTPATH . 'report_ancestor.php?database=' . $tree_prefix . '&id=' . $personDb->pers_gedcomnumber; } $text .= '<a href="' . $path_tmp . '"><img src="' . CMS_ROOTPATH . 'images/ancestor_report.gif" border="0" alt="' . __('Ancestor report') . '"> ' . __('Ancestor report') . '</a>'; $text .= '<a href="' . $path_tmp . '&screen_mode=ancestor_sheet"><img src="' . CMS_ROOTPATH . 'images/ancestor_chart.gif" border="0" alt="' . __('Ancestor sheet') . '"> ' . __('Ancestor sheet') . '</a>'; } if ($user['group_gen_protection'] == 'n' and ($personDb->pers_famc != '' or $personDb->pers_fams != '')) { $text .= '<b>' . __('Charts') . ':</b>'; } if ($user['group_gen_protection'] == 'n' and $personDb->pers_famc != '') { // == added by Yossi Beck - FANCHART if (CMS_SPECIFIC == 'Joomla') { $path_tmp = 'index.php?option=com_humo-gen&task=fanchart&database=' . $tree_prefix . '&id=' . $personDb->pers_gedcomnumber; } else { $path_tmp = CMS_ROOTPATH . 'fanchart.php?database=' . $tree_prefix . '&id=' . $personDb->pers_gedcomnumber; } $text .= '<a href="' . $path_tmp . '"><img src="' . CMS_ROOTPATH . 'images/fanchart.gif" border="0" alt="Fanchart"> ' . __('Fanchart') . '</a>'; if (CMS_SPECIFIC == 'Joomla') { $path_tmp = 'index.php?option=com_humo-gen&task=ancestor&database=' . $tree_prefix . '&id=' . $personDb->pers_gedcomnumber . '&screen_mode=ancestor_chart'; } else { $path_tmp = CMS_ROOTPATH . 'report_ancestor.php?database=' . $tree_prefix . '&id=' . $personDb->pers_gedcomnumber . '&screen_mode=ancestor_chart'; } $text .= '<a href="' . $path_tmp . '"><img src="' . CMS_ROOTPATH . 'images/ancestor_report.gif" border="0" alt="' . __('Ancestor chart') . '"> ' . __('Ancestor chart') . '</a>'; } if ($user['group_gen_protection'] == 'n' and $personDb->pers_fams != '') { if ($check_children) { if (CMS_SPECIFIC == 'Joomla') { $path_tmp = 'index.php?option=com_humo-gen&task=family&database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&screen_mode=STAR'; } else { $path_tmp = CMS_ROOTPATH . 'family.php?database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&screen_mode=STAR'; } $text .= '<a href="' . $path_tmp . '"><img src="' . CMS_ROOTPATH . 'images/descendant.gif" border="0" alt="' . __('Descendant chart') . '"> ' . __('Descendant chart') . '</a>'; } } // DNA charts if ($user['group_gen_protection'] == 'n' and ($personDb->pers_famc != "" or $personDb->pers_fams != "" and $check_children)) { //if ($check_children){ //if($personDb->pers_sexe=="M") $charttype="ydnamark"; //else $charttype="mtdnamark"; if ($personDb->pers_sexe == "M") { $charttype = "ydna"; } else { $charttype = "mtdna"; } if (CMS_SPECIFIC == 'Joomla') { $path_tmp = 'index.php?option=com_humo-gen&task=family&database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&screen_mode=STAR&dnachart=' . $charttype; } else { $path_tmp = CMS_ROOTPATH . 'family.php?database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&screen_mode=STAR&dnachart=' . $charttype; } $text .= '<a href="' . $path_tmp . '"><img src="' . CMS_ROOTPATH . 'images/dna.png" border="0" alt="' . __('DNA Charts') . '"> ' . __('DNA Charts') . '</a>'; //} } if ($user['group_gen_protection'] == 'n' and $personDb->pers_famc != '' and $personDb->pers_fams != '' and $check_children) { // hourglass only if there is at least one generation of ancestors and of children. if (CMS_SPECIFIC == 'Joomla') { //$path_tmp='index.php?option=com_humo-gen&task=hourglass&database='.$tree_prefix.'&id='.$personDb->pers_gedcomnumber; $path_tmp = 'index.php?option=com_humo-gen&task=hourglass&database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&screen_mode=HOUR'; } else { //$path_tmp=CMS_ROOTPATH.'hourglass.php?database='.$tree_prefix.'&id='.$personDb->pers_gedcomnumber; $path_tmp = CMS_ROOTPATH . 'hourglass.php?database=' . $tree_prefix . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '&screen_mode=HOUR'; } $text .= '<a href="' . $path_tmp . '"><img src="' . CMS_ROOTPATH . 'images/hourglass.gif" border="0" alt="' . __('Hourglass chart') . '"> ' . __('Hourglass chart') . '</a>'; } // check for timeline folder and tml files if ($privacy == '') { $tmlcounter = 0; $tmldir = CMS_ROOTPATH . "languages/" . $selected_language . "/timelines"; if (file_exists($tmldir)) { $dh = opendir(CMS_ROOTPATH . "languages/" . $selected_language . "/timelines"); while (false !== ($filename = readdir($dh))) { if (strtolower(substr($filename, -3)) == "txt") { $tmlcounter++; } } } $tmldates = 0; if ($personDb->pers_birth_date or $personDb->pers_bapt_date or $personDb->pers_death_date or $personDb->pers_buried_date or $personDb->pers_fams) { $tmldates = 1; } if ($user['group_gen_protection'] == 'n' and $tmlcounter > 0 and $tmldates == 1) { if (CMS_SPECIFIC == 'Joomla') { $path_tmp = 'index.php?option=com_humo-gen&task=timelines&database=' . $tree_prefix . '&id=' . $personDb->pers_gedcomnumber; } else { $path_tmp = CMS_ROOTPATH . 'timelines.php?database=' . $tree_prefix . '&id=' . $personDb->pers_gedcomnumber; } $text .= '<a href="' . $path_tmp . '">'; $text .= '<img src="' . CMS_ROOTPATH . 'images/timeline.gif" border="0" alt="' . __('Timeline') . '"> ' . __('Timeline') . '</a>'; } } // *** Editor link *** //if ($user['group_editor']=='j' OR $user['group_admin']=='j') { if ($user['group_edit_trees'] or $user['group_admin'] == 'j') { $edit_tree_array = explode(";", $user['group_edit_trees']); // *** Administrator can always edit in all family trees *** if ($user['group_admin'] == 'j' or in_array($_SESSION['tree_id'], $edit_tree_array)) { $text .= '<b>' . __('Admin') . ':</b>'; $path_tmp = CMS_ROOTPATH . 'admin/index.php?page=editor&tree=' . $tree_prefix . '&person=' . $personDb->pers_gedcomnumber; $text .= '<a href="' . $path_tmp . '" target="_blank">'; $text .= '<img src="' . CMS_ROOTPATH . 'images/person_edit.gif" border="0" alt="' . __('Timeline') . '"> ' . __('Editor') . '</a>'; } } // *** Show person picture and person data at right side of the pop-up box *** if ($extended) { $text .= '</td><td style="width:auto; border: solid 0px; font-size: 10px;" valign="top">'; // *** Show picture in pop-up box *** if (!$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, '', 120); $text .= '<img src="' . $tree_pict_path . $picture['thumb'] . $picture['picture'] . '" style="margin-left:10px; margin-top:5px;" alt="' . $pictureDb->event_text . '" height="' . $picture['height'] . '">'; $text .= '<br>'; } } // *** Pop-up tekst *** if ($privacy == '') { if ($personDb->pers_birth_date or $personDb->pers_birth_place) { $text .= __('*') . $dirmark1 . ' ' . date_place($personDb->pers_birth_date, $personDb->pers_birth_place); } elseif ($personDb->pers_bapt_date or $personDb->pers_bapt_place) { $text .= __('~') . $dirmark1 . ' ' . date_place($personDb->pers_bapt_date, $personDb->pers_bapt_place); } if ($personDb->pers_death_date or $personDb->pers_death_place) { $text .= '<br>' . __('†') . $dirmark1 . ' ' . date_place($personDb->pers_death_date, $personDb->pers_death_place); } elseif ($personDb->pers_buried_date or $personDb->pers_buried_place) { $text .= '<br>' . __('[]') . $dirmark1 . ' ' . date_place($personDb->pers_buried_date, $personDb->pers_buried_place); } // *** If needed add extra text in the pop-up box *** if ($extra_popup_text) { $text .= $extra_popup_text; } } else { $text .= ' ' . __('PRIVACY FILTER'); } $text .= '</td></tr></table>'; } // *** End of extended pop-up *** $text .= $dirmark1 . '</div>'; $text .= '</div>' . "\n"; } // end "if not pdf" return $text; }
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> '; //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;"> </span> ' . __('Male') . '</br>'; echo '<span style="background-image: linear-gradient(to bottom, #ffffff 0%, #f5bca9 100%); border:1px brown solid;"> </span> ' . __('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;"> </span> ' . __('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;"> </span> ' . __('Female MtDNA carrier (Base person has red border)') . '</p>'; } echo '<p><span style="color:blue">=====</span> ' . __('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 . '&screen_mode=STARSIZE" style="display : inline;">'; } else { print '<form method="POST" name="desc_form" action="' . CMS_ROOTPATH . 'family.php?chosensize=' . $size . '&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 " " . __('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.'&main_person='. // $keepmain_person.'&direction='.$direction.'&database='.$database.'&dnachart='."none".'&chosensize='. // $size.'&chosengen='.$chosengen.'&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 . '&main_person=' . $keepmain_person . '&direction=' . $direction . '&database=' . $database . '&dnachart=' . "ydna" . '&chosensize=' . $size . '&chosengen=' . $chosengen . '&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 . '&main_person=' . $keepmain_person . '&direction=' . $direction . '&database=' . $database . '&dnachart=' . "ydnamark" . '&chosensize=' . $size . '&chosengen=' . $chosengen . '&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 . '&main_person=' . $keepmain_person . '&direction=' . $direction . '&database=' . $database . '&dnachart=' . "mtdna" . '&chosensize=' . $size . '&chosengen=' . $chosengen . '&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 . '&main_person=' . $keepmain_person . '&direction=' . $direction . '&database=' . $database . '&dnachart=' . "mtdnamark" . '&chosensize=' . $size . '&chosengen=' . $chosengen . '&screen_mode=STAR" ' . $selected . '>' . __('mtDNA Mark carriers') . '</option>'; } echo '</select>'; } print '</div>'; print ' '; print ' ' . __('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 . '&main_person=' . $keepmain_person . '&direction=' . $direction . '&database=' . $database . '&dnachart=' . $dna . '&chosensize=' . $size . '&chosengen=' . $i . '&screen_mode=STAR" '; } else { print '<option value="' . $uri_path . 'family.php?id=' . $keepfamily_id . '&main_person=' . $keepmain_person . '&direction=' . $direction . '&database=' . $database . '&dnachart=' . $dna . '&chosensize=' . $size . '&chosengen=' . $i . '&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 . '&main_person=' . $keepmain_person . '&direction=' . $direction . '&database=' . $database . '&dnachart=' . $dna . '&chosensize=' . $size . '&chosengen=All&screen_mode=STAR" '; if ($chosengen == "All") { print "selected=\"selected\" "; } print ">" . "All" . "</option>"; print '</select>'; print ' '; $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"].'&main_person='.$genarray[$w]["gednr"].'&chosensize='.$size.'&direction='.$direction.'&screen_mode=STAR"'; } else { $replacement_text.= '<a class="nam" href="'.CMS_ROOTPATH.'family.php?id='.$genarray[$w]["fams"].'&main_person='.$genarray[$w]["gednr"].'&chosensize='.$size.'&direction='.$direction.'&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>'.__('†').$dirmark1.' '.date_place($man->pers_death_date,$man->pers_death_place); $replacement_text .= '<br>' . __('†') . $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"].'&main_person='.$genarray[$w]["gednr"].'&chosensize='.$size.'&direction='.$direction.'&screen_mode=STAR"'; } else { $replacement_text.= '<a href="'.CMS_ROOTPATH.'family.php?id='.$genarray[$w]["fams"].'&main_person='.$genarray[$w]["gednr"].'&chosensize='.$size.'&direction='.$direction.'&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 .= " "; } // (Chrome and Safari need some character here - even   - 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"] . '&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"] . '&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;"> </div>'; }
function show_media($personDb, $marriageDb) { global $dbh, $tree_id, $user, $dataDb, $tree_prefix_quoted, $uri_path; global $sect, $screen_mode; // *** RTF Export *** global $picture_presentation; $templ_person = array(); // local version $process_text = ''; $media_nr = 0; // *** Pictures/ media *** if ($user['group_pictures'] == 'j' and $picture_presentation != 'hide') { //$tree_pict_path=CMS_ROOTPATH.$dataDb->tree_pict_path; $tree_pict_path = $dataDb->tree_pict_path; // in joomla relative path is relative to joomla main folder, NOT HuMo-gen main folder. Therefore use the path entered as-is, without ROOTPATH. // *** Standard connected media by person and family *** if ($personDb != '') { $picture_qry = $dbh->query("SELECT * FROM humo_events WHERE event_tree_id='" . $tree_id . "'\n\t\t\t\tAND event_person_id='" . $personDb->pers_gedcomnumber . "' AND LEFT(event_kind,7)='picture'\n\t\t\t\tORDER BY event_kind, event_order"); } else { $picture_qry = $dbh->query("SELECT * FROM humo_events WHERE event_tree_id='" . $tree_id . "'\n\t\t\t\tAND event_family_id='" . $marriageDb->fam_gedcomnumber . "' AND event_kind='picture'\n\t\t\t\tORDER BY event_order"); } while ($pictureDb = $picture_qry->fetch(PDO::FETCH_OBJ)) { $media_nr++; $media_event_id[$media_nr] = $pictureDb->event_id; $media_event_event[$media_nr] = $pictureDb->event_event; $media_event_date[$media_nr] = $pictureDb->event_date; $media_event_text[$media_nr] = $pictureDb->event_text; //$media_event_source[$media_nr]=$pictureDb->event_source; } // *** Search for all external connected objects by a person or a family *** if ($personDb != '') { $connect_qry = "SELECT * FROM humo_connections\n\t\t\t\tWHERE connect_tree_id='" . $tree_id . "'\n\t\t\t\tAND connect_sub_kind='pers_object'\n\t\t\t\tAND connect_connect_id='" . $personDb->pers_gedcomnumber . "'\n\t\t\t\tORDER BY connect_order"; } else { $connect_qry = "SELECT * FROM humo_connections\n\t\t\t\tWHERE connect_tree_id='" . $tree_id . "'\n\t\t\t\tAND connect_sub_kind='fam_object'\n\t\t\t\tAND connect_connect_id='" . $marriageDb->fam_gedcomnumber . "'\n\t\t\t\tORDER BY connect_order"; } $connect_sql = $dbh->query($connect_qry); while ($connectDb = $connect_sql->fetch(PDO::FETCH_OBJ)) { $picture_qry = $dbh->query("SELECT * FROM humo_events WHERE event_tree_id='" . $tree_id . "'\n\t\t\t\tAND event_gedcomnr='" . $connectDb->connect_source_id . "' AND event_kind='object'\n\t\t\t\tORDER BY event_order"); while ($pictureDb = $picture_qry->fetch(PDO::FETCH_OBJ)) { $media_nr++; $media_event_id[$media_nr] = $pictureDb->event_id; $media_event_event[$media_nr] = $pictureDb->event_event; $media_event_date[$media_nr] = $pictureDb->event_date; $media_event_text[$media_nr] = $pictureDb->event_text; //$media_event_source[$media_nr]=$pictureDb->event_source; } } // ****************** // *** Show media *** // ****************** if ($media_nr > 0) { $process_text .= '<br>'; } if (CMS_SPECIFIC == "Joomla") { $picpath = CMS_ROOTPATH; } else { $picpath = $uri_path; } if ($screen_mode == "RTF") { $process_text .= "\n"; } for ($i = 1; $i < $media_nr + 1; $i++) { // *** If possible show a thumb *** // *** Don't use entities in a picture *** //$event_event = html_entity_decode($pictureDb->event_event, ENT_NOQUOTES, 'ISO-8859-15'); $event_event = $media_event_event[$i]; // *** In some cases the picture name must be converted to lower case *** if (file_exists($tree_pict_path . strtolower($event_event))) { $event_event = strtolower($event_event); } // *** Show PDF file *** if (strtolower(substr($tree_pict_path . $event_event, -3, 3)) == "pdf") { $picture = '<a href="' . $tree_pict_path . $event_event . '"><img src="' . $picpath . '/images/pdf.jpeg" alt="PDF"></a>'; } elseif (strtolower(substr($tree_pict_path . $event_event, -3, 3)) == "doc" or substr($tree_pict_path . $event_event, -4, 4) == "docx") { $picture = '<a href="' . $tree_pict_path . $event_event . '"><img src="' . $picpath . '/images/msdoc.gif" alt="DOC"></a>'; } elseif (strtolower(substr($tree_pict_path . $event_event, -3, 3)) == "avi") { $picture = '<a href="' . $tree_pict_path . $event_event . '" target="_blank"><img src="' . $picpath . '/images/video-file.png" alt="AVI"></a>'; } elseif (strtolower(substr($tree_pict_path . $event_event, -3, 3)) == "wmv") { $picture = '<a href="' . $tree_pict_path . $event_event . '" target="_blank"><img src="' . $picpath . '/images/video-file.png" alt="WMV"></a>'; } elseif (strtolower(substr($tree_pict_path . $event_event, -3, 3)) == "mpg") { $picture = '<a href="' . $tree_pict_path . $event_event . '" target="_blank"><img src="' . $picpath . '/images/video-file.png" alt="MPG"></a>'; } elseif (strtolower(substr($tree_pict_path . $event_event, -3, 3)) == "mov") { $picture = '<a href="' . $tree_pict_path . $event_event . '" target="_blank"><img src="' . $picpath . '/images/video-file.png" alt="MOV"></a>'; } elseif (strtolower(substr($tree_pict_path . $event_event, -3, 3)) == "wma") { $picture = '<a href="' . $tree_pict_path . $event_event . '" target="_blank"><img src="' . $picpath . '/images/audio.gif" alt="WMA"></a>'; } elseif (strtolower(substr($tree_pict_path . $event_event, -3, 3)) == "mp3") { $picture = '<a href="' . $tree_pict_path . $event_event . '" target="_blank"><img src="' . $picpath . '/images/audio.gif"" alt="MP3"></a>'; } elseif (strtolower(substr($tree_pict_path . $event_event, -3, 3)) == "wav") { $picture = '<a href="' . $tree_pict_path . $event_event . '" target="_blank"><img src="' . $picpath . '/images/audio.gif"" alt="WAV"></a>'; } elseif (strtolower(substr($tree_pict_path . $event_event, -3, 3)) == "mid") { $picture = '<a href="' . $tree_pict_path . $event_event . '" target="_blank"><img src="' . $picpath . '/images/audio.gif"" alt="MID"></a>'; } elseif (strtolower(substr($tree_pict_path . $event_event, -3, 3)) == "ram") { $picture = '<a href="' . $tree_pict_path . $event_event . '" target="_blank"><img src="' . $picpath . '/images/audio.gif"" alt="RAM"></a>'; } elseif (strtolower(substr($tree_pict_path . $event_event, -2, 2)) == "ra") { $picture = '<a href="' . $tree_pict_path . $event_event . '" target="_blank"><img src="' . $picpath . '/images/audio.gif"" alt="RA"></a>'; } else { // *** Show photo using the lightbox effect *** $picture_array = show_picture($tree_pict_path, $event_event, '', 120); $picture = '<a href="' . $picture_array['path'] . $picture_array['picture'] . '" rel="lightbox" title="' . str_replace("&", "&", $media_event_text[$i]) . '">'; $picture .= '<img src="' . $picture_array['path'] . $picture_array['thumb'] . $picture_array['picture'] . '" height="' . $picture_array['height'] . '" alt="' . $event_event . '"></a>'; //$templ_person["pic_path".$i]=$tree_pict_path."thumb_".$event_event; //for the time being pdf only with thumbs $templ_person["pic_path" . $i] = $picture_array['path'] . "thumb_" . $picture_array['picture']; //for the time being pdf only with thumbs // *** Remove spaces *** $templ_person["pic_path" . $i] = trim($templ_person["pic_path" . $i]); } // *** Show picture date *** $picture_date = ''; if ($media_event_date[$i]) { if ($screen_mode != 'RTF') { $picture_date = ' ' . date_place($media_event_date[$i], '') . ' '; } // default, there is no place $templ_person["pic_text" . $i] = date_place($media_event_date[$i], ''); } // *** Show text by picture of little space *** $picture_text = ''; if (isset($media_event_text[$i]) and $media_event_text[$i]) { if ($screen_mode != 'RTF') { $picture_text = $picture_date . ' ' . str_replace("&", "&", $media_event_text[$i]); } if (isset($templ_person["pic_text" . $i])) { $templ_person["pic_text" . $i] .= ' ' . $media_event_text[$i]; } else { $templ_person["pic_text" . $i] = ' ' . $media_event_text[$i]; } } if ($screen_mode != 'RTF') { $source = show_sources2("person", "pers_event_source", $media_event_id[$i]); if ($source) { $picture_text .= $source; } $process_text .= '<div class="photo">'; $process_text .= $picture; if (isset($picture_text)) { $process_text .= '<div class="phototext">' . $picture_text . '</div>'; } $process_text .= '</div>' . "\n"; } } if ($media_nr > 0) { $process_text .= '<br clear="All">'; $templ_person["got_pics"] = 1; } } //return $process_text; $result[0] = $process_text; $result[1] = $templ_person; // local version with pic data return $result; }
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. // "&screen_mode=ancestor_chart\">>>></a> "; $replacement_text .= ' >>>' . $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>'.__('†').$dirmark1.' '.date_place($personDb->pers_death_date,$personDb->pers_death_place); } $replacement_text .= '<br>' . __('†') . $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 = " "; } // 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"; }
$connect_qry = $dbh->query("SELECT * FROM humo_connections\n\t\t\t\tWHERE connect_tree_id='" . $tree_id . "'\n\t\t\t\tAND connect_sub_kind='pers_object'\n\t\t\t\tAND connect_source_id='" . $pictureDb->event_gedcomnr . "'"); while ($connectDb = $connect_qry->fetch(PDO::FETCH_OBJ)) { $person_cls = new person_cls(); @($personDb = $db_functions->get_person($connectDb->connect_connect_id)); $name = $person_cls->person_name($personDb); $picture_text .= '<a href="' . CMS_ROOTPATH . 'family.php?database=' . $_SESSION['tree_prefix'] . '&id=' . $personDb->pers_indexnr . '&main_person=' . $personDb->pers_gedcomnumber . '">' . $name["standard_name"] . '</a><br>'; $picture_text2 .= $name["standard_name"] . '<br>'; $privacy = $person_cls->set_privacy($personDb); if ($privacy) { $picture_privacy = true; } $picture_text .= $pictureDb->event_text . '<br>'; $picture_text2 .= $pictureDb->event_text . '<br>'; } } $picture2 = show_picture($dir, $filename, 175, 120); $picture = '<img src="' . $dir . $picture2['thumb'] . $picture2['picture'] . '" width="' . $picture2['width'] . '" alt="' . $filename . '"></a>'; echo '<div class="photobook">'; if ($picture_privacy == false) { // *** Show photo using the lightbox effect *** echo '<a href="' . $dir . $filename . '" rel="lightbox" title="' . $picture_text2 . '">'; echo $picture; echo '<div class="photobooktext">' . $picture_text . '</div>'; } else { echo __('PRIVACY FILTER'); } echo '</div>'; } } echo '<br clear="all"><br>'; echo '<div class="center">' . $line_pages . '</div>';