To fix it immediately change the following line in the buildindex.php from:
$indilist["$gid"] = addslashes($name);
to:
$indilist["$gid"] = preg_replace('/"/', '\"', $name);
--John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Getting rid of the \ in the family requires changing the functions.php file. Add the following line to the get_sortable_name function above line 314:
$name = preg_replace('/"/', '\"', $name);
Then erase the following line in the buildindex.php file:
$famlist["$gid"] = addslashes($famlist["$gid"]);
Then rebuild the indexes again.
--John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In my functions.php (from version 2.11), function get_sortable_name runs from line 279 thru 307.
then function get_family_descriptor runs from line 309 thru 313.
Do you mean to add the line below the existing one in get_sortable_name that says
$name = preg_replace("'\/'", "", $name);
which at the moment is followed by
return $name;
Mark
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Version 2.11
Just noticed (with good eyesight) that my entry for a Margaret O'Brien works sometimes OK in the INDI view and the FAM view.
But in the Individual List view, the name comes out as O\'Brien, Margaret
She also comes out as O\'Brien, Margaret when viewed from the husband's INDI view.
And in the Family List, she comes with two \'s
McMahon, John + O\\'Brien, Margaret
Mark
I will fix this in the next version.
To fix it immediately change the following line in the buildindex.php from:
$indilist["$gid"] = addslashes($name);
to:
$indilist["$gid"] = preg_replace('/"/', '\"', $name);
--John
That's cured the instances of the single \'s
And in the Family List she's gone from 2 \'s to a single \ ... ie still has one \
ie
McMahon, John + O\'Brien, Margaret
(You didn't explicitly say, but I quickly sussed, that I had to update the gedcom and re-build the indexes)
Getting rid of the \ in the family requires changing the functions.php file. Add the following line to the get_sortable_name function above line 314:
$name = preg_replace('/"/', '\"', $name);
Then erase the following line in the buildindex.php file:
$famlist["$gid"] = addslashes($famlist["$gid"]);
Then rebuild the indexes again.
--John
Sorry, I'm unclear about where to add the line.
In my functions.php (from version 2.11), function get_sortable_name runs from line 279 thru 307.
then function get_family_descriptor runs from line 309 thru 313.
Do you mean to add the line below the existing one in get_sortable_name that says
$name = preg_replace("'\/'", "", $name);
which at the moment is followed by
return $name;
Mark
Yes, the last three lines of the get_sortable_name function should look like this:
$name = preg_replace("'\/'", "", $name);
$name = preg_replace('/"/', '\"', $name);
return $name;
The first replace gets rid of the forward slash around surnames. The second adds backslashes before double quotes. Then the name is returned.
--John
Yep ... that's done the trick.
Thank you
Mark