/** * get the highlighted object HTML * @return string HTML string for the <img> tag */ function getHighlightedObject() { global $USE_THUMBS_MAIN, $THUMBNAIL_WIDTH, $USE_MEDIA_VIEWER, $GEDCOM; if ($this->canShowHighlightedObject()) { $firstmediarec = $this->indi->findHighlightedMedia(); if (!empty($firstmediarec)) { $filename = thumb_or_main($firstmediarec); // Do we send the main image or a thumbnail? if (!$USE_THUMBS_MAIN || $firstmediarec["_THUM"] == 'Y') { $class = "image"; } else { $class = "thumbnail"; } $isExternal = isFileExternal($filename); if ($isExternal && $class == "thumbnail") { $class .= "\" width=\"" . $THUMBNAIL_WIDTH; } if (!empty($filename)) { $result = ""; $imgsize = findImageSize($firstmediarec["file"]); $imgwidth = $imgsize[0] + 40; $imgheight = $imgsize[1] + 150; //Gets the Media View Link Information and Concatenate $mid = $firstmediarec['mid']; $name = $this->indi->getFullName(); if (file_exists("modules/lightbox/album.php")) { print "<a href=\"" . $firstmediarec["file"] . "\" rel=\"clearbox[general_1]\" rev=\"" . $mid . "::" . $GEDCOM . "::" . PrintReady(htmlspecialchars($name, ENT_QUOTES, 'UTF-8')) . "\">" . "\n"; } else { if (!$USE_MEDIA_VIEWER && $imgsize) { $result .= "<a href=\"javascript:;\" onclick=\"return openImage('" . encode_url(encrypt($firstmediarec["file"])) . "',{$imgwidth}, {$imgheight});\">"; } else { $result .= "<a href=\"mediaviewer.php?mid={$mid}\">"; } } $result .= "<img src=\"{$filename}\" align=\"left\" class=\"" . $class . "\" border=\"none\" title=\"" . PrintReady(htmlspecialchars(strip_tags($name), ENT_QUOTES, 'UTF-8')) . "\" alt=\"" . PrintReady(htmlspecialchars(strip_tags($name), ENT_QUOTES, 'UTF-8')) . "\" />"; $result .= "</a>"; return $result; } } } }
function print_td_person($n) { global $treeid, $PGV_IMAGE_DIR, $PGV_IMAGES, $pgv_lang; global $TEXT_DIRECTION, $MULTI_MEDIA, $SHOW_HIGHLIGHT_IMAGES, $USE_SILHOUETTE, $PGV_IMAGES; global $showids, $showthumbs; $text = ""; $pid = $treeid[$n]; if ($TEXT_DIRECTION == "ltr") { $title = $pgv_lang["indi_info"] . ": " . $pid; } else { $title = $pid . " :" . $pgv_lang["indi_info"]; } if ($pid) { $indi = Person::getInstance($pid); $name = $indi->getFullName(); $addname = $indi->getAddName(); if ($showthumbs && $MULTI_MEDIA && $SHOW_HIGHLIGHT_IMAGES) { if (showFact("OBJE", $pid)) { $object = find_highlighted_object($pid, PGV_GED_ID, $indi->gedrec); if (!empty($object)) { $whichFile = thumb_or_main($object); // Do we send the main image or a thumbnail? $size = findImageSize($whichFile); $class = "pedigree_image_portrait"; if ($size[0] > $size[1]) { $class = "pedigree_image_landscape"; } if ($TEXT_DIRECTION == "rtl") { $class .= "_rtl"; } // NOTE: IMG ID $imgsize = findImageSize($object["file"]); $imgwidth = $imgsize[0] + 50; $imgheight = $imgsize[1] + 150; if (PGV_USE_LIGHTBOX) { $text .= "<a href=\"" . $object["file"] . "\" rel=\"clearbox[general]\" rev=\"" . $object['mid'] . "::" . PGV_GEDCOM . "::" . PrintReady(htmlspecialchars($name, ENT_QUOTES, 'UTF-8')) . "\">" . "\n"; } else { $text .= "<a href=\"javascript:;\" onclick=\"return openImage('" . rawurlencode($object["file"]) . "',{$imgwidth}, {$imgheight});\">"; } $birth_date = $indi->getBirthDate(); $death_date = $indi->getDeathDate(); $text .= "<img id=\"box-{$pid}\" src=\"" . $whichFile . "\"vspace=\"0\" hspace=\"0\" class=\"{$class}\" alt =\"\" title=\"" . PrintReady(htmlspecialchars(strip_tags($name), ENT_QUOTES, 'UTF-8')) . " - " . strip_tags(html_entity_decode($birth_date->Display(false) . " - " . $death_date->Display(false), ENT_QUOTES, 'UTF-8')) . "\""; if ($imgsize) { $text .= " /></a>\n"; } else { $text .= " />\n"; } } else { if ($USE_SILHOUETTE && isset($PGV_IMAGES["default_image_U"]["other"])) { $class = "pedigree_image_portrait"; if ($TEXT_DIRECTION == "rtl") { $class .= "_rtl"; } $sex = $indi->getSex(); $text = "<img src=\""; if ($sex == 'F') { $text .= $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["default_image_F"]["other"]; } else { if ($sex == 'M') { $text .= $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["default_image_M"]["other"]; } else { $text .= $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["default_image_U"]["other"]; } } $text .= "\" class=\"" . $class . "\" border=\"none\" alt=\"\" />"; } } } else { if ($USE_SILHOUETTE && isset($PGV_IMAGES["default_image_U"]["other"])) { $class = "pedigree_image_portrait"; if ($TEXT_DIRECTION == "rtl") { $class .= "_rtl"; } $sex = $indi->getSex(); $text = "<img src=\""; if ($sex == 'F') { $text .= $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["default_image_F"]["other"]; } else { if ($sex == 'M') { $text .= $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["default_image_M"]["other"]; } else { $text .= $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["default_image_U"]["other"]; } } $text .= "\" class=\"" . $class . "\" border=\"none\" alt=\"\" />"; } } } $text .= "<a class=\"name1\" href=\"individual.php?pid={$pid}\" title=\"{$title}\"> "; $text .= PrintReady(htmlspecialchars(strip_tags($name), ENT_QUOTES, 'UTF-8')); if ($addname) { $text .= "<br />" . PrintReady($addname); } $text .= "</a>"; if ($showids) { $text .= " <span class='details1' "; if ($TEXT_DIRECTION == "ltr") { $text .= "dir=\"ltr\">"; } else { $text .= "dir=\"rtl\">"; } $text .= "(" . $pid . ")</span>"; } $text .= "<br />"; if ($indi->canDisplayDetails()) { $text .= "<span class='details1'>"; $text .= $indi->getBirthYear() . '-' . $indi->getDeathYear(); $age = GedcomDate::GetAgeYears($indi->getBirthDate(), $indi->getDeathDate()); if ($age) { $text .= " <span class=\"age\">" . PrintReady("({$age})") . "</span>"; } $text .= "</span>"; } } //Removed by BH causing problems with nicknames not printing //$text = unhtmlentities($text); // -- empty box if (empty($text)) { $text = " <br /> <br />"; } // -- box color $isF = ""; if ($n == 1) { if ($indi->getSex() == 'F') { $isF = "F"; } } elseif ($n % 2) { $isF = "F"; } // -- box size if ($n == 1) { echo "<td"; } else { echo "<td width='15%'"; } // -- print box content echo " class=\"person_box", $isF, "\" style=\"text-align:center; vertical-align:top;\" >"; echo $text; echo "</td>"; }
/** * Get the thumbnail image for the given person * * @param Person $person * @return string */ function getThumbnail(&$person) { global $MULTI_MEDIA, $SHOW_HIGHLIGHT_IMAGES, $TEXT_DIRECTION, $USE_MEDIA_VIEWER, $SERVER_URL; $thumbnail = ""; if ($MULTI_MEDIA && $SHOW_HIGHLIGHT_IMAGES && showFact("OBJE", $person->getXref())) { $object = $person->findHighlightedMedia(); if (!empty($object)) { $whichFile = thumb_or_main($object); // Do we send the main image or a thumbnail? $size = findImageSize($whichFile); $class = "pedigree_image_portrait"; if ($size[0] > $size[1]) { $class = "pedigree_image_landscape"; } if ($TEXT_DIRECTION == "rtl") { $class .= "_rtl"; } // NOTE: IMG ID $imgsize = findImageSize($object["file"]); $imgwidth = $imgsize[0] + 50; $imgheight = $imgsize[1] + 150; if (!empty($object['mid']) && $USE_MEDIA_VIEWER) { $thumbnail .= "<a href=\"" . encode_url("mediaviewer.php?mid=" . $object['mid']) . "\" >"; } else { $thumbnail .= "<a href=\"javascript:;\" onclick=\"return openImage('" . rawurlencode($object["file"]) . "',{$imgwidth}, {$imgheight});\">"; } $thumbnail .= "<img src=\"" . $SERVER_URL . $whichFile . "\" vspace=\"0\" hspace=\"0\" class=\"{$class}\" alt=\"\" title=\"\""; if ($imgsize) { $thumbnail .= " /></a>"; } else { $thumbnail .= " />"; } } } return $thumbnail; }