Exporting of notes/text

If you've programmed a new HuMo-genealogy feature (that you'd like to see included in the official version), please upload and describe your work here.
Post Reply
User avatar
Huub
HuMo-genealogy programmer
HuMo-genealogy programmer
Posts: 2692
Joined: Wed 27 Aug 2008, 11:34
Location: Heerhugowaard, Netherlands
Contact:

Re: Exporting of notes/text

Post by Huub »

Hello LeonJac,

Thanks for the file!


I didn't test your file yet, but I did look into the changed code. Just a few remarks at this moment:

You disabled the texts: "The gedcom export is not completely ready yet!".
I made that text because the gedcom export isn't finished. There are a lot of items that needs to be exported...

If anyone uses this file, they will see this submitter in the gedcom file: $buffer.="1 SUBM Jac Messerschmidt\n";
It's in my wishlist to add more personal data in a gedcom export, we probably need some general settings to save these personal data to make this work properly.

You do checks for @N, but there are programs that uses other characters for text (there is a program that uses @NM for text by marriage, and other characters like that).

I do know the "referenced" text are missing in the gedcom export. There is a reason for this: if someone uses the HuMo-gen editor, a referenced text is saved as non-referenced text (and the old referenced text is not removed yet...). The editor is a relative new item in HuMo-gen, and I still don't know for sure how to store texts in a proper way.
Personally I don't like referenced texts... I don't think it's usefull to use referenced texts. I do think it's usefull to use referenced sources (I use them a lot!), but for texts??
For this to work smoothly, a modification should also be made to table texts in gedcom-tables.php to introduce a new key, KEY text_gedcomnr. KEY text_id should be replaced by PRIMARY KEY text_id. This modification requires that the gedcom input file should be read again.
It's not possible to add changes that require a gedcom reading. Because I (and one or two other HuMo-gen users) never use gedcom import, I use HuMo-gen as my main genealogical program.
Most database modifications can be done if the gedcom data is allready in it...

I will do some tests, and look at the database update!

[UPDATE] I started to update the gedcom export, using your code.
- I decided to remove the text "The gedcom export is not completely ready yet!"
- I found a bug in export of latitude and longitude. That's solved.
- The HuMo-gen version is now automatically updated

Code: Select all

$buffer.="2 VERS ".$humo_option["version"]."\n";
- I changed:

Code: Select all

0 @N82@ NOTE text etc.
into:

Code: Select all

0 @N82@ NOTE
1 CONC text etc.
- I ordered the notes, so they will be exported in order of @Nxx number:

Code: Select all

natsort($noteids);
- I moved your code to the last part of the gedcom file, so it will be possible to export referenced source texts.

- I changed the export code, it's not necessary to change the database now.

- The name of the family tree owner is now exported as submitter!

Still busy testing and changing code...
HuMo-genealogy update? Backup your database! Editing in HuMo-genealogy? Backup your data!
Make multiple backups with: PHPMyAdmin, gedcom export and database export.

HuMo-genealogy software: http://humo-gen.com
User avatar
Huub
HuMo-genealogy programmer
HuMo-genealogy programmer
Posts: 2692
Joined: Wed 27 Aug 2008, 11:34
Location: Heerhugowaard, Netherlands
Contact:

Re: Exporting of notes/text

Post by Huub »

Jac,

Here is the gedcom export file I made...

I did change your functions, and added some other items (see my previous posting).
gedcom_export.php
(49.07 KiB) Downloaded 355 times
HuMo-genealogy update? Backup your database! Editing in HuMo-genealogy? Backup your data!
Make multiple backups with: PHPMyAdmin, gedcom export and database export.

HuMo-genealogy software: http://humo-gen.com
User avatar
Huub
HuMo-genealogy programmer
HuMo-genealogy programmer
Posts: 2692
Joined: Wed 27 Aug 2008, 11:34
Location: Heerhugowaard, Netherlands
Contact:

Re: Exporting of notes/text

Post by Huub »

I will look at your items, for now some remarks:
LeonJac wrote:... could of course capture any string starting with "@" such as "@S123@" but would miss a note ref structured like this:
1 NOTE See @N23@
The other drawback of only checking the first char of the string is that it misses multiple reference like this:
1 NOTE @N12@|@N13|@N15@|@N16|... (typical in gedcoms generated by MyHeritage, for instance)
I never saw a line like this in a gedcom file:

Code: Select all

1 NOTE See @N23@
It should be:

Code: Select all

1 NOTE See, text etc. 
Or a referenced text:

Code: Select all

1 NOTE @N23@
And I never saw a line like this in a gedcom file:

Code: Select all

1 NOTE @N12@|@N13|@N15@|@N16|
That should be:

Code: Select all

1 NOTE @N12@
1 NOTE @N13
1 NOTE @N15@
1 NOTE @N16
I don't think your lines are valid gedcom lines...
The gedcom 5.5 standard can be found here: http://homepages.rootsweb.ancestry.com/ ... 5gcch1.htm
Also, when exporting the notes, I notice that you've introduced natsort($noteids). That is a good call especially if there are non-standard tags, except that natsort() does not eliminate duplicates. I would therefore still follow that with $noteids = array_unique($noteids) to get rid of the duplicates.
Normally there are no duplicate notes in HuMo-gen. It's only possible to have duplicate notes, if the original gedcom file has duplicate notes.
HuMo-genealogy update? Backup your database! Editing in HuMo-genealogy? Backup your data!
Make multiple backups with: PHPMyAdmin, gedcom export and database export.

HuMo-genealogy software: http://humo-gen.com
Post Reply