function print_welcome_block($block = true, $config = "", $side, $index) { global $pgv_lang, $PGV_IMAGE_DIR, $PGV_IMAGES; $id = "user_welcome"; $title = $pgv_lang["welcome"] . " " . getUserFullName(PGV_USER_ID); $content = "<table class=\"blockcontent\" cellspacing=\"0\" cellpadding=\"0\" style=\" width: 100%; direction:ltr;\"><tr>"; $content .= "<td class=\"tab_active_bottom\" colspan=\"3\" ></td></tr><tr>"; if (get_user_setting(PGV_USER_ID, 'editaccount') == 'Y') { $content .= "<td class=\"center details2\" style=\" width: 33%; clear: none; vertical-align: top; margin-top: 2px;\"><a href=\"edituser.php\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["mygedview"]["small"] . "\" border=\"0\" alt=\"" . $pgv_lang["myuserdata"] . "\" title=\"" . $pgv_lang["myuserdata"] . "\" /><br />" . $pgv_lang["myuserdata"] . "</a></td>"; } if (PGV_USER_GEDCOM_ID) { $content .= "<td class=\"center details2\" style=\" width: 34%; clear: none; vertical-align: top; margin-top: 2px;\"><a href=\"" . encode_url("pedigree.php?rootid=" . PGV_USER_GEDCOM_ID) . "\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["pedigree"]["small"] . "\" border=\"0\" alt=\"" . $pgv_lang["my_pedigree"] . "\" title=\"" . $pgv_lang["my_pedigree"] . "\" /><br />" . $pgv_lang["my_pedigree"] . "</a></td>"; $content .= "<td class=\"center details2\" style=\" width: 33%; clear: none; vertical-align: top; margin-top: 2px;\"><a href=\"" . encode_url("individual.php?pid=" . PGV_USER_GEDCOM_ID) . "\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["indis"]["small"] . "\" border=\"0\" alt=\"" . $pgv_lang["my_indi"] . "\" title=\"" . $pgv_lang["my_indi"] . "\" /><br />" . $pgv_lang["my_indi"] . "</a></td>"; } $content .= "</tr><tr><td class=\"center\" colspan=\"3\">"; $content .= print_help_link("mygedview_customize_help", "qm", "", false, true); $content .= "<a href=\"javascript:;\" onclick=\"window.open('" . encode_url("index_edit.php?name=" . PGV_USER_NAME . "&ctype=user") . "', '_blank', 'top=50,left=10,width=600,height=350,scrollbars=1,resizable=1');\">" . $pgv_lang["customize_page"] . "</a>"; $content .= "<br />" . format_timestamp(client_time()); $content .= "</td>"; $content .= "</tr></table>"; global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
public function getFirstResult($search, $filename) { //print "http://www.chartlyrics.com/search.aspx?q=".replace_space($search); $getdata_source = getdata("http://www.chartlyrics.com/search.aspx?q=" . replace_space($search), $curl); $getdata = explode('<th style="width: auto">', $getdata_source); $getdata = explode('[END] Page', $getdata[1]); $getdata = explode('<a href="', $getdata[0]); $achou = false; if (count($getdata) > 1) { $pecah = $getdata[1]; //foreach($getdata as $pecah){ $data = explode('</a>', $pecah); $data = explode('<td>', $data[0]); $data = array_unique(explode('</th>', $data[0])); //$gay = $data[0]; foreach ($data as $gay) { $gay = explode('">', $gay); if (!strpos($gay[0], "add.aspx")) { if (isset($gay[1])) { $string = $gay[0] . ":" . $gay[1] . ":" . str_replace(".php", "", str_replace("_", ".", $filename)); //echo "<center><a href='?lyrics=".encode_url($string, 'encode')."'>$gay[1]</a><br /></center>"; //print encode_url($string, 'encode'); $achou = true; $this->get_result(encode_url($string, 'encode')); } } } //} } if (!$achou) { echo "0"; } }
function action_url($action, $type, $params) { global $_ACTION_VIEW, $_ACTION_REVERSE; if (isset($_ACTION_REVERSE[$action])) { if ($type == 'get') { needed_params(array('values'), $params); list($base, $params_) = view($_ACTION_VIEW[$_ACTION_REVERSE[$action]], $params, true); if (REWRITE_URL) { if (count($params['values']) > 1) { die('Only support one value as action parameter'); } return build_url($base . ($base != '' && $base[strlen($base) - 1] != '/' ? '/' : '') . 'action/' . $action . '/' . encode_url($params['values'][0]), $params_); } else { return build_url($base, array_replace($params_, array('action' => $action, 'values' => $params['values']))); } } elseif ($type == 'post') { return view($_ACTION_VIEW[$action], $params); } else { die('action type sould be "get" or "post", not ' . $type); } } else { print_r($_ACTION_REVERSE); die('Unknow action ' . $action); } }
function print_recent_changes($block = true, $config = "", $side, $index) { global $pgv_lang, $ctype; global $PGV_IMAGE_DIR, $PGV_IMAGES, $PGV_BLOCKS; $block = true; // Always restrict this block's height if (empty($config)) { $config = $PGV_BLOCKS["print_recent_changes"]["config"]; } if ($config["days"] < 1) { $config["days"] = 30; } if (isset($config["hide_empty"])) { $HideEmpty = $config["hide_empty"]; } else { $HideEmpty = "no"; } $found_facts = get_recent_changes(client_jd() - $config['days']); // Start output if (count($found_facts) == 0 and $HideEmpty == "yes") { return false; } // Print block header $id = "recent_changes"; $title = print_help_link("recent_changes_help", "qm", "", false, true); if ($PGV_BLOCKS["print_recent_changes"]["canconfig"]) { if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) { if ($ctype == "gedcom") { $name = PGV_GEDCOM; } else { $name = PGV_USER_NAME; } $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('" . encode_url("index_edit.php?name={$name}&ctype={$ctype}&action=configure&side={$side}&index={$index}") . "', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">"; $title .= "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/" . $PGV_IMAGES["admin"]["small"] . "\" width=\"15\" height=\"15\" border=\"0\" alt=\"" . $pgv_lang["config_block"] . "\" /></a>"; } } $title .= $pgv_lang["recent_changes"]; $content = ""; // Print block content $pgv_lang["global_num1"] = $config["days"]; // Make this visible if (count($found_facts) == 0) { $content .= print_text("recent_changes_none", 0, 1); } else { $content .= print_text("recent_changes_some", 0, 1); // sortable table require_once PGV_ROOT . 'includes/functions/functions_print_lists.php'; ob_start(); print_changes_table($found_facts); $content .= ob_get_clean(); } global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
/** * Prints a user news/journal * */ function print_user_news($block = true, $config = "", $side, $index) { global $pgv_lang, $PGV_IMAGE_DIR, $PGV_IMAGES, $TEXT_DIRECTION, $ctype; $usernews = getUserNews(PGV_USER_ID); $id = "user_news"; $title = print_help_link("mygedview_myjournal_help", "qm", "", false, true); $title .= $pgv_lang["my_journal"]; $content = ""; if (count($usernews) == 0) { $content .= $pgv_lang["no_journal"] . ' '; } foreach ($usernews as $key => $news) { $day = date("j", $news["date"]); $mon = date("M", $news["date"]); $year = date("Y", $news["date"]); $content .= "<div class=\"person_box\">"; $ct = preg_match("/#(.+)#/", $news["title"], $match); if ($ct > 0) { if (isset($pgv_lang[$match[1]])) { $news["title"] = str_replace($match[0], $pgv_lang[$match[1]], $news["title"]); } } $content .= "<span class=\"news_title\">" . PrintReady($news["title"]) . "</span><br />"; $content .= "<span class=\"news_date\">" . format_timestamp($news["date"]) . "</span><br /><br />"; if (preg_match("/#(.+)#/", $news["text"], $match)) { if (isset($pgv_lang[$match[1]])) { $news["text"] = str_replace($match[0], $pgv_lang[$match[1]], $news["text"]); } } if (preg_match("/#(.+)#/", $news["text"], $match)) { if (isset($pgv_lang[$match[1]])) { $news["text"] = str_replace($match[0], $pgv_lang[$match[1]], $news["text"]); } if (isset(${$match}[1])) { $news["text"] = str_replace($match[0], ${$match}[1], $news["text"]); } } $trans = get_html_translation_table(HTML_SPECIALCHARS); $trans = array_flip($trans); $news["text"] = strtr($news["text"], $trans); $news["text"] = nl2br($news["text"]); $content .= PrintReady($news["text"]) . "<br /><br />"; $content .= "<a href=\"javascript:;\" onclick=\"editnews('{$key}'); return false;\">" . $pgv_lang["edit"] . "</a> | "; $content .= "<a href=\"" . encode_url("index.php?action=deletenews&news_id={$key}&ctype={$ctype}") . "\" onclick=\"return confirm('" . $pgv_lang["confirm_journal_delete"] . "');\">" . $pgv_lang["delete"] . "</a><br />"; $content .= "</div><br />"; } if (PGV_USER_ID) { $content .= "<br /><a href=\"javascript:;\" onclick=\"addnews('" . PGV_USER_ID . "'); return false;\">" . $pgv_lang["add_journal"] . "</a>"; } global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
public function get_result($request) { $request = encode_url($request, "decode"); $getname = explode(':', $request); $url = replace_space("http://www.chartlyrics.com" . $getname[0]); $getlyrics = getdata("{$url}", $curl); $getlyrics = explode('alt="" title="', $getlyrics); $getlyrics = explode('" />', $getlyrics[1]); $getlyrics = explode('<div id="adlyric">', $getlyrics[1]); echo "<center><br><font size=60><b>{$getname['1']}</b></font><br><br>{$getlyrics['0']}</center>"; }
public function get_result($request) { $request = encode_url($request, "decode"); $getname = explode(':', $request); $url = replace_space("http://www.lyrics007.com" . $getname[0]); $getlyrics = getdata("{$url}", $curl); $getlyrics = explode('display:block;float:left;padding-top:5px;', $getlyrics); $getlyrics = explode('/print.php?id=TWpnNE1qVTE', $getlyrics[1]); $getlyrics = explode('</fb:like>', $getlyrics[0]); $getlyrics = explode('<script type="text/javascript">', $getlyrics[1]); echo "<center><br><font size=60><b>{$getname['1']}</b></font><br><br>{$getlyrics['0']}</center>"; }
function print_html_block($block = true, $config = "", $side, $index) { global $pgv_lang, $PGV_IMAGE_DIR, $TEXT_DIRECTION, $PGV_IMAGES, $HTML_BLOCK_COUNT, $PGV_BLOCKS, $ctype; if (empty($config)) { $config = $PGV_BLOCKS["print_html_block"]["config"]; } if (!isset($HTML_BLOCK_COUNT)) { $HTML_BLOCK_COUNT = 0; } $HTML_BLOCK_COUNT++; $id = "html_block{$HTML_BLOCK_COUNT}"; $title = ""; $ct = preg_match("/#(.+)#/", $config["html"], $match); if ($ct > 0) { if (isset($pgv_lang[$match[1]])) { $config["html"] = str_replace($match[0], $pgv_lang[$match[1]], $config["html"]); } } $ct = preg_match("/#(.+)#/", $config["html"], $match); if ($ct > 0) { if (isset($pgv_lang[$match[1]])) { $config["html"] = str_replace($match[0], $pgv_lang[$match[1]], $config["html"]); } $varname = $match[1]; if (!empty(${$varname})) { $value = ${$varname}; $config["html"] = str_replace($match[0], $value, $config["html"]); } } $content = $config["html"]; if ($PGV_BLOCKS["print_html_block"]["canconfig"]) { if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) { if ($ctype == "gedcom") { $name = PGV_GEDCOM; } else { $name = PGV_USER_NAME; } $content .= "<br /><a href=\"javascript:;\" onclick=\"window.open('" . encode_url("index_edit.php?name={$name}&ctype={$ctype}&action=configure&side={$side}&index={$index}") . "', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">"; $content .= "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/" . $PGV_IMAGES["admin"]["small"] . "\" width=\"15\" height=\"15\" border=\"0\" alt=\"" . $pgv_lang["config_block"] . "\" title=\"" . $pgv_lang["config_block"] . "\" /></a>\n"; } } global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
function print_gedcom_block($block = true, $config = "", $side, $index) { global $hitCount, $pgv_lang, $SHOW_COUNTER; $id = "gedcom_welcome"; $title = PrintReady(get_gedcom_setting(PGV_GED_ID, 'title')); $content = "<div class=\"center\">"; $content .= "<br />" . format_timestamp(client_time()) . "<br />\n"; if ($SHOW_COUNTER) { $content .= $pgv_lang["hit_count"] . " " . $hitCount . "<br />\n"; } $content .= "\n<br />"; if (PGV_USER_GEDCOM_ADMIN) { $content .= "<a href=\"javascript:;\" onclick=\"window.open('" . encode_url("index_edit.php?name=" . PGV_GEDCOM . "&ctype=gedcom") . "', '_blank', 'top=50,left=10,width=600,height=500,scrollbars=1,resizable=1'); return false;\">" . $pgv_lang["customize_gedcom_page"] . "</a><br />\n"; } $content .= "</div>"; global $THEME_DIR; require $THEME_DIR . 'templates/block_main_temp.php'; }
function init() { // Cannot edit with a "remember me" login. if ($_SESSION["cookie_login"]) { header('Location: ' . encode_url("login.php?type=simple&url=" . urlencode("edit_interface.php?" . decode_url($QUERY_STRING)), false)); exit; } // Coming soon ??? $this->has_familysearch = file_exists('modules/FamilySearch/familySearchWrapper.php'); if ($this->has_familysearch) { require_once 'modules/FamilySearch/familySearchWrapper.php'; } // The PID can come from a URL or a form $this->pid = safe_REQUEST($_REQUEST, 'pid', PGV_REGEX_XREF); $this->person = Person::getInstance($this->pid); $this->server_list = get_server_list(); $this->gedcom_list = get_all_gedcoms(); unset($this->gedcom_list[PGV_GED_ID]); // Other input values come from the form $this->form_txtPID = safe_POST('txtPID', PGV_REGEX_XREF); $this->form_cbRelationship = safe_POST('cbRelationship'); $this->form_location = safe_POST('location'); $this->form_txtURL = safe_POST('txtURL', PGV_REGEX_URL); $this->form_txtTitle = safe_POST('txtTitle', '[^<>"%{};]+'); $this->form_txtGID = safe_POST('txtGID', $this->gedcom_list); $this->form_txtUsername = safe_POST('txtUsername', PGV_REGEX_USERNAME); $this->form_txtPassword = safe_POST('txtPassword', PGV_REGEX_PASSWORD); $this->form_cbExistingServers = safe_POST('cbExistingServers', array_keys($this->server_list)); $this->form_txtCB_Title = safe_POST('txtCB_Title', '[^<>"%{};]+'); $this->form_txtCB_GID = safe_POST('txtCB_GID', $this->gedcom_list); $this->form_txtFS_URL = safe_POST('txtFS_URL', PGV_REGEX_URL); $this->form_txtFS_Title = safe_POST('txtFS_Title', '[^<>"%{};]+'); $this->form_txtFS_GID = safe_POST('txtFS_GID', $this->gedcom_list); $this->form_txtFS_Username = safe_POST('txtFS_Username', PGV_REGEX_USERNAME); $this->form_txtFS_Password = safe_POST('txtFS_Password', PGV_REGEX_PASSWORD); if (is_null($this->form_location)) { if ($this->server_list) { $this->form_location = 'existing'; } else { $this->form_location = 'remote'; } } }
/** * Print RSS Block * * Prints a block allowing the user to login to the site directly from the portal */ function print_RSS_block($block = true, $config = "", $side, $index) { global $LANGUAGE, $pgv_lang; $id = "rss_block"; $title = print_help_link("rss_feed_help", "qm", "", false, true); $title .= $pgv_lang["rss_feeds"]; $content = "<div class=\"center\">"; $content .= "<form method=\"post\" action=\"\" name=\"rssform\">"; $content .= "<br />"; $content .= "<select name=\"rssStyle\" class=\"header_select\" onchange=\"javascript:document.getElementById('rss_button').href = '" . encode_url("rss.php?ged=" . PGV_GEDCOM . "&lang={$LANGUAGE}") . "' + (document.rssform.module.value==''? '' : '&module=' + document.rssform.module.value) + (document.rssform.rssStyle.value==''? '' : '&rssStyle=' + document.rssform.rssStyle.value) + (document.rssform.auth.value==''? '' : '&auth=' + document.rssform.auth.value);\">"; $content .= "<option value=\"ATOM\" selected=\"selected\">ATOM 1.0</option>"; $content .= "<option value=\"RSS2.0\">RSS 2.0</option>"; $content .= "<option value=\"RSS1.0\">RSS 1.0</option>"; $content .= "<option value=\"ATOM0.3\">ATOM 0.3</option>"; $content .= "<option value=\"RSS0.91\">RSS 0.91</option>"; $content .= "<option value=\"HTML\">HTML</option>"; $content .= "<option value=\"JS\">JavaScript</option>"; $content .= "</select>"; $content .= "<select name=\"module\" class=\"header_select\" onchange=\"javascript:document.getElementById('rss_button').href = '" . encode_url("rss.php?ged=" . PGV_GEDCOM . "&lang={$LANGUAGE}") . "' + (document.rssform.module.value==''? '' : '&module=' + document.rssform.module.value) + (document.rssform.rssStyle.value==''? '' : '&rssStyle=' + document.rssform.rssStyle.value) + (document.rssform.auth.value==''? '' : '&auth=' + document.rssform.auth.value);\">"; $content .= "<option value=\"\">" . $pgv_lang["all"] . "</option>"; $content .= "<option value=\"today\">" . $pgv_lang["on_this_day"] . " </option>"; $content .= "<option value=\"upcoming\">" . $pgv_lang["upcoming_events"] . "</option>"; $content .= "<option value=\"gedcomStats\">" . $pgv_lang["gedcom_stats"] . "</option>"; $content .= "<option value=\"gedcomNews\">" . $pgv_lang["gedcom_news"] . "</option>"; $content .= "<option value=\"top10Surnames\">" . $pgv_lang["block_top10"] . "</option>"; $content .= "<option value=\"recentChanges\">" . $pgv_lang["recent_changes"] . "</option>"; $content .= "<option value=\"randomMedia\">" . $pgv_lang["random_picture"] . "</option>"; $content .= "</select>"; $content .= " <a id=\"rss_button\" href=\"" . encode_url("rss.php?ged=" . PGV_GEDCOM . "&lang={$LANGUAGE}") . "\"><img class=\"icon\" src=\"images/feed-icon16x16.png\" alt=\"RSS\" title=\"RSS\" /></a>"; $content .= "</form></div>"; $content .= "<div class=\"center\">"; $content .= "</div>"; global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
/** * Prints descendency of passed in person * * @param mixed $pid ID of person to print descendency for * @param mixed $count count of generations to print * @access public * @return void */ function print_descendency($pid, $count, $showNav = true) { global $TEXT_DIRECTION, $PGV_IMAGE_DIR, $PGV_IMAGES, $pgv_lang, $bheight, $bwidth, $bhalfheight; global $lastGenSecondFam; if ($count > $this->dgenerations) { return 0; } $person = Person::getInstance($pid); if (is_null($person)) { return; } $tablealign = "right"; $otablealign = "left"; if ($TEXT_DIRECTION == "rtl") { $tablealign = "left"; $otablealign = "right"; } // print $this->dgenerations; print "<!-- print_descendency for {$pid} -->"; //-- put a space between families on the last generation if ($count == $this->dgenerations - 1) { if (isset($lastGenSecondFam)) { print "<br />"; } $lastGenSecondFam = true; } print "<table id=\"table_{$pid}\" align=\"" . $tablealign . "\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"; print "<tr>"; print "<td align=\"{$tablealign}\" width=\"100%\">\n"; $numkids = 0; $families = $person->getSpouseFamilies(); $famcount = count($families); $famNum = 0; $kidNum = 0; $children = array(); if ($count < $this->dgenerations) { //-- put all of the children in a common array foreach ($families as $famid => $family) { $famNum++; $chs = $family->getChildren(); foreach ($chs as $c => $child) { $children[] = $child; } } $ct = count($children); if ($ct > 0) { print "<table style=\"position: relative; top: auto; text-align: {$tablealign};\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"; for ($i = 0; $i < $ct; $i++) { if ($i > 0 && $i < $ct - 1) { $rowspan = 1; } /* @var $person2 Person */ $person2 = $children[$i]; $chil = $person2->getXref(); print "<tr>"; print "<td id=\"td_{$chil}\" class=\"{$TEXT_DIRECTION}\" align=\"{$tablealign}\">"; $kids = $this->print_descendency($chil, $count + 1); $numkids += $kids; print "</td>"; //-- print the lines $twidth = 7; if ($ct == 1) { $twidth += 3; } if ($ct > 1) { if ($i == 0) { //-- adjust for the number of kids $h = ($bhalfheight + 3) * $numkids; print "<td valign=\"bottom\"><img name=\"tvertline\" id=\"vline_{$chil}\" src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["vline"]["other"] . "\" width=\"3\" height=\"{$h}\" alt=\"\" /></td>"; } else { if ($i == $ct - 1) { $h = ($bhalfheight + 3) * $kids; if ($count < $this->dgenerations - 1) { if ($this->show_spouse) { $h -= 15; } else { $h += 15; } } print "<td valign=\"top\"><img name=\"bvertline\" id=\"vline_{$chil}\" src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["vline"]["other"] . "\" width=\"3\" height=\"" . $h . "\" alt=\"\" /></td>"; } else { print "<td style=\"background: url('" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["vline"]["other"] . "');\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["spacer"]["other"] . "\" width=\"3\" alt=\"\" /></td>"; } } } print "</tr>"; } print "</table>\n"; } print "</td>\n"; print "<td width=\"{$bwidth}\">"; } // Print the descendency expansion arrow if ($count == $this->dgenerations) { $numkids = 1; $tbwidth = $bwidth + 16; for ($j = $count; $j < $this->dgenerations; $j++) { print "<div style=\"width: " . $tbwidth . "px;\"><br /></div>\n</td>\n<td width=\"{$bwidth}\">"; } $kcount = 0; foreach ($families as $famid => $family) { $kcount += $family->getNumberOfChildren(); } if ($kcount == 0) { print "<div style=\"width: " . $this->arrwidth . "px;\"><br /></div>\n</td>\n<td width=\"{$bwidth}\">"; } else { print "<div style=\"width: " . $this->arrwidth . "px;\"><a href=\"{$pid}\" onclick=\"return ChangeDis('td_" . $pid . "','" . $pid . "','" . $this->show_full . "','" . $this->show_spouse . "','" . $this->box_width . "')\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["larrow"]["other"] . "\" border=\"0\" alt=\"\" /></a></div>\n"; //-- move the arrow up to line up with the correct box if ($this->show_spouse) { foreach ($families as $famid => $family) { /* @var $family Family */ if (!is_null($family)) { $spouse = $family->getSpouse($person); if ($spouse != null) { print "<br /><br /><br />"; } } } } print "</td>\n<td width=\"{$bwidth}\">"; } } print "<table id=\"table2_{$pid}\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td>"; print_pedigree_person($pid); print "</td><td><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["hline"]["other"] . "\" width=\"7\" height=\"3\" alt=\"\" />"; //----- Print the spouse if ($this->show_spouse) { foreach ($families as $famid => $family) { /* @var $family Family */ if (!is_null($family)) { $spouse = $family->getSpouse($person); if ($spouse != null) { print "</td></tr><tr><td align=\"{$otablealign}\">"; //-- shrink the box for the spouses $tempw = $bwidth; $temph = $bheight; $bwidth -= 10; $bheight -= 10; print_pedigree_person($spouse->getXref()); $bwidth = $tempw; $bheight = $temph; $numkids += 0.95; print "</td><td></td>"; } } } //-- add offset divs to make things line up better if ($count == $this->dgenerations) { print "<tr><td colspan\"2\"><div style=\"height: " . $bhalfheight / 2 . "px; width: " . $bwidth . "px;\"><br /></div>"; } } print "</td></tr></table>"; // For the root person, print a down arrow that allows changing the root of tree if ($showNav && $count == 1) { // NOTE: If statement OK if ($person->canDisplayName()) { // -- print left arrow for decendants so that we can move down the tree $famids = $person->getSpouseFamilies(); //-- make sure there is more than 1 child in the family with parents $cfamids = $person->getChildFamilies(); $num = 0; foreach ($cfamids as $famid => $family) { if (!is_null($family)) { $num += $family->getNumberOfChildren(); } } // NOTE: If statement OK if ($num > 0) { print "\n\t\t<div class=\"center\" id=\"childarrow\" dir=\"" . $TEXT_DIRECTION . "\""; print " style=\"position:absolute; width:" . $bwidth . "px; \">"; if ($this->view != "preview") { print "<a href=\"javascript: " . $pgv_lang["show"] . "\" onclick=\"togglechildrenbox(); return false;\" onmouseover=\"swap_image('larrow',3);\" onmouseout=\"swap_image('larrow',3);\">"; print "<img id=\"larrow\" src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["darrow"]["other"] . "\" border=\"0\" alt=\"\" />"; print "</a><br />"; } print "\n\t\t<div id=\"childbox\" dir=\"" . $TEXT_DIRECTION . "\" style=\"width:" . $bwidth . "px; height:" . $bheight . "px; visibility: hidden;\">"; print "\n\t\t\t<table class=\"person_box\"><tr><td>"; foreach ($famids as $famid => $family) { if (!is_null($family)) { $spouse = $family->getSpouse($person); if (!empty($spouse)) { $spid = $spouse->getXref(); print "\n\t\t\t\t<a href=\"" . encode_url("hourglass.php?pid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}") . "\"><span "; $name = $spouse->getFullName(); $name = rtrim($name); if (hasRTLText($name)) { print "class=\"name2\">"; } else { print "class=\"name1\">"; } print PrintReady($name); print "<br /></span></a>"; } $children = $family->getChildren(); foreach ($children as $id => $child) { $cid = $child->getXref(); print "\n\t\t\t\t <a href=\"" . encode_url("hourglass.php?pid={$cid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}") . "\"><span "; $name = $child->getFullName(); $name = rtrim($name); if (hasRTLText($name)) { print "class=\"name2\">< "; } else { print "class=\"name1\">< "; } print PrintReady($name); print "<br /></span></a>"; } } } //-- do we need to print this arrow? print "<img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["rarrow"]["other"] . "\" border=\"0\" alt=\"\" /> "; //-- print the siblings foreach ($cfamids as $famid => $family) { if (!is_null($family)) { if (!is_null($family->getHusband()) || !is_null($family->getWife())) { print "<span class=\"name1\"><br />" . $pgv_lang["parents"] . "<br /></span>"; $husb = $family->getHusband(); if (!empty($husb)) { $spid = $husb->getXref(); print "\n\t\t\t\t <a href=\"" . encode_url("hourglass.php?pid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}") . "\"><span "; $name = $husb->getFullName(); $name = rtrim($name); if (hasRTLText($name)) { print "class=\"name2\">"; } else { print "class=\"name1\">"; } print PrintReady($name); print "<br /></span></a>"; } $husb = $family->getWife(); if (!empty($husb)) { $spid = $husb->getXref(); print "\n\t\t\t\t <a href=\"" . encode_url("hourglass.php?pid={$spid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}") . "\"><span "; $name = $husb->getFullName(); $name = rtrim($name); if (hasRTLText($name)) { print "class=\"name2\">"; } else { print "class=\"name1\">"; } print PrintReady($name); print "<br /></span></a>"; } } $children = $family->getChildren(); $num = $family->getNumberOfChildren(); if ($num > 2) { print "<span class=\"name1\"><br />" . $pgv_lang["siblings"] . "<br /></span>"; } if ($num == 2) { print "<span class=\"name1\"><br />" . $pgv_lang["sibling"] . "<br /></span>"; } foreach ($children as $id => $child) { $cid = $child->getXref(); if ($cid != $pid) { print "\n\t\t\t\t <a href=\"" . encode_url("hourglass.php?pid={$cid}&show_spouse={$this->show_spouse}&show_full={$this->show_full}&generations={$this->generations}&box_width={$this->box_width}") . "\"><span "; $name = $child->getFullName(); $name = rtrim($name); if (hasRTLText($name)) { print "class=\"name2\"> "; } else { print "class=\"name1\"> "; } print PrintReady($name); print "<br /></span></a>"; } } } } print "\n\t\t\t</td></tr></table>"; print "\n\t\t</div>"; print "\n\t\t</div>"; } } } print "</td></tr>"; print "</table>"; return $numkids; }
echo '<td class="optionbox"><select name="showall">'; echo '<option value="0"', $showall == 0 ? ' selected="selected"' : '', '>', $pgv_lang['err_rec'], '</option>'; echo '<option value="1"', $showall == 1 ? ' selected="selected"' : '', '>', $pgv_lang['all_rec'], '</option>'; echo '</select></td></tr>'; echo '<tr><td colspan="2" class="list_label"><input type="submit" value="', $pgv_lang['show'], '"><input type="hidden" name="action" value="go"></td></tr>'; echo '</table></form><hr />'; // Do not run until user clicks "show", as default page may take a while to load. // Instead, show some useful help info. if (!isset($_POST['action'])) { echo '<p>', $pgv_lang['gedcheck_text'], '</p><hr />'; print_footer(); exit; } // If we're checking a gedcom that is imported into the database, check that the file is synchronised if ($ged == PGV_GEDCOM && !$SYNC_GEDCOM_FILE) { $ged_link = 'href="javascript:" onclick="window.open(\'' . encode_url("export_gedcom.php?export={$ged}") . '\', \'_blank\',\'left=50,top=50,width=500,height=500,resizable=1,scrollbars=1\');"'; echo '<div class="error">', print_text('gedcheck_sync', 0, 1), '</div><hr/>'; } // Special cases. Other facts link to themselves; SUBN, SUBN, OBJE, NOTE, REPO, SOUR $XREF_LINK = array('FAMC' => 'FAM', 'FAMS' => 'FAM', 'HUSB' => 'INDI', 'WIFE' => 'INDI', 'CHIL' => 'INDI', 'ASSO' => 'INDI', 'ALIA' => 'INDI', 'ANCI' => 'SUBM', 'DESI' => 'SUBM', '_PGV_OBJS' => 'OBJE', 'AUTH' => 'INDI'); // Use the global settings for these (if they exist) if (isset($FAM_FACTS_UNIQUE)) { $fam_facts_unique = preg_split('/[, ;:]+/', $FAM_FACTS_UNIQUE, -1, PREG_SPLIT_NO_EMPTY); } else { $fam_facts_unique = array(); } if (isset($INDI_FACTS_UNIQUE)) { $indi_facts_unique = preg_split('/[, ;:]+/', $INDI_FACTS_UNIQUE, -1, PREG_SPLIT_NO_EMPTY); } else { $indi_facts_unique = array(); }
print $pgv_lang["current_gedcoms"]; print "</td>"; foreach ($configuredlanguages["gedcom"] as $key => $value) { if (!isset($currentkey)) { $currentkey = $key; } if ($currentkey != $key) { print "</td></tr><tr><td class=\"facts_value\" colspan=\"2\" valign=\"top\">"; $currentkey = $key; } else { print "<td class=\"facts_value\" colspan=\"2\" valign=\"top\">"; } // Print gedcom names foreach ($value as $gedcomname => $used) { echo '<a href="', encode_url("editconfig_gedcom.php?ged={$gedcomname}"), '" target="blank">', $gedcomname, '</a><br />'; } print "</td><td class=\"facts_value\" colspan=\"2\" valign=\"top\">"; // Print language name and flag print "<img src=\"" . $language_settings[$key]["flagsfile"] . "\" class=\"brightflag\" alt=\"" . $pgv_lang["lang_name_" . $key] . "\" title=\"" . $pgv_lang["lang_name_" . $key] . "\" /> " . $pgv_lang["lang_name_" . $key] . "<br />"; } print "</td></tr><tr><td class=\"facts_value\" colspan=\"5\" valign=\"top\">" . $pgv_lang["users_langs"] . "</td><td class=\"facts_value\" colspan=\"2\">"; foreach ($configuredlanguages["users"] as $key => $value) { print "<img src=\"" . $language_settings[$key]["flagsfile"] . "\" class=\"brightflag\" alt=\"" . $pgv_lang["lang_name_" . $key] . "\" title=\"" . $pgv_lang["lang_name_" . $key] . "\" /> <a href=\"" . encode_url("useradmin.php?action=listusers&filter=language&usrlang={$key}") . "\">" . $pgv_lang["lang_name_" . $key] . "</a><br />"; } print "</td></tr>"; } print "</table>"; print "</form>"; $LANGUAGE = $USERLANG; print "</div>"; print_footer();
/** * * Replaces the meta content refresh URL with a proxified version. * **/ function replaceMetaContent($match) { global $_script_url; global $_config; return 'content="0;url=' . $_script_url . '?' . $_config['url_var_name'] . '=' . encode_url($match[1]) . '"'; }
for ($lt = 0; $lt < pg_numrows($res); $lt++) { $nick = pg_result($res, $lt, 0); $jid = pg_result($res, $lt, 1); $grp = pg_result($res, $lt, 2); if ($grp == "") { $grp = $con_no_g[$lang]; } if ($col == "e0e9f7") { $col = "e8eef7"; } else { $col = "e0e9f7"; } $predefined = "{$jid}"; $predefined = encode_url($predefined, $token, $url_key); $predefined_s = "from:{$jid}"; $predefined_s = encode_url($predefined_s, $token, $url_key); if (in_array($jid, $do_notlog_list) == TRUE) { $selected = "selected"; } else { $selected = ""; } if ($selected != "") { $col = "b7b7b7"; } print '<tr bgcolor="' . $col . '" onMouseOver="this.bgColor=\'c3d9ff\';" onMouseOut="this.bgColor=\'#' . $col . '\';">' . "\n"; print '<td title="' . $con_title[$lang] . '" style="padding-left:7px" onclick="window.location=\'chat_map.php?chat_map=' . $predefined . '\';"><b>' . cut_nick(htmlspecialchars($nick)) . '</b></td>' . "\n"; print '<td>(<i>' . htmlspecialchars($jid) . '</i>)</td>' . "\n"; print '<td style="text-align: center;">' . cut_nick(htmlspecialchars($grp)) . '</td>' . "\n"; print '<td style="text-align: center;"><a href="chat_map.php?chat_map=' . $predefined . '"><u>' . $show_chat_as_map[$lang] . '</u></a>|<a href="search_v2.php?b=' . $predefined_s . '"><u>' . $show_chat_stream[$lang] . '</u></a></td>'; print '<td style="text-align: center;">' . "\n"; // temporary solution we should put integers here instead of full jids
// Row 1 column 3: title "Undo all" $output2 .= "<td class=\"list_label\">" . $pgv_lang['undo_all'] . "</td></tr>"; // Row 2 column 1: action "Accept all" $output2 .= "<tr><td class=\"list_value\">"; $count = 0; foreach ($changedgedcoms as $ged => $value) { if ($count != 0) { $output2 .= "<br /><br />"; } $output2 .= "<a href=\"" . encode_url("edit_changes.php?action=acceptall&ged={$ged}") . "\">{$ged} - " . $pgv_lang['accept_all'] . "</a>"; $count++; } $output2 .= "</td>"; // Row 2 column 2: separator $output2 .= "<td class=\"list_value width25\"> </td>"; // Row 2 column 3: action "Undo all" $output2 .= "<td class=\"list_value\">"; $count = 0; foreach ($changedgedcoms as $ged => $value) { if ($count != 0) { $output2 .= "<br /><br />"; } $output2 .= "<a href=\"" . encode_url("edit_changes.php?action=undoall&ged={$ged}") . "\" onclick=\"return confirm('" . $pgv_lang['undo_all_confirm'] . "');\">{$ged} - " . $pgv_lang['undo_all'] . "</a>"; $count++; } $output2 .= '</td></tr></table>'; echo '<center>', $pgv_lang['accept_gedcom'], '<br />', $output2, $output, $output2, '</center>'; } echo '</div>'; echo "<br /><br /><center><a href=\"javascript:;\" onclick=\"if (window.opener.showchanges) window.opener.showchanges(); window.close();\">", $pgv_lang['close_window'], '</a><br /></center>'; print_simple_footer();
/** * get the other menu * @return Menu */ function &getOtherMenu() { global $TEXT_DIRECTION, $PGV_IMAGE_DIR, $PGV_IMAGES, $GEDCOM, $pgv_lang; global $SHOW_GEDCOM_RECORD, $ENABLE_CLIPPINGS_CART; if ($TEXT_DIRECTION == "rtl") { $ff = "_rtl"; } else { $ff = ""; } if (!$this->note->canDisplayDetails() || !$SHOW_GEDCOM_RECORD && $ENABLE_CLIPPINGS_CART < PGV_USER_ACCESS_LEVEL) { $tempvar = false; return $tempvar; } // other menu $menu = new Menu($pgv_lang['other']); $menu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}"); if ($SHOW_GEDCOM_RECORD) { $menu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['gedcom']['small']}"); if ($this->show_changes && $this->userCanEdit()) { $menu->addLink("javascript:show_gedcom_record('new');"); } else { $menu->addLink("javascript:show_gedcom_record();"); } } else { if (!empty($PGV_IMAGES["clippings"]["small"])) { $menu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['clippings']['small']}"); } $menu->addLink(encode_url("clippings.php?action=add&id={$this->nid}&type=note")); } if ($SHOW_GEDCOM_RECORD) { // other / view_gedcom $submenu = new Menu($pgv_lang['view_gedcom']); if ($this->show_changes && $this->userCanEdit()) { $submenu->addLink("javascript:show_gedcom_record('new');"); } else { $submenu->addLink("javascript:show_gedcom_record();"); } $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['gedcom']['small']}"); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}"); $menu->addSubmenu($submenu); } if ($ENABLE_CLIPPINGS_CART >= PGV_USER_ACCESS_LEVEL) { // other / add_to_cart $submenu = new Menu($pgv_lang['add_to_cart'], encode_url("clippings.php?action=add&id={$this->nid}&type=note")); if (!empty($PGV_IMAGES["clippings"]["small"])) { $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['clippings']['small']}"); } $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}"); $menu->addSubmenu($submenu); } if ($this->note->canDisplayDetails() && !empty($this->uname)) { // other / add_to_my_favorites $submenu = new Menu($pgv_lang['add_to_my_favorites'], encode_url("note.php?action=addfav&nid={$this->nid}&gid={$this->nid}")); $submenu->addIcon("{$PGV_IMAGE_DIR}/{$PGV_IMAGES['gedcom']['small']}"); $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}"); $menu->addSubmenu($submenu); } return $menu; }
/** * print ancestors on a fan chart * * @param array $treeid ancestry pid * @param int $fanw fan width in px (default=640) * @param int $fandeg fan size in deg (default=270) */ function print_fan_chart($treeid, $fanw = 640, $fandeg = 270) { global $PEDIGREE_GENERATIONS, $fan_width, $fan_style; global $name, $pgv_lang, $SHOW_ID_NUMBERS, $view, $TEXT_DIRECTION; global $stylesheet, $print_stylesheet; global $PGV_IMAGE_DIR, $PGV_IMAGES, $LINK_ICONS, $GEDCOM; // check for GD 2.x library if (!defined("IMG_ARC_PIE")) { print "<span class=\"error\">" . $pgv_lang["gd_library"] . "</span>"; print " <a href=\"" . $pgv_lang["gd_helplink"] . "\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["help"]["small"] . "\" class=\"icon\" alt=\"\" /></a><br /><br />"; return false; } if (!function_exists("ImageTtfBbox")) { print "<span class=\"error\">" . $pgv_lang["gd_freetype"] . "</span>"; print " <a href=\"" . $pgv_lang["gd_helplink"] . "\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["help"]["small"] . "\" class=\"icon\" alt=\"\" /></a><br /><br />"; return false; } // parse CSS file include "includes/cssparser.inc.php"; $css = new cssparser(false); if ($view == "preview") { $css->Parse($print_stylesheet); } else { $css->Parse($stylesheet); } // check for fontfile $fontfile = $css->Get(".fan_chart", "font-family"); $fontsize = $css->Get(".fan_chart", "font-size"); $fontfile = str_replace("url(", "", $fontfile); $fontfile = str_replace(")", "", $fontfile); if (!file_exists($fontfile)) { if (!empty($fontfile)) { print "<span class=\"error\">" . $pgv_lang["fontfile_error"] . " : {$fontfile}</span>"; } $fontfile = "./includes/fonts/DejaVuSans.ttf"; } if ($fontfile[0] != '/') { $fontfile = dirname(__FILE__) . "/" . $fontfile; } if (!file_exists($fontfile)) { print "<span class=\"error\">" . $pgv_lang["fontfile_error"] . " : {$fontfile}</span>"; return false; } if (intval($fontsize) < 2) { $fontsize = 7; } $treesize = count($treeid); if ($treesize < 1) { return; } // generations count $gen = log($treesize) / log(2) - 1; $sosa = $treesize - 1; // fan size if ($fandeg == 0) { $fandeg = 360; } $fandeg = min($fandeg, 360); $fandeg = max($fandeg, 90); $cx = $fanw / 2 - 1; // center x $cy = $cx; // center y $rx = $fanw - 1; $rw = $fanw / ($gen + 1); $fanh = $fanw; // fan height if ($fandeg == 180) { $fanh = round($fanh * ($gen + 1) / ($gen * 2)); } if ($fandeg == 270) { $fanh = round($fanh * 0.86); } $scale = $fanw / 640; // image init $image = ImageCreate($fanw, $fanh); $black = ImageColorAllocate($image, 0, 0, 0); $white = ImageColorAllocate($image, 0xff, 0xff, 0xff); ImageFilledRectangle($image, 0, 0, $fanw, $fanh, $white); ImageColorTransparent($image, $white); $rgb = $css->Get(".fan_chart", "color"); if (empty($rgb)) { $rgb = "#000000"; } $color = ImageColorAllocate($image, hexdec(substr($rgb, 1, 2)), hexdec(substr($rgb, 3, 2)), hexdec(substr($rgb, 5, 2))); $rgb = $css->Get(".fan_chart", "background-color"); if (empty($rgb)) { $rgb = "#EEEEEE"; } $bgcolor = ImageColorAllocate($image, hexdec(substr($rgb, 1, 2)), hexdec(substr($rgb, 3, 2)), hexdec(substr($rgb, 5, 2))); $rgb = $css->Get(".fan_chart_box", "background-color"); if (empty($rgb)) { $rgb = "#D0D0AC"; } $bgcolorM = ImageColorAllocate($image, hexdec(substr($rgb, 1, 2)), hexdec(substr($rgb, 3, 2)), hexdec(substr($rgb, 5, 2))); $rgb = $css->Get(".fan_chart_boxF", "background-color"); if (empty($rgb)) { $rgb = "#D0ACD0"; } $bgcolorF = ImageColorAllocate($image, hexdec(substr($rgb, 1, 2)), hexdec(substr($rgb, 3, 2)), hexdec(substr($rgb, 5, 2))); // imagemap $imagemap = "<map id=\"fanmap\" name=\"fanmap\">"; // loop to create fan cells while ($gen >= 0) { // clean current generation area $deg2 = 360 + ($fandeg - 180) / 2; $deg1 = $deg2 - $fandeg; ImageFilledArc($image, $cx, $cy, $rx, $rx, $deg1, $deg2, $bgcolor, IMG_ARC_PIE); $rx -= 3; // calculate new angle $p2 = pow(2, $gen); $angle = $fandeg / $p2; $deg2 = 360 + ($fandeg - 180) / 2; $deg1 = $deg2 - $angle; // special case for rootid cell if ($gen == 0) { $deg1 = 90; $deg2 = 360 + $deg1; } // draw each cell while ($sosa >= $p2) { $pid = $treeid[$sosa]; if (!empty($pid)) { $indirec = find_person_record($pid); if (!$indirec) { $indirec = find_updated_record($pid); } if ($sosa % 2) { $bg = $bgcolorF; } else { $bg = $bgcolorM; } if ($sosa == 1) { $bg = $bgcolor; // sex unknown if (preg_match("/1 SEX F/", $indirec) > 0) { $bg = $bgcolorF; } else { if (preg_match("/1 SEX M/", $indirec) > 0) { $bg = $bgcolorM; } } } ImageFilledArc($image, $cx, $cy, $rx, $rx, $deg1, $deg2, $bg, IMG_ARC_PIE); $person = Person::getInstance($pid); $name = $person->getFullName(); $addname = $person->getAddName(); //$name = str_replace(array('<span class="starredname">', '</span>'), '', $name); //$addname = str_replace(array('<span class="starredname">', '</span>'), '', $addname); //$name = str_replace(array('<span class="starredname">', '</span>'), array('<u>', '</u>'), $name); //@@ //$addname = str_replace(array('<span class="starredname">', '</span>'), array('<u>', '</u>'), $addname); //@@ // ToDo - print starred names underlined - 1985154 // Todo - print Arabic letters combined - 1360209 $text = reverseText($name) . "\n"; if (!empty($addname)) { $text .= reverseText($addname) . "\n"; } if (displayDetailsById($pid)) { $birthrec = get_sub_record(1, "1 BIRT", $indirec); $ct = preg_match("/2 DATE.*(\\d\\d\\d\\d)/", $birthrec, $match); if ($ct > 0) { $text .= trim($match[1]); } $deathrec = get_sub_record(1, "1 DEAT", $indirec); $ct = preg_match("/2 DATE.*(\\d\\d\\d\\d)/", $deathrec, $match); if ($ct > 0) { $text .= "-" . trim($match[1]); } } $text = unhtmlentitiesrtl($text); $text = strip_tags($text); //Do we still need? // split and center text by lines $wmax = floor($angle * 7 / $fontsize * $scale); $wmax = min($wmax, 35 * $scale); if ($gen == 0) { $wmax = min($wmax, 17 * $scale); } $text = split_align_text($text, $wmax); // text angle $tangle = 270 - ($deg1 + $angle / 2); if ($gen == 0) { $tangle = 0; } // calculate text position $bbox = ImageTtfBbox((double) $fontsize, 0, $fontfile, $text); $textwidth = $bbox[4]; $deg = $deg1 + 0.44; if ($deg2 - $deg1 > 40) { $deg = $deg1 + ($deg2 - $deg1) / 11; } if ($deg2 - $deg1 > 80) { $deg = $deg1 + ($deg2 - $deg1) / 7; } if ($deg2 - $deg1 > 140) { $deg = $deg1 + ($deg2 - $deg1) / 4; } if ($gen == 0) { $deg = 180; } $rad = deg2rad($deg); $mr = ($rx - $rw / 4) / 2; if ($gen > 0 and $deg2 - $deg1 > 80) { $mr = $rx / 2; } $tx = $cx + $mr * cos($rad); $ty = $cy - $mr * -sin($rad); if ($sosa == 1) { $ty -= $mr / 2; } // print text ImageTtfText($image, (double) $fontsize, $tangle, $tx, $ty, $color, $fontfile, $text); $imagemap .= "<area shape=\"poly\" coords=\""; // plot upper points $mr = $rx / 2; $deg = $deg1; while ($deg <= $deg2) { $rad = deg2rad($deg); $tx = round($cx + $mr * cos($rad)); $ty = round($cy - $mr * -sin($rad)); $imagemap .= "{$tx}, {$ty}, "; $deg += ($deg2 - $deg1) / 6; } // plot lower points $mr = ($rx - $rw) / 2; $deg = $deg2; while ($deg >= $deg1) { $rad = deg2rad($deg); $tx = round($cx + $mr * cos($rad)); $ty = round($cy - $mr * -sin($rad)); $imagemap .= "{$tx}, {$ty}, "; $deg -= ($deg2 - $deg1) / 6; } // join first point $mr = $rx / 2; $deg = $deg1; $rad = deg2rad($deg); $tx = round($cx + $mr * cos($rad)); $ty = round($cy - $mr * -sin($rad)); $imagemap .= "{$tx}, {$ty}"; // add action url $tempURL = "javascript://" . htmlspecialchars(strip_tags($name)); if ($SHOW_ID_NUMBERS) { $tempURL .= " (" . $pid . ")"; } $imagemap .= "\" href=\"{$tempURL}\" "; $tempURL = "fanchart.php?rootid={$pid}&PEDIGREE_GENERATIONS={$PEDIGREE_GENERATIONS}&fan_width={$fan_width}&fan_style={$fan_style}"; if (!empty($view)) { $tempURL .= "&view={$view}"; } $count = 0; $lbwidth = 200; print "<div id=\"I" . $pid . "." . $count . "links\" style=\"position:absolute; >"; print "left:" . $tx . "px; top:" . $ty . "px; width: " . $lbwidth . "px; visibility:hidden; z-index:'100';\">"; print "<table class=\"person_box\"><tr><td class=\"details1\">"; print "<a href=\"individual.php?pid={$pid}\" class=\"name1\">" . PrintReady($name); if (!empty($addname)) { print "<br />" . PrintReady($addname); } print "</a>"; print "<br /><a href=\"pedigree.php?rootid={$pid}\" >" . $pgv_lang["index_header"] . "</a>"; print "<br /><a href=\"descendancy.php?pid={$pid}\" >" . $pgv_lang["descend_chart"] . "</a>"; if (PGV_USER_GEDCOM_ID) { print "<br /><a href=\"" . encode_url("relationship.php?pid1=" . PGV_USER_GEDCOM_ID . "&pid2={$pid}&ged={$GEDCOM}") . "\" onmouseover=\"clear_family_box_timeout('" . $pid . "." . $count . "');\" onmouseout=\"family_box_timeout('" . $pid . "." . $count . "');\">" . $pgv_lang["relationship_to_me"] . "</a>"; } print "<br /><a href=\"ancestry.php?rootid={$pid}\" onmouseover=\"clear_family_box_timeout('" . $pid . "." . $count . "');\" onmouseout=\"family_box_timeout('" . $pid . "." . $count . "');\">" . $pgv_lang["ancestry_chart"] . "</a>"; print "<br /><a href=\"compact.php?rootid={$pid}\" onmouseover=\"clear_family_box_timeout('" . $pid . "." . $count . "');\" onmouseout=\"family_box_timeout('" . $pid . "." . $count . "');\">" . $pgv_lang["compact_chart"] . "</a>"; print "<br /><a href=\"" . encode_url($tempURL) . "\" onmouseover=\"clear_family_box_timeout('" . $pid . "." . $count . "');\" onmouseout=\"family_box_timeout('" . $pid . "." . $count . "');\">" . $pgv_lang["fan_chart"] . "</a>"; print "<br /><a href=\"hourglass.php?pid={$pid}\" onmouseover=\"clear_family_box_timeout('" . $pid . "." . $count . "');\" onmouseout=\"family_box_timeout('" . $pid . "." . $count . "');\">" . $pgv_lang["hourglass_chart"] . "</a>"; if ($sosa >= 1) { $famids = find_sfamily_ids($pid); //-- make sure there is more than 1 child in the family with parents $cfamids = find_family_ids($pid); $num = 0; for ($f = 0; $f < count($cfamids); $f++) { $famrec = find_family_record($cfamids[$f]); if ($famrec) { $num += preg_match_all("/1\\s*CHIL\\s*@(.*)@/", $famrec, $smatch, PREG_SET_ORDER); } } if ($famids || $num > 1) { //-- spouse(s) and children for ($f = 0; $f < count($famids); $f++) { $famrec = find_family_record(trim($famids[$f])); if ($famrec) { $parents = find_parents($famids[$f]); if ($parents) { if ($pid != $parents["HUSB"]) { $spid = $parents["HUSB"]; } else { $spid = $parents["WIFE"]; } $person = Person::getInstance($spid); if ($person) { echo '<br /><a href="', $person->getLinkUrl(), '" class="name1">', $person->getFullName(), '</a>'; } } $num = preg_match_all("/1\\s*CHIL\\s*@(.*)@/", $famrec, $smatch, PREG_SET_ORDER); for ($i = 0; $i < $num; $i++) { $person = Person::getInstance($smatch[$i][1]); if ($person) { echo '<br /> <a href="', $person->getLinkUrl(), '" class="name1">< ', $person->getFullName(), '</a>'; } } } } //-- siblings for ($f = 0; $f < count($cfamids); $f++) { $famrec = find_family_record($cfamids[$f]); if ($famrec) { $num = preg_match_all("/1\\s*CHIL\\s*@(.*)@/", $famrec, $smatch, PREG_SET_ORDER); if ($num > 2) { print "<br /><span class=\"name1\">" . $pgv_lang["siblings"] . "</span>"; } if ($num == 2) { print "<br /><span class=\"name1\">" . $pgv_lang["sibling"] . "</span>"; } for ($i = 0; $i < $num; $i++) { $cpid = $smatch[$i][1]; if ($cpid != $pid) { $person = Person::getInstance($cpid); if ($person) { echo '<br /> <a href="', $person->getLinkUrl(), '" class="name1"> ', $person->getFullName(), '</a>'; } } } } } } } print "</td></tr></table>"; print "</div>"; $imagemap .= " onclick=\"show_family_box('" . $pid . "." . $count . "', 'relatives'); return false;\""; $imagemap .= " onmouseout=\"family_box_timeout('" . $pid . "." . $count . "'); return false;\""; $imagemap .= " alt=\"" . PrintReady(strip_tags($name)) . "\" title=\"" . PrintReady(strip_tags($name)) . "\" />"; } $deg1 -= $angle; $deg2 -= $angle; $sosa--; } $rx -= $rw; $gen--; } $imagemap .= "</map>"; echo $imagemap; // PGV banner ;-) ImageStringUp($image, 1, $fanw - 10, $fanh / 3, PGV_PHPGEDVIEW_URL, $color); // here we cannot send image to browser ('header already sent') // and we dont want to use a tmp file // step 1. save image data in a session variable ob_start(); ImagePng($image); $image_data = ob_get_contents(); ob_end_clean(); $image_data = serialize($image_data); unset($_SESSION['image_data']); $_SESSION['image_data'] = $image_data; // step 2. call imageflush.php to read this session variable and display image // note: arg "image_name=" is to avoid image miscaching $image_name = "V" . time(); unset($_SESSION[$image_name]); // statisticsplot.php uses this to hold a file name to send to browser $image_title = preg_replace("~<.*>~", "", $name) . " " . $pgv_lang["fan_chart"]; echo "<p align=\"center\" >"; echo "<img src=\"imageflush.php?image_type=png&image_name={$image_name}&height={$fanh}&width={$fanw}\" width=\"{$fanw}\" height=\"{$fanh}\" border=\"0\" alt=\"{$image_title}\" title=\"{$image_title}\" usemap=\"#fanmap\" />"; echo "</p>"; ImageDestroy($image); }
function print_todays_events($block = true, $config = "", $side, $index) { global $pgv_lang, $SHOW_ID_NUMBERS, $ctype, $TEXT_DIRECTION; global $PGV_IMAGE_DIR, $PGV_IMAGES, $PGV_BLOCKS; $block = true; // Always restrict this block's height $todayjd = client_jd(); if (empty($config)) { $config = $PGV_BLOCKS["print_todays_events"]["config"]; } if (isset($config["filter"])) { $filter = $config["filter"]; } else { $filter = "all"; } if (isset($config["onlyBDM"])) { $onlyBDM = $config["onlyBDM"]; } else { $onlyBDM = "no"; } if (isset($config["infoStyle"])) { $infoStyle = $config["infoStyle"]; } else { $infoStyle = "style2"; } if (isset($config["sortStyle"])) { $sortStyle = $config["sortStyle"]; } else { $sortStyle = "alpha"; } if (isset($config["allowDownload"])) { $allowDownload = $config["allowDownload"]; } else { $allowDownload = "yes"; } // Don't permit calendar download if not logged in if (!PGV_USER_ID) { $allowDownload = "no"; } //-- Start output $id = "on_this_day_events"; $title = print_help_link("index_onthisday_help", "qm", "", false, true); if ($PGV_BLOCKS["print_todays_events"]["canconfig"]) { if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) { if ($ctype == "gedcom") { $name = PGV_GEDCOM; } else { $name = PGV_USER_NAME; } $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('" . encode_url("index_edit.php?name={$name}&ctype={$ctype}&action=configure&side={$side}&index={$index}") . "', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">"; $title .= "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/" . $PGV_IMAGES["admin"]["small"] . "\" width=\"15\" height=\"15\" border=\"0\" alt=\"" . $pgv_lang["config_block"] . "\" /></a>"; } } $title .= $pgv_lang["on_this_day"]; $content = ""; switch ($infoStyle) { case "style1": // Output style 1: Old format, no visible tables, much smaller text. Better suited to right side of page. $content .= print_events_list($todayjd, $todayjd, $onlyBDM == 'yes' ? 'BIRT MARR DEAT' : '', $filter == 'living', $sortStyle); break; case "style2": // Style 2: New format, tables, big text, etc. Not too good on right side of page ob_start(); $content .= print_events_table($todayjd, $todayjd, $onlyBDM == 'yes' ? 'BIRT MARR DEAT' : '', $filter == 'living', $allowDownload == 'yes', $sortStyle); $content .= ob_get_clean(); break; } global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
function proxify_url($url, $proxify = true) { $url = trim($url); $fragment = ($hash_pos = strpos($url, '#') !== false) ? '#' . substr($url, $hash_pos) : ''; if (!preg_match('#^[a-zA-Z]+://#', $url)) { switch ($url[0]) { case '/': $url = $this->base['scheme'] . '://' . $this->base['host'] . ($this->base['port'] != 80 ? ':' . $this->base['port'] : '') . $url; break; case '?': $url = $this->base['base'] . '/' . $this->base['file'] . $url; break; case '#': $proxify = false; break; case 'm': if (substr($url, 0, 7) == 'mailto:') { $proxify = false; break; } default: $url = $this->base['base'] . '/' . $url; } } return $proxify ? "{$this->script_url}?{$this->config['url_var_name']}=" . encode_url($url) . $fragment : $url; }
print '<center><div class="message" style="width: 250px;">' . $trash_empty[$lang] . '</div></center>'; } else { print '<center>'; print '<table id="maincontent" class="ff" align="center" border="0" cellspacing="0">'; print '<tr class="header"><td style="padding-right: 15px;">' . $my_links_chat[$lang] . '</td><td style="padding-right: 15px;">' . $logger_from_day[$lang] . '</td><td>' . $del_time[$lang] . '</td></tr>'; print '<tr class="spacer"><td colspan="5"></td></tr>'; print '<tbody id="searchfield">'; while ($entry = mysql_fetch_array($result)) { $talker = get_user_name($entry["peer_name_id"], $xmpp_host); $server_name = get_server_name($entry["peer_server_id"], $xmpp_host); $tslice = $entry["date"]; $nickname = query_nick_name($bazaj, $token, $talker, $server_name); print '<tr><td style="padding-left: 10px; padding-right: 10px;"><b>' . htmlspecialchars($nickname) . '</b> (<i>' . htmlspecialchars($talker) . '@' . htmlspecialchars($server_name) . '</i>)</td><td style="text-align: center;">' . $tslice . '</td>'; print '<td style="padding-left: 5px; padding-right: 5px; font-size: x-small;">' . $entry[timeframe] . '</td>'; $reconstruct_link = encode_url("{$tslice}@{$entry['peer_name_id']}@{$entry['peer_server_id']}@", $token, $url_key); // try to reconstruct oryginal link $undelete_link = "{$tslice}@{$entry['peer_name_id']}@{$entry['peer_server_id']}@@@{$reconstruct_link}@undelete@"; $undelete_link = encode_url($undelete_link, $token, $url_key); $delete_link = "{$tslice}@{$entry['peer_name_id']}@{$entry['peer_server_id']}@@@{$reconstruct_link}@delete@"; $delete_link = encode_url($delete_link, $token, $url_key); print '<td style="padding-left: 10px;"><a href="trash.php?a=' . $undelete_link . '">' . $trash_undel[$lang] . '</a></td>'; print '<td style="padding-left: 10px;"><a href="trash.php?a=' . $delete_link . '" onClick="if (!confirm(\'' . $del_conf[$lang] . '\')) return false;">' . $trash_del[$lang] . '</a></td>'; print '</tr>'; } print '</tbody>'; print '<tr class="spacer"><td colspan="5"></td></tr>'; print '<tr class="foot"><td colspan="5" height="15"></td></tr>'; print '</table>'; print '</center>'; } include "footer.php";
} elseif ($source == "add_new_form") { $check = "add_new"; } if (!isset($bakfile)) { $bakfile = ""; } if ($source !== "") { header("Location: " . encode_url("uploadgedcom.php?action={$source}&check={$check}&step=2&GEDFILENAME={$GEDFILENAME}&path={$path}&verify=verify_gedcom&bakfile={$bakfile}", false)); } else { header("Location: editgedcoms.php"); } exit; } } else { if ($action == "replace") { header("Location: " . encode_url("uploadgedcom.php?action=upload_form&GEDFILENAME={$GEDFILENAME}&path={$path}&verify=validate_form", false)); } } //-- output starts here print_header($pgv_lang["gedconf_head"]); if ($ENABLE_AUTOCOMPLETE && $source == '') { require PGV_ROOT . 'js/autocomplete.js.htm'; } if (!isset($GENERATE_UIDS)) { $GENERATE_UIDS = false; } $temp2 = $THEME_DIR; $THEME_DIR = $temp; $THEME_DIR = $temp2; if (!isset($NTHEME_DIR)) { $NTHEME_DIR = $THEME_DIR;
function print_map_tab() { global $SEARCH_SPIDER, $SESSION_HIDE_GOOGLEMAP, $pgv_lang, $CONTACT_EMAIL, $PGV_IMAGE_DIR, $PGV_IMAGES; global $LANGUAGE; global $GOOGLEMAP_API_KEY, $GOOGLEMAP_MAP_TYPE, $GOOGLEMAP_MIN_ZOOM, $GOOGLEMAP_MAX_ZOOM, $GEDCOM; global $GOOGLEMAP_XSIZE, $GOOGLEMAP_YSIZE, $pgv_lang, $factarray, $SHOW_LIVING_NAMES, $PRIV_PUBLIC; global $GOOGLEMAP_ENABLED, $TEXT_DIRECTION, $GM_DEFAULT_TOP_VALUE, $GOOGLEMAP_COORD; global $GM_MARKER_COLOR, $GM_MARKER_SIZE, $GM_PREFIX, $GM_POSTFIX, $GM_PRE_POST_MODE; // Use Show or Hide Navigator Cookie ----------- if (isset($_COOKIE['famnav'])) { $Fam_Navigator = $_COOKIE['famnav']; } else { $Fam_Navigator = "YES"; } // Hide the Family Navigator on this tab ============== $Fam_Navigator = "HIDE"; // =============================================== // LB Fix if no googlemaps ======================================================== if (file_exists("modules/googlemap/googlemap.php")) { include_once 'modules/googlemap/googlemap.php'; } // LB Fix in no googlemaps ======================================================== if ($GOOGLEMAP_ENABLED == "false") { print "<table class=\"facts_table\">\n"; print "<tr><td colspan=\"2\" class=\"facts_value\">" . $pgv_lang["gm_disabled"] . "</td></tr>\n"; if (PGV_USER_IS_ADMIN) { print "<tr><td align=\"center\" colspan=\"2\">\n"; print "<a href=\"" . encode_url("module.php?mod=googlemap&pgvaction=editconfig") . "\">" . $pgv_lang["gm_manage"] . "</a>"; print "</td></tr>\n"; } print "\n\t</table>\n<br />"; ?> <script language="JavaScript" type="text/javascript"> <!-- tabstyles[5]='tab_cell_inactive_empty'; document.getElementById('pagetab5').className='tab_cell_inactive_empty'; document.getElementById("googlemap_left").innerHTML = document.getElementById("googlemap_content").innerHTML; document.getElementById("googlemap_content").innerHTML = ""; function ResizeMap () {} function SetMarkersAndBounds () {} //--> </script> <?php return; } else { $famids = array(); $families = $this->indi->getSpouseFamilies(); foreach ($families as $famid => $family) { $famids[] = $family->getXref(); } $this->indi->add_family_facts(false); // LB Fix if no googlemaps ======================================================== if (file_exists("modules/googlemap/googlemap.php")) { create_indiv_buttons(); build_indiv_map($this->getIndiFacts(), $famids); } // LB Fix if no googlemaps ======================================================== } // ==================== Start Map Tab Navigator ======================================== if ($Fam_Navigator == "YES") { ?> <table id="map_nav" class="optionbox" width="220px" cellpadding="0"><tr><td align="center"> <b><?php print $pgv_lang["view_fam_nav_map"]; ?> </b><br /><br /> <?php include_once 'includes/family_nav.php'; ?> <br /> </td></tr></table> <?php } // ==================== End Map Tab Navigator ========================================= }
include_once PHPGEDVIEW_PKG_PATH . 'BitGEDCOM.php'; $gGedcom = new BitGEDCOM(); // leave manual config until we can move it to bitweaver table require "config.php"; require $factsfile["english"]; if (file_exists($factsfile[$LANGUAGE])) { require $factsfile[$LANGUAGE]; } require './includes/functions/functions_print_lists.php'; require './includes/functions/functions_edit.php'; if (empty($ged)) { $ged = $GEDCOM; } $GEDCOM = $ged; if ($_SESSION["cookie_login"]) { header('Location: ' . encode_url("login.php?type=simple&ged={$GEDCOM}&url=addmedia.php", false)); exit; } // TODO use GET/POST, rather than $_REQUEST // TODO decide what validation is required on these input parameters $pid = safe_REQUEST($_REQUEST, 'pid', PGV_REGEX_XREF); $mid = safe_REQUEST($_REQUEST, 'mid', PGV_REGEX_XREF); $gid = safe_REQUEST($_REQUEST, 'gid', PGV_REGEX_XREF); $linktoid = safe_REQUEST($_REQUEST, 'linktoid', PGV_REGEX_XREF); $action = safe_REQUEST($_REQUEST, 'action', PGV_REGEX_NOSCRIPT, 'showmediaform'); $folder = safe_REQUEST($_REQUEST, 'folder', PGV_REGEX_UNSAFE); $oldFolder = safe_REQUEST($_REQUEST, 'oldFolder', PGV_REGEX_UNSAFE); $filename = safe_REQUEST($_REQUEST, 'filename', PGV_REGEX_UNSAFE); $oldFilename = safe_REQUEST($_REQUEST, 'oldFilename', PGV_REGEX_UNSAFE, $filename); $level = safe_REQUEST($_REQUEST, 'level', PGV_REGEX_UNSAFE); $text = safe_REQUEST($_REQUEST, 'text', PGV_REGEX_UNSAFE);
function top10_pageviews($block = true, $config = "", $side, $index) { global $TBLPREFIX, $pgv_lang, $INDEX_DIRECTORY, $PGV_BLOCKS, $ctype, $PGV_IMAGES, $PGV_IMAGE_DIR, $SHOW_COUNTER, $SHOW_SOURCES, $TEXT_DIRECTION; if (empty($config)) { $config = $PGV_BLOCKS["top10_pageviews"]["config"]; } if (isset($config["count_placement"])) { $CountSide = $config["count_placement"]; } else { $CountSide = "left"; } $id = "top10hits"; $title = print_help_link("index_top10_pageviews_help", "qm", "", false, true); if ($PGV_BLOCKS["top10_pageviews"]["canconfig"]) { if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) { if ($ctype == "gedcom") { $name = PGV_GEDCOM; } else { $name = PGV_USER_NAME; } $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('" . encode_url("index_edit.php?name={$name}&ctype={$ctype}&action=configure&side={$side}&index={$index}") . "', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">"; $title .= "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/" . $PGV_IMAGES["admin"]["small"] . "\" width=\"15\" height=\"15\" border=\"0\" alt=\"" . $pgv_lang["config_block"] . "\" /></a>"; } } $title .= $pgv_lang["top10_pageviews"]; $content = ""; // if the counter file does not exist then don't do anything if (!$SHOW_COUNTER) { if (PGV_USER_IS_ADMIN) { $content .= "<span class=\"error\">" . $pgv_lang["top10_pageviews_msg"] . "</span>"; } } else { // load the lines from the file $top10 = PGV_DB::prepareLimit("SELECT page_parameter, page_count" . " FROM {$TBLPREFIX}hit_counter" . " WHERE gedcom_id=? AND page_name IN ('individual.php','family.php','source.php','repo.php','note.php','mediaviewer.php')" . " ORDER BY page_count DESC", $config['num'])->execute(array(PGV_GED_ID))->FetchAssoc(); if ($top10) { if ($block) { $content .= "<table width=\"90%\">"; } else { $content .= "<table>"; } foreach ($top10 as $id => $count) { $record = GedcomRecord::getInstance($id); if ($record && $record->canDisplayDetails()) { $content .= '<tr valign="top">'; if ($CountSide == 'left') { $content .= '<td dir="ltr" align="right">[' . $count . ']</td>'; } $content .= '<td class="name2" ><a href="' . encode_url($record->getLinkUrl()) . '">' . PrintReady($record->getFullName()) . '</a></td>'; if ($CountSide == 'right') { $content .= '<td dir="ltr" align="right">[' . $count . ']</td>'; } $content .= '</tr>'; } } $content .= "</table>"; } else { $content .= "<b>" . $pgv_lang["top10_pageviews_nohits"] . "</b>"; } } global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
function complete_url($url, $proxify = true) { $url = trim($url); if ($url === '') { return ''; } $hash_pos = strrpos($url, '#'); $fragment = $hash_pos !== false ? '#' . substr($url, $hash_pos) : ''; $sep_pos = strpos($url, '://'); if ($sep_pos === false || $sep_pos > 5) { switch ($url[0]) { case '/': $url = substr($url, 0, 2) === '//' ? $GLOBALS['_base']['scheme'] . ':' . $url : $GLOBALS['_base']['scheme'] . '://' . $GLOBALS['_base']['host'] . $GLOBALS['_base']['port_ext'] . $url; break; case '?': $url = $GLOBALS['_base']['base'] . '/' . $GLOBALS['_base']['file'] . $url; break; case '#': $proxify = false; break; case 'm': if (substr($url, 0, 7) == 'mailto:') { $proxify = false; break; } default: $url = $GLOBALS['_base']['base'] . '/' . $url; } } return $proxify ? "{$GLOBALS['_script_url']}?{$GLOBALS['_config']['url_var_name']}=" . encode_url($url) . $fragment : $url; }
function print_time_fact($event) { global $basexoffset, $baseyoffset, $factcount, $TEXT_DIRECTION; global $factarray, $pgv_lang, $lang_short_cut, $LANGUAGE, $PGV_IMAGE_DIR, $PGV_IMAGES, $SHOW_PEDIGREE_PLACES, $placements; global $familyfacts, $GEDCOM; /* @var $event Event */ $factrec = $event->getGedComRecord(); $fact = $event->getTag(); $desc = $event->getDetail(); if ($fact == "EVEN" || $fact == "FACT") { $fact = $event->getType(); } //-- check if this is a family fact $famid = $event->getFamilyId(); if ($famid != null) { //-- if we already showed this family fact then don't print it if (isset($familyfacts[$famid . $fact]) && $familyfacts[$famid . $fact] != $event->temp) { return; } $familyfacts[$famid . $fact] = $event->temp; } $gdate = $event->getDate(); $date = $gdate->MinDate(); $date = $date->convert_to_cal('gregorian'); $year = $date->y; $month = max(1, $date->m); $day = max(1, $date->d); $xoffset = $basexoffset + 22; $yoffset = $baseyoffset + ($year - $this->baseyear) * $this->scale - $this->scale; $yoffset = $yoffset + $month / 12 * $this->scale; $yoffset = $yoffset + $day / 30 * ($this->scale / 12); $yoffset = floor($yoffset); $place = round($yoffset / $this->bheight); $i = 1; $j = 0; $tyoffset = 0; while (isset($placements[$place])) { if ($i == $j) { $tyoffset = $this->bheight * $i; $i++; } else { $tyoffset = -1 * $this->bheight * $j; $j++; } $place = round(($yoffset + $tyoffset) / $this->bheight); } $yoffset += $tyoffset; $xoffset += abs($tyoffset); $placements[$place] = $yoffset; print "\n\t\t<div id=\"fact{$factcount}\" style=\"position:absolute; " . ($TEXT_DIRECTION == "ltr" ? "left: " . $xoffset : "right: " . $xoffset) . "px; top:" . $yoffset . "px; font-size: 8pt; height: " . $this->bheight . "px; \" onmousedown=\"factMD(this, '" . $factcount . "', " . ($yoffset - $tyoffset) . ");\">\n"; print "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"cursor: hand;\"><tr><td>\n"; print "<img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["hline"]["other"] . "\" name=\"boxline{$factcount}\" id=\"boxline{$factcount}\" height=\"3\" align=\"left\" hspace=\"0\" width=\"10\" vspace=\"0\" alt=\"\" style=\"padding-"; if ($TEXT_DIRECTION == "ltr") { print "left"; } else { print "right"; } print ": 3px;\" />\n"; $col = $event->temp % 6; print "</td><td valign=\"top\" class=\"person" . $col . "\">\n"; if (count($this->pids) > 6) { print $event->getParentObject()->getFullName() . " - "; } $indi = $event->getParentObject(); if ($fact == "_AKAN" || $fact == "_AKA" || $fact == "ALIA" || $fact == "_INTE") { // Allow special processing for different languages $func = "fact_AKA_localisation_{$lang_short_cut[$LANGUAGE]}"; if (function_exists($func) && get_class($indi) == "Person") { // Localise the facts $func($fact, $indi->getXref()); print $factarray[$fact]; } else { print $event->getLabel(); } } else { print $event->getLabel(); } print " -- "; if (get_class($indi) == "Person") { print format_fact_date($event); } if (get_class($indi) == "Family") { print $gdate->Display(false); $family = $indi; $husbid = $family->getHusbId(); $wifeid = $family->getWifeId(); //-- Retrieve husband and wife age for ($p = 0; $p < count($this->pids); $p++) { if ($this->pids[$p] == $husbid) { $husb = $family->getHusband(); if (is_null($husb)) { $husb = new Person(''); } $hdate = $husb->getBirthDate(); if ($hdate->isOK()) { $ageh = get_age_at_event(GedcomDate::GetAgeGedcom($hdate, $gdate), false); } } else { if ($this->pids[$p] == $wifeid) { $wife = $family->getWife(); if (is_null($wife)) { $wife = new Person(''); } $wdate = $wife->getBirthDate(); if ($wdate->isOK()) { $agew = get_age_at_event(GedcomDate::GetAgeGedcom($wdate, $gdate), false); } } } } if (!empty($ageh) && $ageh > 0) { if (empty($agew)) { print '<span class="age"> ' . PrintReady("({$pgv_lang["age"]} {$ageh})") . '</span>'; } else { print '<span class="age"> ' . PrintReady("({$pgv_lang["husb_age"]} {$ageh},") . ' '; } } if (!empty($agew) && $agew > 0) { if (empty($ageh)) { print '<span class="age"> ' . PrintReady("({$pgv_lang["age"]} {$agew})") . '</span>'; } else { print PrintReady("{$pgv_lang["wife_age"]} {$agew})") . '</span>'; } } } print " " . PrintReady($desc); if ($SHOW_PEDIGREE_PLACES > 0) { $place = $event->getPlace(); if ($place != null) { if ($desc != null) { print " - "; } $plevels = explode(',', $place); for ($plevel = 0; $plevel < $SHOW_PEDIGREE_PLACES; $plevel++) { if (!empty($plevels[$plevel])) { if ($plevel > 0) { print ", "; } print PrintReady($plevels[$plevel]); } } } } //-- print spouse name for marriage events $spouse = Person::getInstance($event->getSpouseId()); if ($spouse) { for ($p = 0; $p < count($this->pids); $p++) { if ($this->pids[$p] == $spouse->getXref()) { break; } } if ($p == count($this->pids)) { $p = $event->temp; } $col = $p % 6; if ($spouse->getXref() != $this->pids[$p]) { echo ' <a href="', $spouse->getLinkUrl(), '">', $spouse->getFullName(), '</a>'; } else { $ct = preg_match("/2 _PGVFS @(.*)@/", $factrec, $match); if ($ct > 0) { print " <a href=\"" . encode_url("family.php?famid={$match[1]}&ged={$GEDCOM}") . "\">"; if (displayDetailsById($match[1]) || showLivingNameById($match[1])) { print $event->getParentObject()->getFullName(); } else { print $pgv_lang["private"]; } print "</a>"; } } } print "</td></tr></table>\n"; print "</div>"; if ($TEXT_DIRECTION == 'ltr') { $img = "dline2"; $ypos = "0%"; } else { $img = "dline"; $ypos = "100%"; } $dyoffset = $yoffset - $tyoffset + $this->bheight / 3; if ($tyoffset < 0) { $dyoffset = $yoffset + $this->bheight / 3; if ($TEXT_DIRECTION == 'ltr') { $img = "dline"; $ypos = "100%"; } else { $img = "dline2"; $ypos = "0%"; } } //-- print the diagnal line print "\n\t\t<div id=\"dbox{$factcount}\" style=\"position:absolute; " . ($TEXT_DIRECTION == "ltr" ? "left: " . ($basexoffset + 25) : "right: " . ($basexoffset + 25)) . "px; top:" . $dyoffset . "px; font-size: 8pt; height: " . abs($tyoffset) . "px; width: " . abs($tyoffset) . "px;"; print " background-image: url('" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES[$img]["other"] . "');"; print " background-position: 0% {$ypos}; \" >\n"; print "</div>\n"; }
require 'PHProxy.class.php'; $config = array('url_var_name' => 'q', 'flags_var_name' => 'hl', 'get_form_name' => '__script_get_form', 'proxy_url_form_name' => 'poxy_url_form', 'proxy_settings_form_name' => 'poxy_settings_form', 'max_file_size' => -1); $flags = 'prev'; if (isset($_GET[$config['flags_var_name']])) { $flags = $_GET[$config['flags_var_name']]; } $PHProxy =& new PHProxy($config, $flags); if (isset($_GET[$PHProxy->config['get_form_name']])) { $url = decode_url($_GET[$PHProxy->config['get_form_name']]); $qstr = preg_match('#\\?#', $url) ? strpos($url, '?') === strlen($url) ? '' : '&' : '?'; $arr = explode('&', $_SERVER['QUERY_STRING']); if (preg_match('#^' . $PHProxy->config['get_form_name'] . '#', $arr[0])) { array_shift($arr); } $url .= $qstr . implode('&', $arr); $PHProxy->start_transfer(encode_url($url)); echo $PHProxy->return_response(); exit; } if (isset($_GET[$PHProxy->config['url_var_name']])) { $PHProxy->start_transfer($_GET[$PHProxy->config['url_var_name']]); echo $PHProxy->return_response(); exit; } if (isset($_GET['action'], $_GET['delete']) && $_GET['action'] == 'cookies') { $PHProxy->delete_cookies($_GET['delete']); header("Location: {$PHProxy->script_url}?action=cookies"); exit; } if (isset($_POST['username'], $_POST['password'], $_POST['server'], $_POST['realm'], $_POST['auth_url'])) { $PHProxy->request_method = 'GET';
function print_user_favorites($block = true, $config = "", $side, $index) { global $pgv_lang, $PGV_IMAGE_DIR, $PGV_IMAGES, $GEDCOM, $TEXT_DIRECTION, $INDEX_DIRECTORY, $MEDIA_DIRECTORY, $MULTI_MEDIA, $MEDIA_DIRECTORY_LEVELS, $ctype; global $show_full, $PEDIGREE_FULL_DETAILS, $BROWSERTYPE, $ENABLE_AUTOCOMPLETE; // Override GEDCOM configuration temporarily if (isset($show_full)) { $saveShowFull = $show_full; } $savePedigreeFullDetails = $PEDIGREE_FULL_DETAILS; $show_full = 1; $PEDIGREE_FULL_DETAILS = 1; $userfavs = getUserFavorites(PGV_USER_NAME); if (!is_array($userfavs)) { $userfavs = array(); } $id = "user_favorites"; $title = print_help_link("mygedview_favorites_help", "qm", "", false, true); $title .= $pgv_lang["my_favorites"] . " "; if ($TEXT_DIRECTION == "rtl") { $title .= getRLM(); } $title .= "(" . count($userfavs) . ")"; if ($TEXT_DIRECTION == "rtl") { $title .= getRLM(); } if ($ENABLE_AUTOCOMPLETE) { $content = '<script type="text/javascript" src="js/jquery/jquery.min.js"></script> <script type="text/javascript" src="js/jquery/jquery.autocomplete.js"></script> <script type="text/javascript" src="js/jquery/jquery.ajaxQueue.js"></script> <script type="text/javascript"> jQuery.noConflict(); // @see http://docs.jquery.com/Using_jQuery_with_Other_Libraries/ jQuery(document).ready(function($){ $("input[name^=gid]").autocomplete("autocomplete.php", { extraParams: {field:"IFSRO"}, formatItem: function(row, i) { return row[0] + " (" + row[1] + ")"; }, formatResult: function(row) { return row[1]; }, width: 400, minChars: 2 }); }); </script>'; } else { $content = ''; } if ($block) { $style = 2; // 1 means "regular box", 2 means "wide box" $tableWidth = $BROWSERTYPE == "msie" ? "95%" : "99%"; // IE needs to have room for vertical scroll bar inside the box $cellSpacing = "1px"; } else { $style = 2; $tableWidth = "99%"; $cellSpacing = "3px"; } if (count($userfavs) == 0) { $content .= print_text("no_favorites", 0, 1); } else { $mygedcom = $GEDCOM; $current_gedcom = $GEDCOM; $content .= "<table width=\"{$tableWidth}\" style=\"border:none\" cellspacing=\"{$cellSpacing}\" class=\"center {$TEXT_DIRECTION}\">"; foreach ($userfavs as $key => $favorite) { if (isset($favorite["id"])) { $key = $favorite["id"]; } $removeFavourite = "<a class=\"font9\" href=\"" . encode_url("index.php?ctype={$ctype}&action=deletefav&fv_id={$key}") . "\" onclick=\"return confirm('" . $pgv_lang["confirm_fav_remove"] . "');\">" . $pgv_lang["remove"] . "</a><br />"; $current_gedcom = $GEDCOM; $GEDCOM = $favorite["file"]; $content .= "<tr><td>"; if ($favorite["type"] == "URL") { $content .= "<div id=\"boxurl" . $key . ".0\" class=\"person_box\">"; if ($ctype == "user" || PGV_USER_IS_ADMIN) { $content .= $removeFavourite; } $content .= "<a href=\"" . $favorite["url"] . "\">" . PrintReady($favorite["title"]) . "</a>"; $content .= "<br />" . PrintReady($favorite["note"]); } else { require $INDEX_DIRECTORY . $GEDCOM . '_conf.php'; $indirec = find_gedcom_record($favorite["gid"], PGV_GED_ID); if ($favorite["type"] == "INDI") { $content .= "<div id=\"box" . $favorite["gid"] . ".0\" class=\"person_box"; if (strpos($indirec, "\n1 SEX F") !== false) { $content .= "F"; } elseif (strpos($indirec, "\n1 SEX M") !== false) { $content .= ""; } else { $content .= "NN"; } $content .= "\">"; if ($ctype == "user" || PGV_USER_IS_ADMIN) { $content .= $removeFavourite; } ob_start(); print_pedigree_person($favorite["gid"], $style, 1, $key); $content .= ob_get_clean(); $content .= PrintReady($favorite["note"]); } else { $record = GedcomRecord::getInstance($favorite['gid']); $content .= "<div id=\"box" . $favorite["gid"] . ".0\" class=\"person_box\">"; if ($ctype == "user" || PGV_USER_IS_ADMIN) { $content .= $removeFavourite; } if ($record) { $content .= $record->format_list('span'); } else { $content .= $pgv_lang['invalid_id']; } $content .= "<br />" . PrintReady($favorite["note"]); } } $content .= "</div>"; $content .= "</td></tr>"; $GEDCOM = $mygedcom; require $INDEX_DIRECTORY . $GEDCOM . '_conf.php'; } $content .= "</table>"; } $content .= ' <script language="JavaScript" type="text/javascript"> var pastefield; function paste_id(value) { pastefield.value=value; } </script> <br /> '; $uniqueID = floor(microtime() * 1000000); $content .= print_help_link("index_add_favorites_help", "qm", "", false, true); $content .= "<b><a href=\"javascript: " . $pgv_lang["add_favorite"] . " \" onclick=\"expand_layer('add_user_fav'); return false;\"><img id=\"add_user_fav_img\" src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["plus"]["other"] . "\" border=\"0\" alt=\"\" /> " . $pgv_lang["add_favorite"] . "</a></b>"; $content .= "<br /><div id=\"add_user_fav\" style=\"display: none;\">"; $content .= "<form name=\"addufavform\" method=\"post\" action=\"index.php\">"; $content .= "<input type=\"hidden\" name=\"action\" value=\"addfav\" />"; $content .= "<input type=\"hidden\" name=\"ctype\" value=\"{$ctype}\" />"; $content .= "<input type=\"hidden\" name=\"favtype\" value=\"user\" />"; $content .= "<input type=\"hidden\" name=\"ged\" value=\"{$GEDCOM}\" />"; $content .= "<table width=\"{$tableWidth}\" style=\"border:none\" cellspacing=\"{$cellSpacing}\" class=\"center {$TEXT_DIRECTION}\">"; $content .= "<tr><td>" . $pgv_lang["add_fav_enter_id"] . " <br />"; $content .= "<input class=\"pedigree_form\" type=\"text\" name=\"gid\" id=\"gid{$uniqueID}\" size=\"5\" value=\"\" />"; $content .= print_findindi_link("gid{$uniqueID}", '', true) . "\n"; $content .= print_findfamily_link("gid{$uniqueID}", '', true) . "\n"; $content .= print_findsource_link("gid{$uniqueID}", '', true) . "\n"; $content .= print_findrepository_link("gid{$uniqueID}", '', true) . "\n"; $content .= print_findnote_link("gid{$uniqueID}", '', true) . "\n"; $content .= print_findmedia_link("gid{$uniqueID}", '1', '', true) . "\n"; $content .= "<br />" . $pgv_lang["add_fav_or_enter_url"]; $content .= "<table><tr><td>" . $pgv_lang["url"] . "</td><td><input type=\"text\" name=\"url\" size=\"40\" value=\"\" /></td></tr>"; $content .= "<tr><td>" . $pgv_lang["title"] . "</td><td><input type=\"text\" name=\"favtitle\" size=\"40\" value=\"\" /></td></tr></table>"; if ($block) { $content .= "\n</td></tr><tr><td><br />"; } else { $content .= "\n</td><td>"; } $content .= $pgv_lang["add_fav_enter_note"]; $content .= "<br /><textarea name=\"favnote\" rows=\"6\" cols=\"50\"></textarea>"; $content .= "</td></tr></table>"; $content .= "<br /><input type=\"submit\" value=\"" . $pgv_lang["add"] . "\" style=\"font-size: 8pt; \" />"; $content .= "</form></div>"; global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } // Restore GEDCOM configuration unset($show_full); if (isset($saveShowFull)) { $show_full = $saveShowFull; } $PEDIGREE_FULL_DETAILS = $savePedigreeFullDetails; }