Page 1 of 1

WebSite Editor for FH html pages (not a plug-in)

Posted: 27 Nov 2020 14:17
by Andy63
I had previously posted about additions and changes to the web files that Family Historian creates. The new additions or modifications are in red.

You can see the result here: https://icfo.info/genealogie/

Search : The search engine needs some experience with FTP and setting up a database on your web server.

Editor and addition of web pages: Create new web pages or edit existing one (the save button is disabled.).

Pdf: All pdf reference will open in a searchable pdf viewer.

It is not completely finished but functional enough to give you a preview.

Andy

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 27 Nov 2020 14:46
by tatewise
Thanks Andy, I am sure that will become useful.

A couple of comments on your sample results.
The Colonel Landry, May 27 1891 (pdf) link complains about 'Missing PDF file'.
The Important People Places and Events (new page) link works fine but the Home | Contacts | Statistics links are broken because they include folder _FHuploads.

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 27 Nov 2020 15:01
by Andy63
tatewise wrote:
27 Nov 2020 14:46
A couple of comments on your sample results.
The Colonel Landry, May 27 1891 (pdf) link complains about 'Missing PDF file'.
The Important People Places and Events (new page) link works fine but the Home | Contacts | Statistics links are broken because they include folder _FHuploads.
Thanks, I will look into it...

Andy

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 27 Nov 2020 15:17
by Andy63
The links are fixed.
https://icfo.info/genealogie/

Andy

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 06 Dec 2020 10:56
by Andy63
I finish the programming for my friend Family Historian WebSite. This only missing page is the Administration page and a basic CSS file editor. Beside that, everything is working pretty well.

HOME PAGE
Image

NEW PAGES
Image

INDEX
Image

SEARCH
Image

EDIT-ADD PAGES
Image

FILE MANAGER FOR NEW PAGES: HTML FILES, DOCUMENTS AND IMAGES...
Image

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 09 Dec 2020 11:39
by Andy63
I have checked with version 7 and everything is working fine. I added a photo album since more than 10,000 photos must be displayed. Like photos of houses in LowerTown (Ottawa), fires, schools, churches... I won't need a basic css editor since Family Historian does the job well. There is only the administration page to create.

Andy

Image

Image

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 09 Dec 2020 12:37
by Andy63
MAIN FILE TO PREPARE THE WEB SITE
I am using simple PHP language so that anyone with a basic knowledge of PHP can follow the logic.

Code: Select all

$zip = new ZipArchive; 
if ($zip->open('fhfiles.zip') === TRUE) { 
//unzip
   $zip->extractTo('./'); 
   $zip->close();
   
//process index.html
   //- modify links
   $targetIndex = $_SERVER['DOCUMENT_ROOT'] . "/fhfiles/index.html";
   $homepage = file_get_contents($targetIndex);
   $homepage = str_ireplace("_nameindex.html","/fhsearch.php", $homepage);
   if (stripos($homepage, "/fhfiles/index.html")===false) {
      $homepage = str_ireplace("index.html","/fhfiles/index.html", $homepage);   
   }
   $homepage = str_ireplace("fhsearch.php\">Index</a>","fhsearch.php\">Search</a>", $homepage);
   $saveFile = file_put_contents($targetIndex,$homepage);
   
   //- extract header+menu from index.html. Save as fhheader.bin. For fhwebeditor.php+fhsearch.php+new created pages as header+menu. Need to add <!--[endmenu]--> in "below menu" in configuration in Family Historian.
   $findStop = stripos($homepage, "<!--[endmenu]-->")+17;
   $findHeader = substr($homepage,0,$findStop);
   if (stripos($findHeader, "/fhfiles/fhstyle.css")===false) {
      $findHeader = str_ireplace("fhstyle.css","/fhfiles/fhstyle.css", $findHeader);   
   }
   if (stripos($findHeader, "/fhfiles/lytebox.js")===false) {
      $findHeader = str_ireplace("lytebox.js","/fhfiles/lytebox.js", $findHeader);   
   }
   if (stripos($findHeader, "/fhfiles/lytebox.css")===false) {
      $findHeader = str_ireplace("lytebox.css","/fhfiles/lytebox.css", $findHeader);   
   }
   if (stripos($findHeader, "/fhfiles/_contact.html")===false) {
      $findHeader = str_ireplace("_contact.html","/fhfiles/_contact.html", $findHeader);   
   }
   if (stripos($findHeader, "/fhfiles/_statistics.html")===false) {
      $findHeader = str_ireplace("_statistics.html","/fhfiles/_statistics.html", $findHeader);   
   }
   if (stripos($findHeader, "/fhfiles/_torindex.html")===false) {
      $findHeader = str_ireplace("_torindex.html","/fhfiles/_torindex.html", $findHeader);   
   }
   if (stripos($findHeader, "/fhfiles/logo.jpg")===false) {
      $findHeader = str_ireplace("logo.jpg","/fhfiles/logo.jpg", $findHeader);   
   }
   $targetIndex = $_SERVER['DOCUMENT_ROOT'] . "/fhheader.bin";
   $saveFile = file_put_contents($targetIndex,$findHeader);
   echo $findHeader;
   
   //- copy the original index.html as familyhistorian.html as template in fhuploads directory. Need to add <!--[endpage]--> in "end of Body" in configuration in Family Historian.
   $targetFHuploadIndex = $_SERVER['DOCUMENT_ROOT'] . "/fhuploads/familyhistorian.html";
   $findStart = stripos($homepage, "<!--[endmenu]-->")+16;
   $findStop = stripos($homepage, "<!--[endpage]-->")-1; 
   $findLen = $findStop - $findStart;
   $findIndexContent = substr($homepage,$findStart,$findLen);
   //need to replace single quotes as HTML coding. Remove line breaks and line feeds so Javascript variables and Form $_POST works without problems.
   $findIndexContent = str_ireplace("\n","", $findIndexContent);
   $findIndexContent = str_ireplace("\r","", $findIndexContent);
   $findIndexContent = str_ireplace("'","&#39;", $findIndexContent);
   $saveFile = file_put_contents($targetFHuploadIndex,$findIndexContent);
   fclose($homepage);
   
//process _contact.html if exist
   $targetIndex = $_SERVER['DOCUMENT_ROOT'] . "/fhfiles/_contact.html";
   if (file_exists($targetIndex)) {
      $homepage = file_get_contents($targetIndex);
      $homepage = str_ireplace("_nameindex.html","/fhsearch.php", $homepage);
      if (stripos($homepage, "/fhfiles/index.html")===false) {
         $homepage = str_ireplace("index.html","/fhfiles/index.html", $homepage);   
      }
      if (stripos($homepage, "/fhfiles/_contact.html")===false) {
         $homepage = str_ireplace("_contact.html","/fhfiles/_contact.html", $homepage);   
      }
      if (stripos($homepage, "/fhfiles/logo.jpg")===false) {
         $homepage = str_ireplace("logo.jpg","/fhfiles/logo.jpg", $homepage);   
      }
      $homepage = str_ireplace("fhsearch.php\">Index</a>","fhsearch.php\">Search</a>", $homepage);
      $saveFile = file_put_contents($targetIndex,$homepage);
      fclose($homepage);
   }
   
//process _statistics.html if exist
   $targetIndex = $_SERVER['DOCUMENT_ROOT'] . "/fhfiles/_statistics.html";
   if (file_exists($targetIndex)) {
      $homepage = file_get_contents($targetIndex);
      $homepage = str_ireplace("_nameindex.html","/fhsearch.php", $homepage);
      if (stripos($homepage, "/fhfiles/index.html")===false) {
         $homepage = str_ireplace("index.html","/fhfiles/index.html", $homepage);   
      }
      if (stripos($homepage, "/fhfiles/_statistics.html")===false) {
         $homepage = str_ireplace("_statistics.html","/fhfiles/_statistics.html", $homepage);   
      }
      if (stripos($homepage, "/fhfiles/logo.jpg")===false) {
         $homepage = str_ireplace("logo.jpg","/fhfiles/logo.jpg", homepage);   
      }
      $homepage = str_ireplace("fhsearch.php\">Index</a>","fhsearch.php\">Search</a>", $homepage);
      $saveFile = file_put_contents($targetIndex,$homepage);
      fclose($homepage);
   }
   
//process _torindex.html if exist
   $targetIndex = $_SERVER['DOCUMENT_ROOT'] . "/fhfiles/_torindex.html";
   if (file_exists($targetIndex)) {
      $homepage = file_get_contents($targetIndex);
      $homepage = str_ireplace("_nameindex.html","/fhsearch.php", $homepage);
      if (stripos($homepage, "/fhfiles/index.html")===false) {
         $homepage = str_ireplace("index.html","/fhfiles/index.html", $homepage);   
      }
      if (stripos($homepage, "/fhfiles/_torindex.html")===false) {
         $homepage = str_ireplace("_torindex.html","/fhfiles/_torindex.html", $homepage);   
      }
      if (stripos($homepage, "/fhfiles/logo.jpg")===false) {
         $homepage = str_ireplace("logo.jpg","/fhfiles/logo.jpg", $$homepage);   
      }
      $homepage = str_ireplace("fhsearch.php\">Index</a>","fhsearch.php\">Search</a>", $homepage);
      $saveFile = file_put_contents($targetIndex,$homepage);
      fclose($homepage);
   }
} else { 
    echo 'Unzipped Process failed'; 
}

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 23 Dec 2020 20:01
by Andy63
Does anyone know the types of HTML files that F.H. can produce for the web?

_contact.html
_nameindex.html
_statistics.html
index.html

famxxx.html
indxxx.html
tocxxx.html

...???

Thanks

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 23 Dec 2020 20:10
by tatewise
That is about it, except that index.html could be any filename as chosen at wizard Step 8: Final Details.

Also, the Map Life Facts plugin can generate mapxxx.html files that integrate with the indxxx.html & famxxx.html files.

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 23 Dec 2020 20:35
by Andy63
tatewise wrote:
23 Dec 2020 20:10
That is about it, except that index.html could be any filename as chosen at wizard Step 8: Final Details.

Also, the Map Life Facts plugin can generate mapxxx.html files that integrate with the indxxx.html & famxxx.html files.
Great, I will install the plugin and look at the html Map Life Facts file.

Thanks,
Andy

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 23 Dec 2020 20:48
by tatewise
Those mapxxx.html files integrate with indi/famxxx.html files with inserted lines such as:

<li><a href='map1.html'>Map of Locations for Anthony Edward Munro Suffix</a></li>
<li><a href='map2.html'>Map of Locations for Julia Amanda Fish</a></li>

in the See also bullet list near the top.

A typical mapxxx.html file is attached but zipped as .html is not allowed.

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 23 Dec 2020 20:58
by Andy63
Concerning Google mapping, I extract the addresses in the famxxx.html or indxxx.html, for example: 316 dalhousie ottawa
and create a new link to replace the address in the html file:

Code: Select all

<a href="https://www.google.ca/maps/place/316 dalhousie ottawa"  target="_blank">316 dalhousie ottawa</a>
https://www.google.ca/maps/place/316 dalhousie ottawa

and Google map will translate as:

Code: Select all

https://www.google.ca/maps/place/316+Dalhousie+St,+Ottawa,+ON+K1N+7E7/@45.4291423,-75.693702,17z....
It works great, more info in the address, better it is. In this case, 316 dalhousie ottawa ontario canada.

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 23 Dec 2020 21:11
by tatewise
Ok, but that is only one item per map.
My map files list all the facts for the person on the left and plots all the places as pins in the map on the right.
Click any fact and it zooms to its pin on the map.
Click any pin and it lists all facts at that location.

Re: WebSite Editor for FH html pages (not a plug-in)

Posted: 23 Dec 2020 21:24
by Andy63
tatewise wrote:
23 Dec 2020 21:11
Ok, but that is only one item per map.
My map files list all the facts for the person on the left and plots all the places as pins in the map on the right.
Click any fact and it zooms to its pin on the map.
Click any pin and it lists all facts at that location.
Yes, it only works per page, only show the address in google map, nothing else. The interaction that the plugin does is quite elaborate. I downloaded the plugin, very interesting, still looking at it.