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'; } }
// leave manual config until we can move it to bitweaver table require "config.php"; loadLangFile("pgv_help, pgv_admin, pgv_editor, ra_lang, gm_lang, gm_help, sm_lang, sm_help"); // Load language keys require 'includes/help_text_vars.php'; print_simple_header($pgv_lang['help_header']); echo '<a name="top"></a><span class="helpheader">', $pgv_lang['help_header'], '</span><br /><br /><div class="helptext">'; $help = safe_GET('help'); $action = safe_GET('action'); if ($help == 'help_useradmin.php' && $action == 'edituser') { $help = 'edit_useradmin_help'; } if ($help == 'help_login_register.php' && $action == 'pwlost') { $help = 'help_login_lost_pw.php'; } if ($help == 'help_contents_help') { if (PGV_USER_IS_ADMIN) { $help = 'admin_help_contents_help'; echo $pgv_lang['admin_help_contents_head_help']; } else { echo $pgv_lang['help_contents_head_help']; } print_help_index($help); } else { print_text($help); } echo '</div><br /><br /><br />'; echo '<a href="#top" title="', $pgv_lang['move_up'], '">', $UpArrow, '</a><br />'; echo '<a href="help_text.php?help=help_contents_help"><b>', $pgv_lang['help_contents'], '</b></a><br />'; echo '<a href="javascript:;" onclick="window.close();"><b>', $pgv_lang['close_window'], '</b></a>'; print_simple_footer();
if ($okMain) { print_text("main_media_ok" . $mediaAction); } else { $finalResult = false; echo '<span class="error">', print_text("main_media_fail" . $mediaAction), '</span>'; } } print "<br />"; if (!$isThum) { print_text("thumb_media_fail0"); } else { if ($okThum) { print_text("thumb_media_ok" . $mediaAction); } else { $finalResult = false; echo '<span class="error">', print_text("thumb_media_fail" . $mediaAction), '</span>'; } } print "<br />"; unset($GLOBALS["oldMediaName"]); unset($GLOBALS["newMediaName"]); unset($GLOBALS["oldMediaFolder"]); unset($GLOBALS["newMediaFolder"]); unset($GLOBALS["oldThumbFolder"]); unset($GLOBALS["newThumbFolder"]); } } } if ($finalResult) { $_SESSION["upload_folder"] = $folder; // store standard media folder in session
echo '</table>'; echo '<br />'; } echo '<table class="facts_table">'; echo '<tr><td class="facts_value" style="text-align:center; " >'; srand((double) microtime() * 1000000); // These 3 hidden variables has to be set or there will be a PHP ERROR message echo '<input type="hidden" name="language2" value="', $language2, '"/>'; echo '<input type="hidden" name="file_type" value="', $file_type, '"/>'; echo '<input type="hidden" name="ls01" value="', $ls01, '"/>'; echo '<input type="submit" value="', $pgv_lang["close_window"], "\" onclick=\"window.opener.showchanges('&dv=", rand(), "#", $anchor, "'); self.close();\" />"; echo '</td></tr>'; if ($Write_Ok) { echo '<tr><td class="facts_value" style="text-align:center; " ><br /><br />'; echo '<input type="submit" value="', print_text("close_window_without_refresh"), '" onclick="self.close();" /><br /><br />'; echo '<div class="error">', print_text("edit_lang_utility_warning"), '</div>'; echo '</td></tr>'; } echo '</table>'; echo '</form>'; echo '</center></div>'; // if ls02 (the line of the translated sentence) variable has not been set, try to find the row in the translated file if ($ls02 == "") { $ls02 = 0; $englishTarget1 = $english_language_array[$ls01][0]; $englishTarget2 = str_replace('"', "'", $englishTarget1); // Var name could be inside apostrophes $englishTarget3 = str_replace("'", '"', $englishTarget1); // Var name could be inside apostrophes for ($y = 0, $ymax = sizeof($new_language_array); $y < $ymax; $y++) { if (isset($new_language_array[$y][1])) {
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(); } // Match end of line in DOS/UNIX/MAC format
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; }
function print_yahrzeit($block = true, $config = '', $side, $index) { global $pgv_lang, $factarray, $SHOW_ID_NUMBERS, $ctype, $TEXT_DIRECTION; global $PGV_IMAGE_DIR, $PGV_IMAGES, $PGV_BLOCKS; global $DAYS_TO_SHOW_LIMIT, $SHOW_MARRIED_NAMES, $SERVER_URL; $block = true; // Always restrict this block's height if (empty($config)) { $config = $PGV_BLOCKS['print_yahrzeit']['config']; } if (empty($config['infoStyle'])) { $config['infoStyle'] = 'style2'; } if (empty($config['allowDownload'])) { $config['allowDownload'] = 'yes'; } if (empty($config['days'])) { $config['days'] = $DAYS_TO_SHOW_LIMIT; } if ($config['days'] < 1) { $config['days'] = 1; } if ($config['days'] > $DAYS_TO_SHOW_LIMIT) { $config['days'] = $DAYS_TO_SHOW_LIMIT; } $startjd = server_jd(); $endjd = $startjd + max(min($config['days'], 1), $DAYS_TO_SHOW_LIMIT) - 1; if (!PGV_USER_ID) { $allowDownload = "no"; } $id = "yahrzeit"; $title = print_help_link('yahrzeit_help', 'qm', '', false, true); if ($PGV_BLOCKS['print_yahrzeit']['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['yahrzeit_block']; $content = ""; // The standard anniversary rules cover most of the Yahrzeit rules, we just // need to handle a few special cases. // Fetch normal anniversaries... $yahrzeits = array(); $hidden = 0; for ($jd = $startjd - 1; $jd <= $endjd + 30; ++$jd) { foreach (get_anniversary_events($jd, 'DEAT _YART') as $fact) { // Extract hebrew dates only if ($fact['date']->date1->CALENDAR_ESCAPE() == '@#DHEBREW@' && $fact['date']->MinJD() == $fact['date']->MaxJD()) { // Apply privacy if (displayDetailsById($fact['id']) && showFactDetails($fact['fact'], $fact['id']) && !FactViewRestricted($fact['id'], $fact['factrec'])) { $yahrzeits[] = $fact; } else { ++$hidden; } } } } // ...then adjust dates foreach ($yahrzeits as $key => $yahrzeit) { if (strpos('1 DEAT', $yahrzeit['factrec']) !== false) { // Just DEAT, not _YART $today = new JewishDate($yahrzeit['jd']); $hd = $yahrzeit['date']->MinDate(); $hd1 = new JewishDate($hd); $hd1->y += 1; $hd1->SetJDFromYMD(); // Special rules. See http://www.hebcal.com/help/anniv.html // Everything else is taken care of by our standard anniversary rules. if ($hd->d == 30 && $hd->m == 2 && $hd->y != 0 && $hd1->DaysInMonth() < 30) { // 30 CSH // Last day in CSH $yahrzeit[$key]['jd'] = JewishDate::YMDtoJD($today->y, 3, 1) - 1; } if ($hd->d == 30 && $hd->m == 3 && $hd->y != 0 && $hd1->DaysInMonth() < 30) { // 30 KSL // Last day in KSL $yahrzeit[$key]['jd'] = JewishDate::YMDtoJD($today->y, 4, 1) - 1; } if ($hd->d == 30 && $hd->m == 6 && $hd->y != 0 && $today->DaysInMonth() < 30 && !$today->IsLeapYear()) { // 30 ADR // Last day in SHV $yahrzeit[$key]['jd'] = JewishDate::YMDtoJD($today->y, 6, 1) - 1; } } } switch ($config['infoStyle']) { case "style1": // List style foreach ($yahrzeits as $yahrzeit) { if ($yahrzeit['jd'] >= $startjd && $yahrzeit['jd'] < $startjd + $config['days']) { $ind = person::GetInstance($yahrzeit['id']); //@@ $content .= "<a href=\"".encode_url($ind->getLinkUrl())."\" class=\"list_item name2\">".$ind->getFullName()."</a>".$ind->getSexImage(); $content .= "<a href=\"" . encode_url($ind->getLinkUrl()) . "\" class=\"list_item name2\">" . PrintReady($ind->getFullName()) . "</a>" . $ind->getSexImage(); $content .= "<div class=\"indent\">"; $content .= $yahrzeit['date']->Display(true); $content .= ', ' . str_replace("#year_var#", $yahrzeit['anniv'], $pgv_lang["year_anniversary"]); $content .= "</div>"; } } break; case "style2": // Table style require_once PGV_ROOT . 'js/sorttable.js.htm'; require_once PGV_ROOT . 'includes/classes/class_gedcomrecord.php'; $table_id = "ID" . floor(microtime() * 1000000); // sorttable requires a unique ID $content .= "<table id=\"{$table_id}\" class=\"sortable list_table center\">"; $content .= "<tr>"; $content .= "<th class=\"list_label\">{$factarray['NAME']}</th>"; $content .= "<th style=\"display:none\">GIVN</th>"; $content .= "<th class=\"list_label\">{$factarray['DATE']}</th>"; $content .= "<th class=\"list_label\"><img src=\"./images/reminder.gif\" alt=\"{$pgv_lang['anniversary']}\" title=\"{$pgv_lang['anniversary']}\" border=\"0\" /></th>"; $content .= "<th class=\"list_label\">{$factarray['_YART']}</th>"; $content .= "</tr>"; $count = 0; foreach ($yahrzeits as $yahrzeit) { if ($yahrzeit['jd'] >= $startjd && $yahrzeit['jd'] < $startjd + $config['days']) { ++$count; $ind = person::GetInstance($yahrzeit['id']); $content .= "<tr class=\"vevent\">"; // hCalendar:vevent // Record name(s) $name = $ind->getFullName(); $url = $ind->getLinkUrl(); $content .= "<td class=\"list_value_wrap\" align=\"" . get_align($name) . "\">"; $content .= "<a href=\"" . encode_url($ind->getLinkUrl()) . "\" class=\"list_item name2\" dir=\"" . $TEXT_DIRECTION . "\">" . PrintReady($name) . "</a>"; $content .= $ind->getSexImage(); $addname = $ind->getAddName(); if ($addname) { $content .= "<br /><a href=\"" . encode_url($url) . "\" class=\"list_item\">" . PrintReady($addname) . "</a>"; } $content .= "</td>"; // GIVN for sorting $content .= "<td style=\"display:none\">"; $exp = explode(",", str_replace('<', ',', $name) . ","); $content .= $exp[1]; $content .= "</td>"; $today = new JewishDate($yahrzeit['jd']); $td = new GedcomDate($today->Format('@ A O E')); // death/yahrzeit event date $content .= "<td class=\"list_value_wrap\">"; $content .= "<a name='{$yahrzeit['jd']}'>" . $yahrzeit['date']->Display(true, NULL, array()) . "</a>"; $content .= "</td>"; // Anniversary $content .= "<td class=\"list_value_wrap rela\">"; $anniv = $yahrzeit['anniv']; if ($anniv == 0) { $content .= '<a name="0"> </a>'; } else { $content .= "<a name=\"{$anniv}\">{$anniv}</a>"; } if ($config['allowDownload'] == 'yes') { // hCalendar:dtstart and hCalendar:summary //TODO does this work?? $content .= "<abbr class=\"dtstart\" title=\"" . strip_tags($yahrzeit['date']->Display(false, 'Ymd', array())) . "\"></abbr>"; $content .= "<abbr class=\"summary\" title=\"" . $pgv_lang["anniversary"] . " #{$anniv} " . $factarray[$yahrzeit['fact']] . " : " . PrintReady(strip_tags($ind->getFullName())) . "\"></abbr>"; } // upcomming yahrzeit dates $content .= "<td class=\"list_value_wrap\">"; $content .= "<a href=\"" . $url . "\" class=\"list_item url\">" . $td->Display(true, NULL, array('gregorian')) . "</a>"; // hCalendar:url $content .= " </td>"; $content .= "</tr>"; } } // table footer $content .= "<tr class=\"sortbottom\">"; $content .= "<td class=\"list_label\">"; $content .= '<a href="javascript:;" onclick="sortByOtherCol(this,1)"><img src="images/topdown.gif" alt="" border="0" /> ' . $factarray["GIVN"] . '</a><br />'; $content .= $pgv_lang["total_names"] . ": " . $count; if ($hidden) { $content .= "<br /><span class=\"warning\">{$pgv_lang['hidden']} : {$hidden}</span>"; } $content .= "</td>"; $content .= "<td style=\"display:none\">GIVN</td>"; $content .= "<td>"; if ($config['allowDownload'] == 'yes') { $uri = $SERVER_URL . basename($_SERVER['REQUEST_URI']); global $whichFile; $whichFile = 'hCal-events.ics'; $alt = print_text('download_file', 0, 1); if (count($yahrzeits)) { $content .= "<a href=\"http://feeds.technorati.com/events/{$uri}\"><img src=\"images/hcal.png\" border=\"0\" alt=\"{$alt}\" title=\"{$alt}\" /></a>"; } } $content .= '</td><td> </td><td> </td></tr>'; $content .= '</table>'; break; } global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
if (isset($facts2[$i])) { if (in_array($i, $keep2)) { $newgedrec .= $facts2[$i]["subrec"] . "\n"; print $pgv_lang["adding"] . " " . $facts2[$i]["fact"] . " " . $pgv_lang["from"] . " {$gid2}<br />\n"; } } } replace_gedrec($gid1, $newgedrec); if ($SYNC_GEDCOM_FILE) { write_file(); } write_changes(); $rec = GedcomRecord::getInstance($gid1); $pid = $rec->getXrefLink(); // $pid is embedded in $pgv_lang['record_updated'] echo '<br />', print_text('record_updated', 0, 1), '<br />'; print "<br /><a href=\"edit_merge.php?action=choose\">" . $pgv_lang["merge_more"] . "</a><br />\n"; print "<br /><br /><br />\n"; } } } } } } if ($action == "choose") { ?> <script language="JavaScript" type="text/javascript"> <!-- var pasteto; function iopen_find(textbox, gedselect) { pasteto = textbox;
function print_htmlplus_block($block = true, $config = '', $side, $index) { global $ctype, $factarray, $GEDCOM, $HTML_BLOCK_COUNT, $PGV_BLOCKS, $PGV_IMAGE_DIR, $PGV_IMAGES, $pgv_lang, $TEXT_DIRECTION, $MULTI_MEDIA, $SHOW_ID_NUMBERS; // config sanity check if (empty($config)) { $config = $PGV_BLOCKS['print_htmlplus_block']['config']; } else { foreach ($PGV_BLOCKS['print_htmlplus_block']['config'] as $k => $v) { if (!isset($config[$k])) { $config[$k] = $v; } } } if (!isset($HTML_BLOCK_COUNT)) { $HTML_BLOCK_COUNT = 0; } $HTML_BLOCK_COUNT++; /* * Select GEDCOM */ switch ($config['gedcom']) { case '__current__': break; case '': break; case '__default__': $GEDCOM = get_site_setting('DEFAULT_GEDCOM'); if (!$GEDCOM) { foreach (get_all_gedcoms() as $gedcom) { $GEDCOM = $gedcom; break; } } break; default: if (get_gedcom_setting(get_gedcom_from_id($config['gedcom']), 'imported')) { $GEDCOM = $config['gedcom']; } break; } /* * Initiate the stats object. */ if ($config['compat'] == 1) { require_once PGV_ROOT . 'includes/classes/class_stats_compat.php'; $stats = new stats_compat($GEDCOM); } elseif ($config['ui'] == 1) { require_once PGV_ROOT . 'includes/classes/class_stats_ui.php'; $stats = new stats_ui($GEDCOM); } else { $stats = new stats($GEDCOM); } // Make some values from the GEDCOM's 0 HEAD record visible to the world global $CREATED_SOFTWARE, $CREATED_VERSION, $CREATED_DATE; $CREATED_SOFTWARE = $stats->gedcomCreatedSoftware(); $CREATED_VERSION = $stats->gedcomCreatedVersion(); $CREATED_DATE = $stats->gedcomDate(); /* * First Pass. * Handle embedded language, fact, global, etc. references * This needs to be done first because the language variables could themselves * contain embedded keywords. */ // Title $config['title'] = print_text($config['title'], 0, 2); // Content $config['html'] = print_text($config['html'], 0, 2); /* * Second Pass. */ list($new_tags, $new_values) = $stats->getTags("{$config['title']} {$config['html']}"); // Title if (strstr($config['title'], '#')) { $config['title'] = str_replace($new_tags, $new_values, $config['title']); } // Content $config['html'] = str_replace($new_tags, $new_values, $config['html']); /* * Restore Current GEDCOM */ $GEDCOM = PGV_GEDCOM; /* * Start Of Output */ $id = "html_block{$HTML_BLOCK_COUNT}"; $title = ""; if ($config['title'] != '') { if (PGV_USER_GEDCOM_ADMIN) { $title .= print_help_link('index_htmlplus_ahelp', 'qm_ah', '', false, true); } else { $title .= print_help_link('index_htmlplus_help', 'qm', '', false, true); } if ($PGV_BLOCKS['print_htmlplus_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; } $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;\">" . "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/{$PGV_IMAGES['admin']['small']}\" width=\"15\" height=\"15\" border=\"0\" alt=\"{$pgv_lang['config_block']}\" /></a>"; } } $title .= $config['title']; } $content = $config['html']; if ($config['title'] == '' && $PGV_BLOCKS['print_htmlplus_block']['canconfig']) { if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) { if ($ctype == "gedcom") { $name = str_replace("'", "\\'", $GEDCOM); } else { $name = PGV_USER_NAME; } $content .= "<br />" . print_help_link('index_htmlplus_ahelp', 'qm_ah', '', false, true) . "<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=500,scrollbars=1,resizable=1'); return false;\">" . "<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>"; } } global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
function add_table_row($name, $contents, $font = 'Default') { global $TABLE_STYLES; $TABLE_STYLES[$name][rows_text] .= TAB . '<table:table-row>' . NL; for ($i = 0; $i < count($contents); $i++) { $span = count($contents) == 1 ? $TABLE_STYLES[$name][cols] : 1; $style = get_pos_style($TABLE_STYLES[$name][inserted_rows] + 1, $i + 1, count($contents)); $TABLE_STYLES[$name][rows_text] .= TAB2 . '<table:table-cell table:number-columns-spanned="' . $span . '" table:style-name="' . $name . '.' . $style . '" table:value-type="string">' . NL . TAB3 . print_text($contents[$i], $font) . TAB2 . '</table:table-cell>' . NL; } $TABLE_STYLES[$name][rows_text] .= TAB . '</table:table-row>' . NL; $TABLE_STYLES[$name][inserted_rows]++; }
<?php function print_text($msg, $tag, $col) { for ($i = 0; $i < 10; $i++) { echo "<{$tag} style='color: {$col}'> {$msg} </{$tag}>"; } } print_text('Hello', 'p', 'blue'); ?> <?php print_text('How are you', 'h4', 'green');
/** * logged in users * * prints a list of other users who are logged in */ function print_logged_in_users($block = true, $config = "", $side, $index) { global $pgv_lang, $PGV_SESSION_TIME, $TEXT_DIRECTION; $block = true; // Always restrict this block's height // Log out inactive users foreach (get_idle_users(time() - $PGV_SESSION_TIME) as $user_id => $user_name) { if ($user_id != PGV_USER_ID) { userLogout($user_id); } } // List active users $NumAnonymous = 0; $loggedusers = array(); foreach (get_logged_in_users() as $user_id => $user_name) { if (PGV_USER_IS_ADMIN || get_user_setting($user_id, 'visibleonline') == 'Y') { $loggedusers[$user_id] = $user_name; } else { $NumAnonymous++; } } $id = "logged_in_users"; $title = print_help_link("index_loggedin_help", "qm", "", false, true); $title .= $pgv_lang["users_logged_in"]; $content = "<table width=\"90%\">"; $LoginUsers = count($loggedusers); if ($LoginUsers == 0 and $NumAnonymous == 0) { $content .= "<tr><td><b>" . $pgv_lang["no_login_users"] . "</b></td></tr>"; } $Advisory = "anon_user"; if ($NumAnonymous > 1) { $Advisory .= "s"; } if ($NumAnonymous > 0) { $pgv_lang["global_num1"] = $NumAnonymous; // Make it visible $content .= "<tr><td><b>" . print_text($Advisory, 0, 1) . "</b></td></tr>"; } $Advisory = "login_user"; if ($LoginUsers > 1) { $Advisory .= "s"; } if ($LoginUsers > 0) { $pgv_lang["global_num1"] = $LoginUsers; // Make it visible $content .= "<tr><td><b>" . print_text($Advisory, 0, 1) . "</b></td></tr>"; } if (PGV_USER_ID) { foreach ($loggedusers as $user_id => $user_name) { $content .= "<tr><td><br />" . PrintReady(getUserFullName($user_id)) . " - " . $user_name; if (PGV_USER_ID != $user_id && get_user_setting($user_id, 'contactmethod') != "none") { $content .= "<br /><a href=\"javascript:;\" onclick=\"return message('" . $user_id . "');\">" . $pgv_lang["message"] . "</a>"; } $content .= "</td></tr>"; } } $content .= "</table>"; global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
function img_uploader($file, $CID, $target_path, $mode, $UpdateMode = false, $tozihat = "it`s a group upload file", $code = NULL, $NW = -1, $NH = -1) { $image = $file; $uploadedfile = $target_path . PATCH_DIS . $file; if ($code == NULL) { $codeKala = basename($target_path); } else { $codeKala = $code; } debug(" codeKala parsing in Img_Uploader function " . $codeKala); debug($image . " <= image " . $uploadedfile . " <= uploadedfile " . $CID . " <= CID<br>"); $UID = $_SESSION['UID']; $filename = stripslashes($file); $extension = getExtension($filename); $extension = strtolower($extension); $ftype = get_ftype($extension); debug("file extention is : " . $extension); if ($extension != "jpg" && $extension != "jpeg" && $extension != "png" && $extension != "gif") { debug("this is not a valid file and should be deleted"); unlink($uploadedfile); print_text("دسوند این فایل جزو پسوند های مجاز نمی باشد", "err"); return; } else { debug("start prossesing image file"); $size = filesize($uploadedfile); debug($uploadedfile . " size is : " . $size); if ($size > MAX_SIZE * 1024) { unlink($uploadedfile); print_text("سایز این عکس از حد مجاز بیشتر است", "err"); return; } if ($extension == "jpg" || $extension == "jpeg") { $uploadedfile = $uploadedfile; $src = imagecreatefromjpeg($uploadedfile); } else { if ($extension == "png") { $uploadedfile = $uploadedfile; $src = imagecreatefrompng($uploadedfile); } else { $src = imagecreatefromgif($uploadedfile); echo $src; echo " test <br><br><br><br><br><br><br>"; } } debug("image size and format is valid and started for prosesiing " . $src); list($width, $height) = getimagesize($uploadedfile); debug("w : " . $width . " and h : " . $height); if ($mode == SII) { $newwidth = 200; $newheight = 160; //($height/$width)*$newwidth; } else { if ($mode == LII) { debug("nw that send is : " . $NW); $newwidth = $NW == -1 ? 450 : $NW; $newheight = $NH == -1 ? $height / $width * $newwidth : $NH; } else { if ($mode == BII) { $newwidth = $NW == -1 ? $width : $NW; $newheight = $NH == -1 ? $height : $NH; } } } $tmp = imagecreatetruecolor($newwidth, $newheight); imagecopyresampled($tmp, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); debug(" New w : " . $newwidth . " and New h : " . $newheight); // imagecopyresampled($tmp1,$src,0,0,0,0,$newwidth1,$newheight1,$width,$height); $base_address = MASTER_DIR . PATCH_DIS . cryp($UID) . PATCH_DIS . cryp($CID) . PATCH_DIS; debug("this file will moved to " . $base_address); $filename = $base_address . $image; debug("and final file address will be : " . $filename); //echo $filename."<br>"; //$filename1 = "images/small". $_FILES['file']['name']; require_once 'farsi_date.php'; $date = ShamsiDate('a'); if ($extension == 'gif') { echo "gift extention is detected"; if ($mode == BII) { move_uploaded_file($uploadedfile, $filename); } else { $RRes = imagegif($tmp, $filename); } } else { if ($extension == 'jpg' || $extension == 'jpeg') { $RRes = imagejpeg($tmp, $filename, 100); } else { if ($extension == 'png') { $RRes = imagepng($tmp, $filename, 100); } } } if ($RRes) { ?> <h2 dir="rtl" ><p class="text"> فایل با موفقیت به سرور انتقال پیدا کرد و از ادرس زیر قابل دسترس می باشد.<br></p></h2> <center><br> <?php echo "<h1 dir=\"rtl\" class=\"t3\">حجم فايل : <span style=\"color:red;\">" . $size . "</span> تاريخ ثبت : <span style=\"color:red;\">{$date}</span><br><br><textarea name=\"fffile\" id=\"fffile\" cols=\"90\" rows=\"2\" dir=\"ltr\" onClick=\"javascript:this.select();\">" . Domain . $filename . "</textarea>\n\t\t\t\t<br><input type=\"button\" class=\"text\" dir=\"rtl\" onClick=\"copytoclipboard('fffile');\" value=\" كپي \"></h1>"; if ($extension == "gif" || $extension == "jpg" || $extension == "jpeg" || $extension == "png" || $extension == "bmp") { echo "<br><a href=\"{$fileaddress}\" target=\"_blank\" dir=rtl><img src=\"{$filename}\" border=\"0\" alt=\"" . $_FILES['file1']['name'] . "\"></a>"; } elseif ($extension == "swf") { ?> <br><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" dir="rtl" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"> <param name="flash_component" value="ImageViewer.swc"> <param name="movie" value="<?php echo "{$fileaddress}"; ?> "> <param name="quality" value="high"> <param name="FlashVars" value="flashlet={imageLinkTarget:'_blank',captionFont:'Verdana',titleFont:'Verdana',showControls:true,frameShow:false,slideDelay:5,captionSize:10,captionColor:#333333,titleSize:10,transitionsType:'Random',titleColor:#333333,slideAutoPlay:false,imageURLs:['img1.jpg','img2.jpg','img3.jpg'],slideLoop:false,frameThickness:2,imageLinks:['http://macromedia.com/','http://macromedia.com/','http://macromedia.com/'],frameColor:#333333,bgColor:#FFFFFF,imageCaptions:[]}"> <embed src="<?php echo "{$filename}"; ?> " quality="high" flashvars="flashlet={imageLinkTarget:'_blank',captionFont:'Verdana',titleFont:'Verdana',showControls:true,frameShow:false,slideDelay:5,captionSize:10,captionColor:#333333,titleSize:10,transitionsType:'Random',titleColor:#333333,slideAutoPlay:false,imageURLs:['img1.jpg','img2.jpg','img3.jpg'],slideLoop:false,frameThickness:2,imageLinks:['http://macromedia.com/','http://macromedia.com/','http://macromedia.com/'],frameColor:#333333,bgColor:#FFFFFF,imageCaptions:[]}" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed> </object><?php } elseif ($extension == "rar" || $extension == "zip") { echo "<br><a href=\"{$fileaddress}\" dir=\"rtl\" style=\"text-decoration:none; font-size:8pt; color:#000; font-family:Tahoma, sans-serif;\" title=\" دانلود \"><img src=\"http://www.{$DomainName}/rar-zip-small.gif\" alt=\"دانلود {$fname}\" width=\"20\" height=\"15\" border=\"0\" align=\"absmiddle\"> دانلود فايل ( {$filesize} )</a>"; } ?> <a href='javascript:history.go(-1)' class="titr" dir="rtl" align="center"><h4> برگشت (Back)</h4></a> </center> <?php $ftype = get_ftype($extension); $fsize = filesize($filename); ##### ذخيره داده ها در پايگاه داده if ($UpdateMode == false) { $qr = "INSERT INTO `files` (`fid`, `CID`, `fname`, `ftype`, `fsize`, `UID`, `date`, `tovzihat`, `codeKala`) VALUES (NULL, '" . $CID . "', '" . $image . "', '" . $ftype . "', '" . $size . "', '" . $UID . "', '" . $date . "', '" . $tozihat . "', '" . $codeKala . "')"; } else { $qr = "UPDATE `files` SET `fname` = '" . $image . "',`fsize` = '" . $size . "' WHERE `fid` ='" . $UpdateMode . "'"; } debug("query that used to insert data is : " . $qr); if (insert($qr)) { $qr = "select usedsize from login where `id`=" . $_SESSION['UID']; $res = sql($qr); $res = mysql_fetch_array($res); $usedsize = $res['usedsize']; $usedsize += $fsize; $qr = "UPDATE `login` SET `usedsize` = '" . $usedsize . "' WHERE `login`.`id` =" . $_SESSION['UID']; if (sql($qr)) { // echo "all information stored in Database too<br>"; } else { print_text("Error in insertion information in database <br>", "err"); } } else { print_text("Error in insertion information in database 2<br>", "err"); } } imagedestroy($src); imagedestroy($tmp); } }
/** * Prints a gedcom news/journal * * @todo Add an allowed HTML translation */ function print_gedcom_news($block = true, $config = '', $side, $index) { global $pgv_lang, $PGV_IMAGE_DIR, $PGV_IMAGES, $TEXT_DIRECTION, $ctype, $PGV_BLOCKS; if (empty($config)) { $config = $PGV_BLOCKS['print_gedcom_news']['config']; } if ($config['flag'] == 0) { $config['limit'] = 'nolimit'; } if (isset($_REQUEST['gedcom_news_archive'])) { $config['limit'] = 'nolimit'; $config['flag'] = 0; } $usernews = getUserNews(PGV_GEDCOM); $id = "gedcom_news"; $title = ""; if (PGV_USER_GEDCOM_ADMIN) { $title .= print_help_link('index_gedcom_news_ahelp', 'qm_ah', "", false, true); } else { $title .= print_help_link('index_gedcom_news_help', 'qm', "", false, true); } if ($PGV_BLOCKS['print_gedcom_news']['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('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;\">" . "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/{$PGV_IMAGES['admin']['small']}\" width=\"15\" height=\"15\" border=\"0\" alt=\"{$pgv_lang['config_block']}\" /></a>\n"; } } $title .= $pgv_lang['gedcom_news']; $content = ""; if (count($usernews) == 0) { $content .= $pgv_lang['no_news'] . '<br />'; } $c = 0; $td = time(); foreach ($usernews as $news) { if ($config['limit'] == 'count') { if ($c >= $config['flag']) { break; } $c++; } if ($config['limit'] == 'date') { if (floor(($td - $news['date']) / 86400) > $config['flag']) { break; } } // print "<div class=\"person_box\" id=\"{$news['anchor']}\">\n"; $content .= "<div class=\"news_box\" id=\"{$news['anchor']}\">\n"; // Look for $pgv_lang, $factarray, and $GLOBALS substitutions in the News title $newsTitle = print_text($news['title'], 0, 2); $ct = preg_match("/#(.+)#/", $newsTitle, $match); if ($ct > 0) { if (isset($pgv_lang[$match[1]])) { $newsTitle = str_replace("{$match['0']}", $pgv_lang[$match[1]], $newsTitle); } } $content .= "<span class=\"news_title\">" . PrintReady($newsTitle) . "</span><br />\n"; $content .= "<span class=\"news_date\">" . format_timestamp($news['date']) . "</span><br /><br />\n"; // Look for $pgv_lang, $factarray, and $GLOBALS substitutions in the News text $newsText = print_text($news['text'], 0, 2); $ct = preg_match("/#(.+)#/", $newsText, $match); if ($ct > 0) { if (isset($pgv_lang[$match[1]])) { $newsText = str_replace("{$match['0']}", $pgv_lang[$match[1]], $newsText); } } $ct = preg_match("/#(.+)#/", $newsText, $match); if ($ct > 0) { $varname = $match[1]; if (isset($pgv_lang[$varname])) { $newsText = str_replace("{$match['0']}", $pgv_lang[$varname], $newsText); } else { if (defined('PGV_' . $varname)) { // e.g. global $VERSION is now constant PGV_VERSION $varname = 'PGV_' . $varname; } if (defined($varname)) { $newsText = str_replace("{$match['0']}", constant($varname), $newsText); } else { if (isset(${$varname})) { $newsText = str_replace("{$match['0']}", ${$varname}, $newsText); } } } } $trans = get_html_translation_table(HTML_SPECIALCHARS); $trans = array_flip($trans); $newsText = strtr($newsText, $trans); $newsText = nl2br($newsText); $content .= PrintReady($newsText) . "<br />\n"; // Print Admin options for this News item if (PGV_USER_GEDCOM_ADMIN) { $content .= "<hr size=\"1\" />" . "<a href=\"javascript:;\" onclick=\"editnews('" . $news['id'] . "'); return false;\">{$pgv_lang['edit']}</a> | " . "<a href=\"" . encode_url("index.php?action=deletenews&news_id=" . $news['id'] . "&ctype={$ctype}") . "\" onclick=\"return confirm('{$pgv_lang['confirm_news_delete']}');\">{$pgv_lang['delete']}</a><br />"; } $content .= "</div>\n"; } $printedAddLink = false; if (PGV_USER_GEDCOM_ADMIN) { $content .= "<a href=\"javascript:;\" onclick=\"addnews('" . urlencode(PGV_GEDCOM) . "'); return false;\">" . $pgv_lang["add_news"] . "</a>"; $printedAddLink = true; } if ($config['limit'] == 'date' || $config['limit'] == 'count') { if ($printedAddLink) { $content .= " | "; } $content .= print_help_link("gedcom_news_archive_help", "qm", "", false, true); $content .= "<a href=\"" . encode_url("index.php?gedcom_news_archive=yes&ctype={$ctype}") . "\">" . $pgv_lang['gedcom_news_archive'] . "</a><br />"; } global $THEME_DIR; if ($block) { require $THEME_DIR . 'templates/block_small_temp.php'; } else { require $THEME_DIR . 'templates/block_main_temp.php'; } }
static function gedcomNews($params = null) { global $pgv_lang, $PGV_IMAGE_DIR, $PGV_IMAGES, $TEXT_DIRECTION, $GEDCOM, $ctype, $PGV_BLOCKS; if ($params === null) { $params = array(); } if (isset($params[0]) && $params[0] != '') { $limit = strtolower($params[0]); } else { $limit = 'count'; } if (isset($params[1]) && $params[1] != '') { $flag = strtolower($params[0]); } else { $flag = 5; } // News postings if ($flag == 0) { $limit = 'nolimit'; } if (isset($_REQUEST['gedcom_news_archive'])) { $limit = 'nolimit'; $flag = 0; } $usernews = getUserNews($GEDCOM); $content = ''; if (count($usernews) == 0) { $content .= "{$pgv_lang['no_news']}<br />\n"; } $c = 0; $td = time(); foreach ($usernews as $k => $news) { if ($limit == 'count') { if ($c >= $flag) { break; } $c++; } if ($limit == 'date') { if (floor(($td - $news['date']) / 86400) > $flag) { break; } } $content .= "<div class=\"news_box\" id=\"{$news['anchor']}\">\n"; // Look for $pgv_lang, $factarray, and $GLOBALS substitutions in the News title $newsTitle = print_text($news['title'], 0, 2); $ct = preg_match("/#(.+)#/", $newsTitle, $match); if ($ct > 0) { if (isset($pgv_lang[$match[1]])) { $newsTitle = preg_replace("/{$match['0']}/", $pgv_lang[$match[1]], $newsTitle); } } $content .= "<span class=\"news_title\">" . PrintReady($newsTitle) . "</span><br />\n"; $content .= "<span class=\"news_date\">" . format_timestamp($news['date']) . "</span><br /><br />\n"; // Look for $pgv_lang, $factarray, and $GLOBALS substitutions in the News text $newsText = print_text($news['text'], 0, 2); $ct = preg_match("/#(.+)#/", $newsText, $match); if ($ct > 0) { if (isset($pgv_lang[$match[1]])) { $newsText = preg_replace("/{$match[0]}/", $pgv_lang[$match[1]], $newsText); } } $ct = preg_match("/#(.+)#/", $newsText, $match); if ($ct > 0) { $varname = $match[1]; if (isset($pgv_lang[$varname])) { $newsText = preg_replace("/{$match[0]}/", $pgv_lang[$varname], $newsText); } else { if (defined('PGV_' . $varname)) { // e.g. global $VERSION is now constant PGV_VERSION $varname = 'PGV_' . $varname; } if (defined($varname)) { $newsText = preg_replace("/{$match[0]}/", constant($varname), $newsText); } else { if (isset(${$varname})) { $newsText = preg_replace("/{$match[0]}/", ${$varname}, $newsText); } } } } $trans = get_html_translation_table(HTML_SPECIALCHARS); $trans = array_flip($trans); $newsText = strtr($newsText, $trans); //$newsText = nl2br($newsText); $content .= PrintReady($newsText) . "<br />\n"; // Print Admin options for this News item if (PGV_USER_GEDCOM_ADMIN) { $content .= "<hr size=\"1\" />" . "<a href=\"javascript:;\" onclick=\"editnews('{$k}'); return false;\">{$pgv_lang['edit']}</a> | " . "<a href=\"" . encode_url("index.php?action=deletenews&news_id={$k}&ctype={$ctype}") . "\" onclick=\"return confirm('{$pgv_lang['confirm_news_delete']}');\">{$pgv_lang['delete']}</a><br />"; } $content .= "</div>\n"; } $printedAddLink = false; if (PGV_USER_GEDCOM_ADMIN) { $content .= "<a href=\"javascript:;\" onclick=\"addnews('" . preg_replace("/'/", "\\'", $GEDCOM) . "'); return false;\">{$pgv_lang['add_news']}</a>"; $printedAddLink = true; } if ($limit == 'date' || $limit == 'count') { if ($printedAddLink) { $content .= ' | '; } $content .= print_help_link('gedcom_news_archive_help', 'qm', '', false, true); $content .= "<a href=\"" . encode_url("index.php?gedcom_news_archive=yes&ctype={$ctype}") . "\">{$pgv_lang['gedcom_news_archive']}</a><br />\n"; } return $content; }
</table> </form> <?php } } } } $ct = count($cart); if ($controller->privCount > 0) { print "<span class=\"error\">" . $pgv_lang["clipping_privacy"] . "</span><br /><br />\n"; } if ($ct == 0) { // -- new lines, added by Jans, to display helptext when cart is empty if ($controller->action != 'add') { loadLangFile("pgv_help"); print_text("help_clippings.php"); echo PGV_JS_START; echo 'var pastefield;'; echo 'function paste_id(value) {pastefield.value=value;}'; echo PGV_JS_END; ?> <form method="get" name="addin" action="clippings.php"> <table> <tr> <td colspan="2" class="topbottombar" style="text-align:center; "> <?php print $pgv_lang["add_individual_by_id"]; print_help_link("add_by_id_help", "qm"); ?> </td> </tr>
$d_logfile_str .= "\">"; $d_logfile_str .= $dir_array[$ct]; $d_logfile_str .= "</option>\n"; } $d_logfile_str .= "</select>\n"; $d_logfile_str .= "<input type=\"button\" name=\"logfile\" value=\" > \" onclick=\"window.open('printlog.php?logfile='+this.form.logfilename.options[this.form.logfilename.selectedIndex].value, '_blank', 'top=50,left=10,width=600,height=500,scrollbars=1,resizable=1');\" />"; $d_logfile_str .= "</form>"; print $d_logfile_str; } print "</td>"; print "</tr>"; // Row 6: Change Log File print "<tr>"; print "<td valign=\"top\">"; // Column 1 (row legend) print_text("ged_change"); print "</td>"; print "<td valign=\"top\">"; // Column 2 (notices) if (!isset($CHANGELOG_CREATE)) { print getLRM() . $pgv_lang["none"]; } else { print getLRM() . $pgv_lang[$CHANGELOG_CREATE]; } print "</td>"; print "<td colspan=\"5\" valign=\"top\">"; // Columns 3-7 (file name selector) // Get the logfiles if (!isset($logfilename)) { $logfilename = ""; }
if ($note) { $wh[] = "(note LIKE " . $DB->Quote("%{$note}%") . ")"; } if (count($wh) > 0) { $PAGE_STYLE[width] = 21; $PAGE_STYLE[height] = 29.7; //intestazione: info cliente if ($dest) { $k = $DB->Execute("SELECT * FROM contact WHERE id=" . $DB->Quote($dest)); $cliente = $k->FetchRow(); utf8_encode_array($cliente); $int_font = $oo_def; $int_font[ml] = 15; $int_font[mr] = 2; $int_font[name] = 'Arial12int'; $OO_TEXT .= print_text("\n\n" . EXPORT_SXW_DEST . ":\n\n" . "{$cliente['nome']}\n" . "{$cliente['indirizzo']}\n" . "{$cliente['cap']} {$cliente['citta']}\n", $int_font); } // create table new_table(get_default_table('Tabella1', array(4, 9, 8))); add_table_header('Tabella1', array(EXPORT_SXW_COD, EXPORT_SXW_DENOM, EXPORT_SXW_NTEL), make_bold($oo_def_c)); $where = implode(' AND ', $wh); $TIPI = array(1 => 'AVVR', 2 => 'CLIE', 3 => 'COLL', 4 => 'CONS', 5 => 'CORR', 6 => 'FORN'); $q = $DB->Execute(" SELECT * \r\n FROM contact \r\n WHERE {$where}\r\n ORDER BY codice ASC"); while ($l = $q->FetchRow()) { utf8_encode_array($l); if ($l[data] == '0000-00-00') { $l[data] = ''; } add_table_row('Tabella1', array($l[codice], $rapida ? $l[nome] : "{$l['nome']}\n" . "{$l['indirizzo']}\n" . "{$l['cap']}\t{$l['citta']}\n" . "{$l['stato']}\t- {$l['leg_rap']}\n" . EXPORT_SXW_TYPE . ": " . $TIPI[$l[tipo]] . "\n" . EXPORT_SXW_DCOST . ": {$l['data']} - {$l['luogo']}", $rapida ? $l[telefono] : "{$l['telefono']}\n" . EXPORT_SXW_FAX . ":\t{$l['fax']}\n" . EXPORT_SXW_CFIS . "\t{$l['cod_fis']}\n" . EXPORT_SXW_PIVA . "\t{$l['piva']}\n" . EXPORT_SXW_ISCRCIAAA . ": {$l['iscr_ccia']}\n" . EXPORT_SXW_ISCRTRIB . ": {$l['iscr_trib']}\n" . EXPORT_SXW_PERSFIS . ": " . ($l[tipo_contatto] ? EXPORT_SXW_PERSFIS_NO : EXPORT_SXW_PERSFIS_YES) . "\n"), array($oo_def, $oo_def, $oo_def)); // note if ($l[note] && in_array(1, $P[print_note]) && !$rapida) {
/** * check if the page view rate for a session has been exeeded. */ function CheckPageViews() { global $SEARCH_SPIDER, $MAX_VIEWS, $MAX_VIEW_TIME; if ($MAX_VIEW_TIME == 0 || $MAX_VIEWS == 0 || !empty($SEARCH_SPIDER)) { return; } // The media firewall should not be throttled if (strpos($_SERVER["SCRIPT_NAME"], "mediafirewall") > -1) { return; } if (!empty($_SESSION["pageviews"]["time"]) && !empty($_SESSION["pageviews"]["number"])) { $_SESSION["pageviews"]["number"]++; if ($_SESSION["pageviews"]["number"] < $MAX_VIEWS) { return; } $sleepTime = $MAX_VIEW_TIME - time() + $_SESSION["pageviews"]["time"]; if ($sleepTime > 0) { // The configured page view rate has been exceeded // - Log a message and then sleep to slow things down $text = print_text("maxviews_exceeded", 0, 1); AddToLog($text); sleep($sleepTime); } } $_SESSION["pageviews"] = array("time" => time(), "number" => 1); }
$wh[] = "(pr_operatore LIKE '" . mysql_escape_string($operatore) . "%' OR pr_operatore LIKE '%" . mysql_escape_string($operatore) . "' OR pr_operatore LIKE '%,," . mysql_escape_string($operatore) . ",,%')"; } //if ($cliente) $wh[] = "(pr_ref_idcliente LIKE '".mysql_escape_string($cliente)."%' OR pr_ref_idcliente LIKE '%".mysql_escape_string($cliente)."' OR pr_ref_idcliente LIKE '%,,".mysql_escape_string($cliente).",,%')"; //if ($cliente) $wh[] = "(clie LIKE '".mysql_escape_string($cliente)."')"; if (count($wh) > 1) { $PAGE_STYLE[width] = 29.7; $PAGE_STYLE[height] = 21; //intestazione: info cliente if ($dest) { $k = mysql_query("SELECT * FROM contact WHERE id='" . mysql_escape_string($dest) . "'"); $cliente = mysql_fetch_assoc($k); $int_font = $oo_ar10; $int_font[ml] = 23; $int_font[mr] = 2; $int_font[name] = 'Arial12int'; $OO_TEXT .= print_text("\n\nDestinatario:\n\n" . "{$cliente['nome']}\n" . "{$cliente['indirizzo']}\n" . "{$cliente['cap']} {$cliente['citta']}\n", $int_font); } // operator list $j = mysql_query("SELECT id,codice,nome FROM users"); while ($k = mysql_fetch_assoc($j)) { $OPER[$k[id]] = array($k[codice], $k[nome]); } // tipo list $j = mysql_query("SELECT codice,ttp_desc FROM INT_pratiche_tipo"); while ($k = mysql_fetch_assoc($j)) { $PRTIPO[$k[codice]] = $k[ttp_desc]; } // create table new_table(get_default_table('Tabella1', array(7, 19, 3.7))); add_table_header('Tabella1', array('Codice', 'Oggetto', 'Date'), make_bold($oo_ar10c)); $where = implode(' AND ', $wh);
print " <td>\n"; print " <table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" bgcolor=\"$p_header_bgcolor\" width=\"100%\">\n"; print " <tr>\n"; print " <th align=\"left\" bgcolor=\"$p_header_bgcolor\">"; print_text($p_header_font_face, $p_header_font_size, $p_header_font_color,$message_command_line); print "</th>\n"; print " <tr>\n"; print " </table>\n"; print " </td>\n"; print " </tr>\n"; print " <tr>\n"; print " <td>\n"; print " <table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" bgcolor=\"$p_body_bgcolor\" width=\"100%\">\n"; print " <tr>\n"; print " <td>"; print_text($p_body_font_face,$p_body_font_size,$p_body_font_color,$generator); print "</td>\n"; print " </tr>\n"; print " </table>\n"; print " </td>\n"; print " </tr>\n"; print "</table>\n"; print " <!-- ###COMMAND LINE PANNEL END -->\n"; } print "</center>\n"; #################################### # Copyright dada # print "<font size=\"-3\" color=\"$copyright_color\">Copyright (c) 2001 Adel I. Mirzazhanov<br>\n"; print "<a href=\"http://www.adel.nursat.kz/apg\">APG Homepage</a></font>\n"; print "</body>\n";
echo '<tr>'; // NOTE: Print the position of the current item if ($adminedit) { echo '<td class="descriptionbox width20 $TEXT_DIRECTION" colspan="4">'; echo $pgv_lang["position_item"], ': ', $id, ', '; if ($data["header"]["gedcom"] == "*all*") { echo $pgv_lang["all"]; } else { echo PrintReady($data["header"]["gedcom"]); } echo '</td>'; } // NOTE: Print the header of the current item $header = str_replace(array('<', '>'), array('<', '>'), print_text($data["header"]["text"], 0, 2)); echo '<td class="list_label wrap">', $header, '</td></tr>'; $body = str_replace(array('<', '>'), array('<', '>'), print_text($data["body"]["text"], 0, 2)); echo '<tr>'; // NOTE: Print the edit options of the current item if (PGV_USER_GEDCOM_ADMIN && $adminedit) { echo '<td class="optionbox center">'; print_help_link("moveup_faq_item_help", "qm", "moveup_faq_item"); echo '<a href="', encode_url('faq.php?action=commit&type=moveup&id=' . $id . '&pidh=' . $data["header"]["pid"] . '&pidb=' . $data["body"]["pid"]), '"><img src="', $PGV_IMAGE_DIR, '/', $PGV_IMAGES["uarrow"]["other"], '" border="0" alt="" /></a></td>'; echo '<td class="optionbox center">'; print_help_link("movedown_faq_item_help", "qm", "movedown_faq_item"); echo '<a href="', encode_url('faq.php?action=commit&type=movedown&id=' . $id . '&pidh=' . $data["header"]["pid"] . '&pidb=' . $data["body"]["pid"]), '"><img src="', $PGV_IMAGE_DIR, '/', $PGV_IMAGES["darrow"]["other"], '" border="0" alt="" /></a>'; echo '</td><td class="optionbox center">'; print_help_link("edit_faq_item_help", "qm", "edit_faq_item"); echo '<a href="', encode_url('faq.php?action=edit&id=' . $id), '">', $pgv_lang["edit"], '</a>'; echo '</td><td class="optionbox center">'; print_help_link("delete_faq_item_help", "qm", "delete_faq_item"); echo '<a href="', encode_url('faq.php?action=commit&type=delete&id=' . $id . '&pidh=' . $data["header"]["pid"] . '&pidb=' . $data["body"]["pid"] . '&oldGEDCOM=' . $data["header"]["gedcom"]), '" onclick="return confirm(\'', $pgv_lang["confirm_faq_delete"], '\');">', $pgv_lang["delete"], '</a>';
" onclick="closeHelp();" /> <input type="reset" tabindex="<?php $i++; print $i; ?> " value="<?php print $pgv_lang["reset"]; ?> " /><br /> </td></tr> </table> </form> <br /><!--<?php if (isset($FILE) && !check_for_import($FILE)) { print_text("return_editconfig_gedcom"); } ?> <br />--> <?php if (count($GEDCOMS) == 0) { ?> <script language="JavaScript" type="text/javascript"> helpPopup('welcome_new_help'); </script> <?php } // NOTE: Put the focus on the GEDCOM title field since the GEDCOM path actually // NOTE: needs no changing ?> <script language="JavaScript" type="text/javascript">
} print "<table class=\"facts_table\">"; print "<tr>"; print "<td class=\"facts_value\" style=\"text-align:center; \" >"; srand((double) microtime() * 1000000); print "<input type=\"submit\" value=\"" . $pgv_lang["close_window"] . "\"" . " onclick=\"window.opener.showchanges('&dv=" . rand() . "#" . $anchor . "'); self.close();\" />"; print "</td>"; print "</tr>"; if ($Write_Ok) { print "<tr>"; print "<td class=\"facts_value\" style=\"text-align:center; \" >"; print "<br /><br /><input type=\"submit\" value=\""; print_text("close_window_without_refresh"); print "\"" . " onclick=\"self.close();\" /><br /><br />"; print "<div class=\"error\">"; print_text("edit_lang_utility_warning"); print "</div></td>"; print "</tr>"; } print "</table>"; print "</form>"; print "</center></div>"; // if ls02 (the line of the translated sentence) variable has not been set, try to find the row in the translated file if ($ls02 == "") { $ls02 = 0; $englishTarget1 = $english_language_array[$ls01][0]; $englishTarget2 = str_replace('"', "'", $englishTarget1); // Var name could be inside apostrophes $englishTarget3 = str_replace("'", '"', $englishTarget1); // Var name could be inside apostrophes for ($y = 0, $ymax = sizeof($new_language_array); $y < $ymax; $y++) {
/** * print a language variable * * It accepts any kind of language variable. This can be a single variable but also * a variable with included variables that needs to be converted. * print_text, which used to be called print_help_text, now takes 3 parameters * of which only the 1st is mandatory * The first parameter is the variable that needs to be processed. At nesting level zero, * this is the name of a $pgv_lang array entry. "whatever" refers to * $pgv_lang["whatever"]. At nesting levels greater than zero, this is the name of * any global variable, but *without* the $ in front. For example, VERSION or * pgv_lang["whatever"] or factarray["rowname"]. * The second parameter is $level for the nested vars in a sentence. This indicates * that the function has been called recursively. * The third parameter $noprint is for returning the text instead of printing it * This parameter, when set to 2 means, in addition to NOT printing the result, * the input string $help is text that needs to be interpreted instead of being * the name of a $pgv_lang array entry. This lets you use this function to work * on something other than $pgv_lang array entries, but coded according to the * same rules. * When we want it to return text we need to code: * print_text($mytext, 0, 1); * @param string $help The variable that needs to be processed. * @param int $level The position of the embedded variable * @param int $noprint The switch if the text needs to be printed or returned */ function print_text($help, $level = 0, $noprint = 0) { global $pgv_lang, $factarray, $COMMON_NAMES_THRESHOLD; global $INDEX_DIRECTORY, $GEDCOM, $GEDCOM_TITLE, $LANGUAGE; global $GUESS_URL, $UpArrow, $DAYS_TO_SHOW_LIMIT, $MEDIA_DIRECTORY; global $repeat, $thumbnail, $xref, $pid; if (!isset($_SESSION["DEBUG_LANG"])) { $DEBUG_LANG = "no"; } else { $DEBUG_LANG = $_SESSION["DEBUG_LANG"]; } if ($DEBUG_LANG == "yes") { print "[LANG_DEBUG] Variable called: " . $help . "<br /><br />"; } $sentence = ""; if ($level > 0) { $value = ""; eval("if (!empty(\${$help})) \$value = \${$help};"); if (empty($value)) { return ""; } $sentence = $value; } if (empty($sentence)) { if ($noprint == 2) { $sentence = $help; } else { if (!empty($pgv_lang[$help])) { $sentence = $pgv_lang[$help]; } else { if ($DEBUG_LANG == "yes") { print "[LANG_DEBUG] Variable not present: " . $help . "<br /><br />"; } $sentence = $pgv_lang["help_not_exist"]; } } } $mod_sentence = ""; $replace = ""; $replace_text = ""; $sub = ""; $pos1 = 0; $pos2 = 0; $ct = preg_match_all("/#([a-zA-Z0-9_.\\-\\[\\]]+)#/", $sentence, $match, PREG_SET_ORDER); for ($i = 0; $i < $ct; $i++) { $value = ""; $newreplace = preg_replace(array("/\\[/", "/\\]/"), array("['", "']"), $match[$i][1]); if ($DEBUG_LANG == "yes") { print "[LANG_DEBUG] Embedded variable: " . $match[$i][1] . "<br /><br />"; } $value = print_text($newreplace, $level + 1); if (!empty($value)) { $sentence = str_replace($match[$i][0], $value, $sentence); } else { if ($noprint == 0 && $level == 0) { $sentence = str_replace($match[$i][0], $match[$i][1] . ": " . $pgv_lang["var_not_exist"], $sentence); } } } // ------ Replace paired ~ by tag_start and tag_end (those vars contain CSS classes) while (stristr($sentence, "~") == TRUE) { $pos1 = strpos($sentence, "~"); $mod_sentence = substr_replace($sentence, " ", $pos1, 1); if (stristr($mod_sentence, "~")) { // If there's a second one: $pos2 = strpos($mod_sentence, "~"); $replace = substr($sentence, $pos1 + 1, $pos2 - $pos1 - 1); $replace_text = "<span class=\"helpstart\">" . str2upper($replace) . "</span>"; $sentence = str_replace("~" . $replace . "~", $replace_text, $sentence); } else { break; } } if ($noprint > 0) { return $sentence; } if ($level > 0) { return $sentence; } print $sentence; }
if (substr($help, -5) != "_help") { if (substr($help, 0, 5) != 'help_' || substr($help, -4) != '.php') { exit; } } print_simple_header($pgv_lang["config_help"]); print '<span class="helpheader">'; print_text("config_help"); print '</span><br /><br /><span class="helptext">'; if ($help == "help_contents_help") { if (PGV_USER_IS_ADMIN) { $help = "admin_help_contents_help"; print_text("admin_help_contents_head_help"); } else { print_text("help_contents_head_help"); } print_help_index($help); } else { if ($help == "help_uploadgedcom.php") { $help = "help_addgedcom.php"; } print_text($help); } print "</span><br /><br />"; print "<a href=\"help_text.php?help=help_contents_help\"><b>"; print_text("help_contents"); print "</b></a><br />"; print "<a href=\"javascript:;\" onclick=\"window.close();\"><b>"; print_text("close_window"); print "</b></a>"; print_simple_footer();
<tr> <td class="descriptionbox wrap width20"><?php print_help_link("META_COPYRIGHT_help", "qm", "META_COPYRIGHT"); print $pgv_lang["META_COPYRIGHT"]; ?> </td> <td class="optionbox"><input type="text" dir="ltr" name="NEW_META_COPYRIGHT" value="<?php print $META_COPYRIGHT; ?> " onfocus="getHelp('META_COPYRIGHT_help');" tabindex="<?php $i++; print $i; ?> " /><br /> <?php print print_text("META_COPYRIGHT_descr"); ?> </td> </tr> <tr> <td class="descriptionbox wrap width20"><?php print_help_link("META_DESCRIPTION_help", "qm", "META_DESCRIPTION"); print $pgv_lang["META_DESCRIPTION"]; ?> </td> <td class="optionbox"><input type="text" dir="ltr" name="NEW_META_DESCRIPTION" value="<?php print $META_DESCRIPTION; ?> " onfocus="getHelp('META_DESCRIPTION_help');" tabindex="<?php $i++; print $i;
} break; } } } } // Temporarily switch languages to match the language selected for Export, // so that function print_text will substitute text in the correct language $savedLanguage = $LANGUAGE; $LANGUAGE = $language2; loadLangFile("pgv_lang, pgv_admin, pgv_editor, pgv_facts, pgv_help, pgv_confighelp"); $LANGUAGE = $savedLanguage; for ($z = 0, $zmax = sizeof($new_language_array); $z < $zmax; $z++) { if ($new_language_array[$z][0] != "config_help" and $new_language_array[$z][0] != "welcome_help") { fwrite($fp, "<li>"); fwrite($fp, stripslashes(print_text($new_language_array[$z][1], 0, 2)) . "<br /><br /></li>"); } } // Restore language to original setting -- we're done if ($language2 != $LANGUAGE) { // Only necessary when languages differ loadLangFile("pgv_lang, pgv_admin, pgv_editor, pgv_facts, pgv_help, pgv_confighelp"); } fwrite($fp, "</ol>"); fwrite($fp, "</body></html>"); fclose($fp); echo "<br /><strong>"; echo $pgv_lang["export_ok"]; echo "</strong><br />"; echo $pgv_lang["export_filename"]; echo " <a href=\"", $FileName . "\">", $FileName, "</a>";
while ($arr1 = $result1->fetch_assoc()) { $l_avg_ranges = explode(' | ', $arr1["text"]); if (count($l_avg_ranges) == 2) { $avg_km += $l_avg_ranges[0] + floor(($l_avg_ranges[1] - $l_avg_ranges[0]) / 2); $avg_km_counter++; } } if ($avg_km_counter > 0) { $avg_km = (int) ($avg_km / $avg_km_counter); $arr['millage'] = $avg_km; } } $sql = "SELECT prop_val,sum(specs) as num\n\t\t\t\t\tFROM ru_eyezeek.np_market_trends_vehicles_specs s join \n\t\t\t\t\t\tru_eyezeek.np_market_trends_vehicles_items i on s.item_id=i.id\n\t\t\t\t\t\twhere make='" . $arr['brand'] . "' and model='" . $arr['series'] . "' and \n\t\t\t\t\t\t\t `year`=" . $arr['year'] . " and prop='cnt_in_city' group by make,model,year,prop_val"; $regions = array(); $total_count = 0; print_text("Fetching regions for: " . $arr['brand'] . " " . $arr['series'] . " " . $arr['year']); if ($result1 = $mysqli->query($sql)) { while ($arr1 = $result1->fetch_assoc()) { $sph->resetSphinx(); $sph->setAttribute('what', 'vehicles'); $sph->setAttribute('lmake', $arr['brand']); $sph->setAttribute('lmodel', $arr['series']); $sph->setAttribute('lyear', $arr['year']); $sph->setAttribute('lgeocity', $arr1['prop_val']); $sph->setOptions($options); $res = $sph->search(); $active_in_city = $res['total_found']; $sph->resetSphinx(); $sph->setAttribute('what', 'vehicles'); $sph->setAttribute('lmake', $arr['brand']); $sph->setAttribute('lmodel', $arr['series']);
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 (in_array($ged, get_all_gedcoms())) { require get_config_file($ged); if (!$SYNC_GEDCOM_FILE && ($ged = $GEDCOM)) { $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); echo '</div><hr/>'; } require get_config_file(PGV_GEDCOM); } // 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 {