$gedarray["title"] = str_replace("#GEDCOMFILE#", $GEDFILENAME, $pgv_lang["new_gedcom_title"]);
     }
 }
 $gedarray["title"] = stripLRMRLM($gedarray["title"]);
 $gedarray["path"] = $path . $GEDFILENAME;
 $gedarray["id"] = $gedcom_id;
 $gedarray["pgv_ver"] = $pgv_ver;
 // Check that add/remove common surnames are separated by [,;] blank
 $_POST["NEW_COMMON_NAMES_REMOVE"] = preg_replace("/[,;]\\b/", ", ", $_POST["NEW_COMMON_NAMES_REMOVE"]);
 $_POST["NEW_COMMON_NAMES_ADD"] = preg_replace("/[,;]\\b/", ", ", $_POST["NEW_COMMON_NAMES_ADD"]);
 $COMMON_NAMES_THRESHOLD = $_POST["NEW_COMMON_NAMES_THRESHOLD"];
 $COMMON_NAMES_ADD = $_POST["NEW_COMMON_NAMES_ADD"];
 $COMMON_NAMES_REMOVE = $_POST["NEW_COMMON_NAMES_REMOVE"];
 $gedarray["commonsurnames"] = "";
 $GEDCOMS[$FILE] = $gedarray;
 store_gedcoms();
 require $INDEX_DIRECTORY . "gedcoms.php";
 $boolarray = array();
 $boolarray["yes"] = "true";
 $boolarray["no"] = "false";
 $boolarray[false] = "false";
 $boolarray[true] = "true";
 $configtext = implode('', file("config_gedcom.php"));
 $_POST["NEW_MEDIA_DIRECTORY"] = preg_replace('/\\\\/', '/', $_POST["NEW_MEDIA_DIRECTORY"]);
 $ct = preg_match("'/\$'", $_POST["NEW_MEDIA_DIRECTORY"]);
 if ($ct == 0) {
     $_POST["NEW_MEDIA_DIRECTORY"] .= "/";
 }
 if (substr($_POST["NEW_MEDIA_DIRECTORY"], 0, 2) == "./") {
     $_POST["NEW_MEDIA_DIRECTORY"] = substr($_POST["NEW_MEDIA_DIRECTORY"], 2);
 }
Example #2
0
/**
* Delete a gedcom from the database and the system
* Does not delete the file from the file system
* @param string $ged  the filename of the gedcom to delete
*/
function delete_gedcom($ged)
{
    global $TBLPREFIX, $pgv_changes, $GEDCOMS, $gBitDb;
    if (!isset($GEDCOMS[$ged])) {
        return;
    }
    $ged_id = get_id_from_gedcom($ged);
    $gBitDb->query("DELETE FROM {$TBLPREFIX}blocks        WHERE b_username=?", array($ged));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}dates         WHERE d_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}families      WHERE f_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}favorites     WHERE fv_file   =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}individuals   WHERE i_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}link          WHERE l_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}media         WHERE m_gedfile =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}media_mapping WHERE mm_gedfile=?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}name          WHERE n_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}news          WHERE n_username=?", array($ged));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}nextid        WHERE ni_gedfile=?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}other         WHERE o_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}placelinks    WHERE pl_file   =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}places        WHERE p_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}sources       WHERE s_file    =?", array($ged_id));
    if (isset($pgv_changes)) {
        //-- erase any of the changes
        foreach ($pgv_changes as $cid => $changes) {
            if ($changes[0]["gedcom"] == $ged) {
                unset($pgv_changes[$cid]);
            }
        }
        write_changes();
    }
    unset($GEDCOMS[$ged]);
    store_gedcoms();
    if (get_site_setting('DEFAULT_GEDCOM') == $ged) {
        set_site_setting('DEFAULT_GEDCOM', '');
    }
}