\n"; echo "\n"; echo "\n"; if (isset($welcome)) { echo " \n"; echo " ", WT_SERVER_NAME, WT_SCRIPT_PATH, "index.php?command=gedcom&ged=", urlencode($gedcom_name), "\n"; echo " ", $welcome_update, "\n"; echo " 0.", $welcome_priority, "\n"; echo " \n"; } $oldGEDCOM = $GEDCOM; $GEDCOM = $gedcom_name; // Create a temporary userid $sitemap_user_id = createTempUser('#SiteMap#', 'visitor', $gedcom_name); // Create a temporary userid // Temporarily become this user $_SESSION["org_user"]=$_SESSION["wt_user"]; $_SESSION["wt_user"]='#SiteMap#'; if (isset($indi_rec)) { $statement=WT_DB::prepare("SELECT i_id, i_gedcom FROM {$TBLPREFIX}individuals WHERE i_file=?")->execute(array($index)); while ($row=$statement->fetch(PDO::FETCH_NUM)) { if ($no_private_links) { if (displayDetailsById($row[0], "INDI", true)) { echo " \n"; echo " ", WT_SERVER_NAME, WT_SCRIPT_PATH, "individual.php?pid=", $row[0], "&ged=", urlencode($gedcom_name), "\n"; $arec = get_sub_record(1, "1 CHAN", $row[1], 1); if (!empty($arec) && preg_match("/2 DATE (.*)/", $arec, $datematch)) echo " ", date("Y-m-d", strtotime($datematch[1])), "\n"; echo " ", $indirec_update, "\n"; echo " 0.", $indirec_priority, "\n"; echo " \n"; } } else { echo " \n"; echo " ", WT_SERVER_NAME, WT_SCRIPT_PATH, "individual.php?pid=", $row[0], "&ged=", urlencode($gedcom_name), "\n"; $arec = get_sub_record(1, "1 CHAN", $row[1], 1); if (!empty($arec) && preg_match("/2 DATE (.*)/", $arec, $datematch)) echo " ", date("Y-m-d", strtotime($datematch[1])), "\n"; echo " ", $indirec_update, "\n"; echo " 0.", $indirec_priority, "\n"; echo " \n"; } } $statement->closeCursor(); } if (isset($fam_rec)) { $statement=WT_DB::prepare("SELECT f_id, f_gedcom FROM {$TBLPREFIX}families WHERE f_file=?")->execute(array($index)); while ($row=$statement->fetch(PDO::FETCH_NUM)) { if ($no_private_links) { if (displayDetailsById($row[0], "FAM", true)) { echo " \n"; echo " ", WT_SERVER_NAME, WT_SCRIPT_PATH, "family.php?famid=", $row[0], "&ged=", urlencode($gedcom_name), "\n"; $arec = get_sub_record(1, "1 CHAN", $row[1], 1); if (!empty($arec) && preg_match("/2 DATE (.*)/", $arec, $datematch)) echo " ", date("Y-m-d", strtotime($datematch[1])), "\n"; echo " ", $indirec_update, "\n"; echo " 0.", $indirec_priority, "\n"; echo " \n"; } } else { echo " \n"; echo " ", WT_SERVER_NAME, WT_SCRIPT_PATH, "family.php?famid=", $row[0], "&ged=", urlencode($gedcom_name), "\n"; $arec = get_sub_record(1, "1 CHAN", $row[1], 1); if (!empty($arec) && preg_match("/2 DATE (.*)/", $arec, $datematch)) echo " ", date("Y-m-d", strtotime($datematch[1])), "\n"; echo " ", $indirec_update, "\n"; echo " 0.", $indirec_priority, "\n"; echo " \n"; } } $statement->closeCursor(); } if (isset($fam_lists)) { foreach(get_indilist_salpha($SHOW_MARRIED_NAMES, true, $index) as $letter) { if ($letter!='@') { echo " \n"; echo " ", WT_SERVER_NAME, WT_SCRIPT_PATH, "famlist.php?alpha=", urlencode($letter), "&ged=", urlencode($gedcom_name), "\n"; echo " ", $famlist_update, "\n"; echo " 0.", $famlist_priority, "\n"; echo " \n"; } } } if (isset($indi_lists)) { foreach (get_indilist_salpha($SHOW_MARRIED_NAMES, false, $index) as $letter) { if ($letter!='@') { echo " \n"; echo " ", WT_SERVER_NAME, WT_SCRIPT_PATH, "indilist.php?alpha=", urlencode($letter), "&ged=", urlencode($gedcom_name), "\n"; echo " ", $indilist_update, "\n"; echo " 0.", $indilist_priority, "\n"; echo " \n"; } } } echo ""; $_SESSION["wt_user"]=$_SESSION["org_user"]; delete_user($sitemap_user_id); AddToLog("deleted dummy user -> #SiteMap# <-", 'auth'); $GEDCOM = $oldGEDCOM; exit; } if ($action=="sendIndex") { header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="SitemapIndex.xml"'); echo "\n"; echo "\n"; echo "\n"; if (isset($filenames)) { foreach($filenames as $ged_index=>$ged_name) { $xml_name = str_ireplace(".ged",".xml", $ged_name); echo " \n"; echo " ", WT_SERVER_NAME, WT_SCRIPT_PATH, "SM_", $xml_name, "\n"; echo " ", date("Y-m-d"), "\n "; echo " \n"; } } echo "\n"; exit; } print_header(i18n::translate('Generate Sitemap files')); if ($action=="generate") { echo "

"; echo i18n::translate('Generate Sitemap files'); echo help_link('SITEMAP','sitemap'); echo "

\n"; echo "\n"; echo "\n"; if (isset($_POST["welcome_page"])) echo "\n"; if (isset($_POST["indi_recs"])) echo "\n"; if (isset($_POST["indi_list"])) echo "\n"; if (isset($_POST["fam_recs"])) echo "\n"; if (isset($_POST["fam_list"])) echo "\n"; if (isset($_POST["GEDCOM_Privacy"])) echo "\n"; echo "\n"; foreach (get_all_gedcoms() as $ged_id=>$gedcom) { if (isset($_POST["GEDCOM_{$ged_id}"])) echo "\n"; } echo "\n"; $filecounter = 0; foreach (get_all_gedcoms() as $ged_id=>$gedcom) { if (isset($_POST["GEDCOM_{$ged_id}"])) { $filecounter += 1; $sitemapFilename = "SM_".str_ireplace(".ged",".xml",$gedcom); echo "\n"; } } if ($filecounter > 1) { echo "\n"; } echo "\n"; echo "
", i18n::translate('Selected items to store in Sitemap:'), "
", i18n::translate('Home Page'), "
", i18n::translate('Individual Information'), "
", i18n::translate('Individual List'), "
", i18n::translate('Family Information'), "
", i18n::translate('Family List'), "
", i18n::translate('No links to private information'), "
", i18n::translate('GEDCOMs to store in Sitemap:'), "
", get_gedcom_setting($ged_id, 'title'), "
", i18n::translate('The following Sitemap files have been generated and can be downloaded:'), "
", $sitemapFilename, "
$gedcom) { if (isset($_POST["GEDCOM_{$ged_id}"])) { echo "&filenames[", $ged_id, "]=", $gedcom; } } echo "\">SitemapIndex.xml
", i18n::translate('Place all the files in the root of your webtrees installation.'), "
\n"; echo "
\n"; } if ($action=="") { $i = 0; ?>

$gedcom) { echo " ", get_gedcom_setting($ged_id, 'title'), "
\n"; } ?>