diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..016f8066 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/tests/ diff --git a/.htaccess b/.htaccess index 92933b52..a3ed8893 100644 --- a/.htaccess +++ b/.htaccess @@ -5,4 +5,25 @@ RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l -RewriteRule ^ index.php [QSA,L] \ No newline at end of file +RewriteRule ^ index.php [QSA,L] + +# # Enable these lines when website is slow because of search engine indexation +# BrowserMatchNoCase "claudebot" bad_bot +# BrowserMatchNoCase "facebookexternalhit/1.1" bad_bot +# BrowserMatchNoCase "Python/3.10 aiohttp/3.9.3" bad_bot +# Order Deny,Allow +# Deny from env=bad_bot + +# # Blocking Bot traffic except search bots +# RewriteEngine On +# RewriteCond %{HTTP_USER_AGENT} ^$ [OR] +# RewriteCond %{HTTP_USER_AGENT} (bot|crawl|robot|facebook|spider) +# RewriteCond %{HTTP_USER_AGENT} !(Bing|Google|msn|MSR|Twitter|Yandex|Slurp|DuckDuck|Baidu|Exa) [NC] +# RewriteRule ^ - [F] +# # END Blocking Bot traffic except search bots + +# Explanation of RewriteCond lines: +# Line 1 stops unidentified bots. +# Line 2 stops bots including text: bot, crawl of robot zit. +# Line 3 enables access to robots including text: Bing, Google, etc. +# Line 4 block all useless bots including an acces denied message. \ No newline at end of file diff --git a/admin/admin.css b/admin/admin.css index 695b96da..74c6c587 100644 --- a/admin/admin.css +++ b/admin/admin.css @@ -1,15 +1,4 @@ /* Basic page styles */ -/* dec. 2023 test */ - -/* -html { - height: 100%; - max-height: 100%; - padding: 0; - margin: 0; - border: 0; -} -*/ body.humo { background-color: white; @@ -17,14 +6,6 @@ body.humo { background-repeat: no-repeat; font: 15px Verdana, tahoma, arial, sans-serif; - - /* - height: 100%; - max-height: 100%; - padding: 0; - margin: 0; - border: 0; - */ } #top_website_name { @@ -232,7 +213,7 @@ div.rtlsddm #sub_2 ul { } /* Order boxes (children) */ - +/* TODO it's possible to use bootstrap layout */ .sortable { width: 750px; user-select: none; diff --git a/admin/admin_print.css b/admin/admin_print.css index 692cb17d..05c793bb 100644 --- a/admin/admin_print.css +++ b/admin/admin_print.css @@ -1,28 +1,8 @@ /* TODO: check these items. Probably remove admin_print file */ -/* -html { - padding: 0; - margin: 0; - border: 0; - overflow: visible; -} -*/ - body { background-color: white; background-image: none; - /* - font-family: Trebuchet MS, Arial, sans-serif; - font-size: 14px; - height: auto; - max-height: auto; - overflow: visible; - padding: 0; - margin: 0; - border: 0; - float: none; - */ } .button { diff --git a/admin/controller/edit_addressController.php b/admin/controller/adminAddressController.php similarity index 58% rename from admin/controller/edit_addressController.php rename to admin/controller/adminAddressController.php index 77f4488e..8a60601b 100644 --- a/admin/controller/edit_addressController.php +++ b/admin/controller/adminAddressController.php @@ -1,21 +1,16 @@ editor_cls = new editor_cls; + $this->editor_cls = new Editor_cls; } public function detail($dbh, $tree_id, $db_functions) { - $editAddressModel = new EditAddressModel($dbh); + $editAddressModel = new AdminAddressModel($dbh); $editAddressModel->set_address_id(); $editAddressModel->update_address($dbh, $tree_id, $db_functions, $this->editor_cls); $editAddress['address_id'] = $editAddressModel->get_address_id(); diff --git a/admin/controller/adminCmsPagesController.php b/admin/controller/adminCmsPagesController.php new file mode 100644 index 00000000..879fa0ce --- /dev/null +++ b/admin/controller/adminCmsPagesController.php @@ -0,0 +1,25 @@ +menu_tab(); + + $CMS_pagesModel->add_change_page($dbh); + + $edit_cms_pages['select_page'] = $CMS_pagesModel->get_select_page(); + + $CMS_pagesModel->update_pages($dbh); + + if ($edit_cms_pages['menu_tab'] === 'pages') { + $edit_cms_pages['pages_in_category'] = $CMS_pagesModel->get_pages_in_category($dbh); + + $get_page = $CMS_pagesModel->get_page($dbh); + $edit_cms_pages = array_merge($edit_cms_pages, $get_page); + } + + return $edit_cms_pages; + } +} diff --git a/admin/controller/adminIndexController.php b/admin/controller/adminIndexController.php new file mode 100644 index 00000000..600e0a93 --- /dev/null +++ b/admin/controller/adminIndexController.php @@ -0,0 +1,44 @@ +get_php_version(); + + $index_array1 = $indexModel->database_settings($database_check); + $index_array2 = $indexModel->get_mysql_version($dbh); + $index = array_merge($index, $index_array1, $index_array2); + + // TODO: move to model. + // *** Check if database and tables are ok *** + $index['install_status'] = true; + + if (!$index['database_check']) { + $index['install_status'] = true; + + $index['db_host'] = 'localhost'; + if (isset($_POST['db_host'])) { + $index['db_host'] = $_POST['db_host']; + } + + $index['db_username'] = 'root'; + if (isset($_POST['db_username'])) { + $index['db_username'] = $_POST['db_username']; + } + + $index['db_password'] = ''; + if (isset($_POST['db_password'])) { + $index['db_password'] = $_POST['db_password']; + } + + $index['db_name'] = 'humo-gen'; + if (isset($_POST['db_name'])) { + $index['db_name'] = $_POST['db_name']; + } + } + + return $index; + } +} diff --git a/admin/controller/edit_repositoryController.php b/admin/controller/adminRepositoryController.php similarity index 58% rename from admin/controller/edit_repositoryController.php rename to admin/controller/adminRepositoryController.php index 7977df72..0f0a2a8d 100644 --- a/admin/controller/edit_repositoryController.php +++ b/admin/controller/adminRepositoryController.php @@ -1,21 +1,16 @@ editor_cls = new editor_cls; + $this->editor_cls = new Editor_cls; } public function detail($dbh, $tree_id, $db_functions) { - $editRepositoryModel = new EditorRepositoryModel($dbh); + $editRepositoryModel = new AdminRepositoryModel($dbh); $editRepositoryModel->set_repo_id(); $editRepositoryModel->update_repository($dbh, $tree_id, $db_functions, $this->editor_cls); $editRepository['repo_id'] = $editRepositoryModel->get_repo_id(); diff --git a/admin/controller/adminSettingsController.php b/admin/controller/adminSettingsController.php new file mode 100644 index 00000000..cb0d7fa9 --- /dev/null +++ b/admin/controller/adminSettingsController.php @@ -0,0 +1,23 @@ +get_menu_tab(); + $settings['time_lang'] = $settingsModel->get_timeline_language($humo_option); + $settingsModel->save_settings($dbh, $db_functions, $humo_option, $settings); + + // *** Use a seperate controller for each tab *** + if ($settings['menu_tab'] == 'settings_homepage') { + $settings_homepageModel = new SettingsHomepageModel($dbh); + $settings_homepageModel -> reset_modules($dbh); + $settings_homepageModel -> save_settings_modules($dbh); + $settings_homepageModel -> order_modules($dbh); + + $settings_homepageModel -> save_settings_favorites($dbh); + } + + return $settings; + } +} diff --git a/admin/controller/edit_sourceController.php b/admin/controller/adminSourceController.php similarity index 59% rename from admin/controller/edit_sourceController.php rename to admin/controller/adminSourceController.php index bdad8ce9..56b2f6fc 100644 --- a/admin/controller/edit_sourceController.php +++ b/admin/controller/adminSourceController.php @@ -1,21 +1,16 @@ editor_cls = new editor_cls; + $this->editor_cls = new Editor_cls; } public function detail($dbh, $tree_id, $db_functions) { - $editSourceModel = new EditSourceModel($dbh); + $editSourceModel = new AdminSourceModel($dbh); $editSourceModel->set_source_id($dbh, $tree_id); $editSourceModel->update_source($dbh, $tree_id, $db_functions, $this->editor_cls); $editSource['source_id'] = $editSourceModel->get_source_id(); diff --git a/admin/controller/adminStatisticsController.php b/admin/controller/adminStatisticsController.php new file mode 100644 index 00000000..a509dda1 --- /dev/null +++ b/admin/controller/adminStatisticsController.php @@ -0,0 +1,15 @@ +get_tab(); + + $data = $statisticsModel->get_data($dbh); + $statistics = array_merge($statistics, $data); + + return $statistics; + } +} diff --git a/admin/controller/backupController.php b/admin/controller/backupController.php new file mode 100644 index 00000000..ed5a020c --- /dev/null +++ b/admin/controller/backupController.php @@ -0,0 +1,14 @@ +process_old_files(); + + $backup['upload_status'] = $backupModel->upload_backup_file(); + + return $backup; + } +} diff --git a/admin/controller/edit_cms_pagesController.php b/admin/controller/edit_cms_pagesController.php deleted file mode 100644 index 96f65430..00000000 --- a/admin/controller/edit_cms_pagesController.php +++ /dev/null @@ -1,29 +0,0 @@ -editor_cls = new editor_cls; - } - */ - - public function detail($dbh) - { - $CMS_pagesModel = new CMS_pagesModel($dbh); - - $cms_pages['menu_tab'] = $CMS_pagesModel->menu_tab(); - - $CMS_pagesModel->add_change_page($dbh); - - $cms_pages['select_page'] = $CMS_pagesModel->get_select_page(); - - $CMS_pagesModel->update_pages($dbh); - - return $cms_pages; - } -} diff --git a/admin/controller/editorController.php b/admin/controller/editorController.php index f2705158..0c4fd338 100644 --- a/admin/controller/editorController.php +++ b/admin/controller/editorController.php @@ -1,30 +1,11 @@ set_tree_id($tree_id); -} - - class EditorController { private $editor_cls; public function __construct() { - $this->editor_cls = new editor_cls; + $this->editor_cls = new Editor_cls; } public function detail($dbh, $tree_id, $tree_prefix, $db_functions, $humo_option) diff --git a/admin/controller/extensionsController.php b/admin/controller/extensionsController.php new file mode 100644 index 00000000..0a2b96b4 --- /dev/null +++ b/admin/controller/extensionsController.php @@ -0,0 +1,21 @@ +get_theme_folders(); + + $extensionsModel->save_settings($db_functions, $humo_option, $language_file, $extensions); + + + // *** Re-read variables after changing them *** + // *** Don't use include_once! Otherwise the old value will be shown *** + include(__DIR__ . "/../../include/settings_global.php"); //variables + $extensions['hide_languages'] = explode(";", $humo_option["hide_languages"]); + $extensions['hide_themes'] = explode(";", $humo_option["hide_themes"]); + + + return $extensions; + } +} diff --git a/admin/controller/gedcom_exportController.php b/admin/controller/gedcomExportController.php similarity index 88% rename from admin/controller/gedcom_exportController.php rename to admin/controller/gedcomExportController.php index 00955688..094f273d 100644 --- a/admin/controller/gedcom_exportController.php +++ b/admin/controller/gedcomExportController.php @@ -1,7 +1,5 @@ db_functions = $db_functions; - } - */ - public function detail($dbh) { $groupsModel = new GroupsModel($dbh); diff --git a/admin/controller/index_adminController.php b/admin/controller/index_adminController.php deleted file mode 100644 index ff639908..00000000 --- a/admin/controller/index_adminController.php +++ /dev/null @@ -1,31 +0,0 @@ -editor_cls = new editor_cls; - } - */ - - public function detail($database_check, $dbh) - { - $indexModel = new IndexModel(); - - $index['php_version'] = $indexModel->get_php_version(); - - $index_array1 = $indexModel->database_settings($database_check); - //$index = array_merge($index, $index_array); - - $index_array2 = $indexModel->get_mysql_version($dbh); - //$index = array_merge($index, $index_array); - - $index = array_merge($index, $index_array1, $index_array2); - - return $index; - } -} diff --git a/admin/controller/installController.php b/admin/controller/installController.php new file mode 100644 index 00000000..a2734044 --- /dev/null +++ b/admin/controller/installController.php @@ -0,0 +1,11 @@ +check_tables($dbh); + + return $install; + } +} diff --git a/admin/controller/language_editorController.php b/admin/controller/languageEditorController.php similarity index 71% rename from admin/controller/language_editorController.php rename to admin/controller/languageEditorController.php index d94c422d..99194b6b 100644 --- a/admin/controller/language_editorController.php +++ b/admin/controller/languageEditorController.php @@ -1,17 +1,6 @@ editor_cls = new editor_cls; - } - */ - public function detail($dbh, $humo_option) { $language_model = new LanguageEditorModel($dbh, $humo_option); diff --git a/admin/controller/logController.php b/admin/controller/logController.php index ff77271b..d9ad6a7e 100644 --- a/admin/controller/logController.php +++ b/admin/controller/logController.php @@ -1,17 +1,6 @@ editor_cls = new editor_cls; - } - */ - public function detail($dbh) { $logModel = new LogModel(); diff --git a/admin/controller/main_adminController.php b/admin/controller/main_adminController.php new file mode 100644 index 00000000..0694c828 --- /dev/null +++ b/admin/controller/main_adminController.php @@ -0,0 +1,11 @@ +get_abc(); + + //return $main_admin; + } +} diff --git a/admin/controller/mapsController.php b/admin/controller/mapsController.php index 7a6fcf36..ea3f06d7 100644 --- a/admin/controller/mapsController.php +++ b/admin/controller/mapsController.php @@ -1,17 +1,6 @@ editor_cls = new editor_cls; - } - */ - public function detail($dbh, $db_functions) { $mapsModel = new MapsModel(); diff --git a/admin/controller/notesController.php b/admin/controller/notesController.php index 348d0454..30b78491 100644 --- a/admin/controller/notesController.php +++ b/admin/controller/notesController.php @@ -1,17 +1,6 @@ editor_cls = new editor_cls; - } - */ - public function detail($dbh) { $notesModel = new NotesModel($dbh); diff --git a/admin/controller/edit_rename_placeController.php b/admin/controller/renamePlaceController.php similarity index 62% rename from admin/controller/edit_rename_placeController.php rename to admin/controller/renamePlaceController.php index 9c676949..7936cc79 100644 --- a/admin/controller/edit_rename_placeController.php +++ b/admin/controller/renamePlaceController.php @@ -1,16 +1,11 @@ editor_cls = new editor_cls; + $this->editor_cls = new Editor_cls; } public function detail($dbh, $tree_id) diff --git a/admin/controller/settings_adminController.php b/admin/controller/settings_adminController.php deleted file mode 100644 index 198d5d75..00000000 --- a/admin/controller/settings_adminController.php +++ /dev/null @@ -1,18 +0,0 @@ -get_menu_tab(); - - $settings['time_lang'] = $settingsModel->get_timeline_language($humo_option); - - $settingsModel->save_settings($dbh, $db_functions, $humo_option, $settings); - - return $settings; - } -} diff --git a/admin/controller/thumbsController.php b/admin/controller/thumbsController.php index e0df27ca..6ed41414 100644 --- a/admin/controller/thumbsController.php +++ b/admin/controller/thumbsController.php @@ -1,6 +1,4 @@ editor_cls = new editor_cls; - } - */ - public function detail($dbh, $tree_id, $db_functions, $selected_language) { $treesModel = new TreesModel($dbh); @@ -28,10 +16,12 @@ public function detail($dbh, $tree_id, $db_functions, $selected_language) if ($trees['menu_tab'] == 'tree_main') { include_once(__DIR__ . "/../../include/show_tree_date.php"); include_once(__DIR__ . "/../../views/partial/select_language.php"); - include(__DIR__ . '/../../languages/' . $trees['language2'] . '/language_data.php'); - //require_once __DIR__ . "/../models/tree_admin.php"; + $tree_adminModel = new TreeAdminModel($dbh); + $trees['count_trees'] = $tree_adminModel->count_trees($dbh); + $trees['collation'] = $tree_adminModel->get_collation($dbh); + $trees['language_path'] = 'index.php?page=tree&tree_id=' . $trees['tree_id'] . '&'; } elseif ($trees['menu_tab'] == 'tree_gedcom') { include_once(__DIR__ . "/../include/gedcom_asciihtml.php"); @@ -46,7 +36,6 @@ public function detail($dbh, $tree_id, $db_functions, $selected_language) // Because of processing very large GEDCOM files. @set_time_limit(4000); - require_once __DIR__ . "/../models/gedcom.php"; $gedcomModel = new GedcomModel($dbh); $trees['step'] = $gedcomModel->get_step(); @@ -57,9 +46,20 @@ public function detail($dbh, $tree_id, $db_functions, $selected_language) $trees['gedcom_directory'] = $gedcomModel->get_gedcom_directory(); } } elseif ($trees['menu_tab'] == 'tree_data') { + $trees['tree_pict_path'] = $treesModel->get_tree_pict_path($dbh, $tree_id); + + // *** Check for default path *** + if (substr($trees['tree_pict_path'], 0, 1) === '|') { + $trees['tree_pict_path'] = substr($trees['tree_pict_path'], 1); + $trees['default_path'] = true; + } else { + $trees['default_path'] = false; + } + //require_once __DIR__ . "/../models/tree_data.php"; + //$tree_dataModel = new TreeDataModel($dbh); + //$trees['count_trees'] = $tree_dataModel->count_trees($dbh); } elseif ($trees['menu_tab'] == 'tree_text') { - require_once __DIR__ . "/../models/tree_text.php"; $tree_textModel = new TreeTextModel($dbh); // *** Select language for texts at page *** @@ -68,7 +68,6 @@ public function detail($dbh, $tree_id, $db_functions, $selected_language) $tree_texts = $tree_textModel->get_tree_texts($dbh, $trees['tree_id'], $trees['language']); $trees = array_merge($trees, $tree_texts); } elseif ($trees['menu_tab'] == 'tree_merge') { - require_once __DIR__ . "/../models/tree_merge.php"; $treeMergeModel = new TreeMergeModel($dbh); $trees['relatives_merge'] = $treeMergeModel->get_relatives_merge($dbh, $trees['tree_id']); $treeMergeModel->update_settings($db_functions); // *** Store and reset tree merge settings *** diff --git a/admin/controller/usersController.php b/admin/controller/usersController.php index a610abc1..61930414 100644 --- a/admin/controller/usersController.php +++ b/admin/controller/usersController.php @@ -1,17 +1,6 @@ editor_cls = new editor_cls; - } - */ - public function detail($dbh) { $usersModel = new UsersModel($dbh); diff --git a/admin/images/play_button.png b/admin/images/play_button.png new file mode 100644 index 00000000..6a21c766 Binary files /dev/null and b/admin/images/play_button.png differ diff --git a/admin/include/drag.php b/admin/include/drag.php index 746f6872..b66eed59 100644 --- a/admin/include/drag.php +++ b/admin/include/drag.php @@ -15,10 +15,9 @@ $drag_kind = safe_text_db($_GET["drag_kind"]); - if ($drag_kind == "children") { + if ($drag_kind == "children" && is_numeric($_GET["family_id"])) { $chldstring = safe_text_db($_GET['chldstring']); - $sql = "UPDATE humo_families SET fam_children='" . $chldstring . "' WHERE fam_id='" . safe_text_db($_GET["family_id"]) . "'"; - $result = $dbh->query($sql); + $result = $dbh->query("UPDATE humo_families SET fam_children='" . $chldstring . "' WHERE fam_id='" . $_GET["family_id"] . "'"); } if ($drag_kind == "media") { @@ -26,8 +25,9 @@ $media_arr = explode(";", $mediastring); $counter = count($media_arr); for ($x = 0; $x < $counter; $x++) { - $sql = "UPDATE humo_events SET event_order='" . ($x + 1) . "' WHERE event_id='" . $media_arr[$x] . "'"; - $result = $dbh->query($sql); + if (is_numeric($media_arr[$x])) { + $result = $dbh->query("UPDATE humo_events SET event_order='" . ($x + 1) . "' WHERE event_id='" . $media_arr[$x] . "'"); + } } } @@ -36,8 +36,20 @@ $media_arr = explode(";", $mediastring); $counter = count($media_arr); for ($x = 0; $x < $counter; $x++) { - $sql = "UPDATE humo_connections SET connect_order='" . ($x + 1) . "' WHERE connect_id='" . $media_arr[$x] . "'"; - $result = $dbh->query($sql); + if (is_numeric($media_arr[$x])) { + $result = $dbh->query("UPDATE humo_connections SET connect_order='" . ($x + 1) . "' WHERE connect_id='" . $media_arr[$x] . "'"); + } + } + } + + if ($drag_kind == "trees") { + $mediastring = safe_text_db($_GET['order']); + $media_arr = explode(";", $mediastring); + $counter = count($media_arr); + for ($x = 0; $x < $counter; $x++) { + if (is_numeric($media_arr[$x])) { + $result = $dbh->query("UPDATE humo_trees SET tree_order='" . ($x + 1) . "' WHERE tree_id='" . $media_arr[$x] . "'"); + } } } } diff --git a/admin/include/editor_event_cls.php b/admin/include/editorEvent.php similarity index 89% rename from admin/include/editor_event_cls.php rename to admin/include/editorEvent.php index 0feba65c..3f633250 100644 --- a/admin/include/editor_event_cls.php +++ b/admin/include/editorEvent.php @@ -1,5 +1,5 @@ event_kind == 'baptism_witness' || $data_listDb->event_kind == 'birth_decl_witness' || $data_listDb->event_kind == 'death_decl_witness' || $data_listDb->event_kind == 'burial_witness' || $data_listDb->event_kind == 'marriage_witness' || $data_listDb->event_kind == 'marriage_witness_rel' - //) { - //if ( - // $data_listDb->event_kind == 'baptism_witness' || $data_listDb->event_connect_kind == 'birth_declaration' || $data_listDb->event_connect_kind == 'death_declaration' || $data_listDb->event_kind == 'burial_witness' || $data_listDb->event_kind == 'marriage_witness' || $data_listDb->event_kind == 'marriage_witness_rel' - //) { if ( $data_listDb->event_kind == 'ASSO' || $data_listDb->event_connect_kind == 'birth_declaration' || $data_listDb->event_connect_kind == 'death_declaration' ) { @@ -1070,96 +1031,12 @@ function myFunction() { } } - $extensions_check = substr($path_prefix . $tree_pict_path3 . $data_listDb->event_event, -3, 3); - if (strtolower($extensions_check) === "pdf") { - echo ''; - } elseif (strtolower($extensions_check) === "doc" || strtolower(substr($path_prefix . $tree_pict_path3 . $data_listDb->event_event, -4, 4)) === "docx") { - echo ''; - } - // *** Show AVI Video file *** - elseif ($extensions_check === "avi") { - echo ''; - } - // *** Show WMV Video file *** - elseif ($extensions_check === "wmv") { - echo ''; - } - // *** Show MPG Video file *** - elseif (strtolower($extensions_check) === "mpg") { - echo ''; - } - // *** Show MP4 Video file *** - elseif (strtolower($extensions_check) === "mp4") { - echo ''; - } - // *** Show MOV Video file *** - elseif (strtolower($extensions_check) === "mov") { - echo ''; - } - // *** Show WMA Audio file *** - elseif (strtolower($extensions_check) === "wma") { - echo ''; - } - // *** Show WAV Audio file *** - elseif (strtolower($extensions_check) === "wav") { - echo ''; - } - // *** Show MP3 Audio file *** - elseif (strtolower($extensions_check) === "mp3") { - echo ''; - } - // *** Show MID Audio file *** - elseif (strtolower($extensions_check) === "mid") { - echo ''; - } - // *** Show RAM Audio file *** - elseif (strtolower($extensions_check) === "ram") { - echo ''; - } - // *** Show RA Audio file *** - elseif (strtolower($extensions_check) === ".ra") { - echo ''; - } else { - $show_image = ''; - - // *** No subdirectory: show picture/ thumbnail *** - $thumb_prefix = ''; - if (file_exists($path_prefix . $tree_pict_path3 . 'thumb_' . $data_listDb->event_event)) { - $thumb_prefix = 'thumb_'; - } - $picture = $path_prefix . $tree_pict_path3 . $thumb_prefix . $data_listDb->event_event; - //$tree_pic_path3 is missing for family picture - // echo $path_prefix .'-'. $tree_pict_path3.'-'.$data_listDb->event_event; - // *** Check if picture is in subdirectory *** - // Example: subdir1_test/xy/2022_02_12 Scheveningen.jpg - if ($thumb_prefix === '') { - $dirname = dirname($data_listDb->event_event); // subdir1_test/xy/2022_02_12 - $basename = basename($data_listDb->event_event); // 2022_02_12 Scheveningen.jpg - if (file_exists($path_prefix . $tree_pict_path3 . $dirname . '/thumb_' . $basename)) { - $thumb_prefix = 'thumb_'; - } - $picture = $path_prefix . $tree_pict_path3 . $dirname . '/' . $thumb_prefix . $basename; - } - - if ($data_listDb->event_event && file_exists($picture)) { - // *** Get size of original picture *** - list($width, $height) = getimagesize($picture); - $size = ' style="width:100px"'; - if ($height > $width) { - $size = ' style="height:80px"'; - } - //$show_image= ''; - $show_image = ''; - } else { - $show_image = ''; - } - //Check line above. If thumb if missing, missing picture is shown... + include_once(__DIR__ . '/../../include/give_media_path.php'); - if (!$data_listDb->event_event) { - $show_image = ''; - } - echo $show_image; - } + // echo '' . + // print_thumbnail($path_prefix . $tree_pict_path3, $data_listDb->event_event) . ''; + echo '' . + print_thumbnail($path_prefix . $tree_pict_path3, $data_listDb->event_event) . ''; ?> @@ -1563,8 +1440,6 @@ function myFunction() { @@ -1587,8 +1462,6 @@ function myFunction() { } ?> @@ -1609,18 +1482,19 @@ function myFunction() { if ($data_listDb->event_text && preg_match('/\R/', $data_listDb->event_text)) { $field_text_selected = $field_text_medium; } + ?> + +
'; +
+ ' . __('Step 2) Compare existing and update files (no installation yet)...') . '
';
+ ?>
+
= __('Step 2) Compare existing and update files (no installation yet)...'); ?>
- if ($_GET['step'] == '3') {
- echo '
' . __('Step 3) Installation of new files...') . '
';
- }
+ ' . __('Step 3) Installation of new files...') . '
';
+ }
- function listFolderFiles($dir, $exclude, $file_array)
- {
- global $existing_dir_files, $existing_dir, $existing_files;
- global $update_dir_files, $update_dir, $update_files;
- $ffs = scandir($dir);
- foreach ($ffs as $ff) {
- if (is_array($exclude) and !in_array($ff, $exclude)) {
- if ($ff != '.' && $ff != '..') {
- // *** Skip all media files in folders ../media/, ../media/cms/ etc.
- if (substr($dir, 0, 8) == '../media' and !is_dir($dir . '/' . $ff) and $ff != 'readme.txt') {
- // skip media files
- }
- // *** Skip all backup files in folder backup_files/
- // ../admin/backup_files/2023_02_11_09_56_humo-genealogy_backup.sql.zip
- elseif (substr($dir, 0, 21) == '../admin/backup_files' and !is_dir($dir . '/' . $ff) and $ff != 'readme.txt') {
- // skip backup files
- } else {
- if ($file_array == 'existing_files') {
- $existing_dir[] = $dir;
- $existing_files[] = $ff;
- $existing_dir_files[] = substr($dir . '/' . $ff, 3);
+ function listFolderFiles($dir, $exclude, $file_array)
+ {
+ global $existing_dir_files, $existing_dir, $existing_files;
+ global $update_dir_files, $update_dir, $update_files;
+ $ffs = scandir($dir);
+ foreach ($ffs as $ff) {
+ if (is_array($exclude) and !in_array($ff, $exclude)) {
+ if ($ff != '.' && $ff != '..') {
+ // *** Skip all media files in folders ../media/, ../media/cms/ etc.
+ if (substr($dir, 0, 8) == '../media' and !is_dir($dir . '/' . $ff) and $ff != 'readme.txt') {
+ // skip media files
+ }
+ // *** Skip all backup files in folder backup_files/
+ // ../admin/backup_files/2023_02_11_09_56_humo-genealogy_backup.sql.zip
+ elseif (substr($dir, 0, 21) == '../admin/backup_files' and !is_dir($dir . '/' . $ff) and $ff != 'readme.txt') {
+ // skip backup files
} else {
- $update_dir[] = $dir;
- $update_files[] = $ff;
- $update_dir_files[] = substr($dir . '/' . $ff, 25);
+ if ($file_array == 'existing_files') {
+ $existing_dir[] = $dir;
+ $existing_files[] = $ff;
+ $existing_dir_files[] = substr($dir . '/' . $ff, 3);
+ } else {
+ $update_dir[] = $dir;
+ $update_files[] = $ff;
+ $update_dir_files[] = substr($dir . '/' . $ff, 25);
+ }
+ if (is_dir($dir . '/' . $ff)) listFolderFiles($dir . '/' . $ff, $exclude, $file_array);
}
- if (is_dir($dir . '/' . $ff)) listFolderFiles($dir . '/' . $ff, $exclude, $file_array);
}
}
}
}
- }
- // *** Find all existing HuMo-genealogy files, skip humo-gen_update.zip, humo-gen_update folder and ip_files folders. ***
- listFolderFiles('..', array('humo-gen_update.zip', 'humo-gen_update', 'ip_files'), 'existing_files');
+ // *** Find all existing HuMo-genealogy files, skip humo-gen_update.zip, humo-gen_update folder and ip_files folders. ***
+ listFolderFiles('..', array('humo-gen_update.zip', 'humo-gen_update', 'ip_files'), 'existing_files');
- // *** Find all update HuMo-genealogy files, a__ is just some random text (skip items)... ***
- listFolderFiles('./update/humo-gen_update', array('a__', 'a__'), 'update_files');
+ // *** Find all update HuMo-genealogy files, a__ is just some random text (skip items)... ***
+ listFolderFiles('./update/humo-gen_update', array('a__', 'a__'), 'update_files');
- echo '
'; + +
+ = $humo_option["version"]; ?> - // *** Check for HuMo-genealogy beta version SAME CODE AS CODE ABOVE *** - $check = ' checked'; - if ($humo_option['update_last_check'] == 'DISABLED') { - $check = ''; - } - echo '- echo '
'; + + + ++ |
pers_gedcomnumber == $fam_db->fam_man) {
$gedcomnumber = $fam_db->fam_woman;
}
- $pers_cal_date = calculate_person($gedcomnumber);
+ $pers_cal_date = calculate_person($db_functions, $gedcomnumber);
// *** Check date of children ***
if ($pers_cal_date == '' && $fam_db->fam_children) {
$children_array = explode(";", $fam_db->fam_children);
- $pers_cal_date = calculate_person($children_array[0]);
+ $pers_cal_date = calculate_person($db_functions, $children_array[0]);
if ($pers_cal_date) {
$pers_cal_date -= 25;
}
@@ -131,14 +126,14 @@ function calculate_person($gedcomnumber)
// *** Check date of father ***
if ($pers_cal_date == '' && $fam_db->fam_man) {
- $pers_cal_date = calculate_person($fam_db->fam_man);
+ $pers_cal_date = calculate_person($db_functions, $fam_db->fam_man);
if ($pers_cal_date) {
$pers_cal_date += 25;
}
}
// *** Check date of mother ***
if ($pers_cal_date == '' && $fam_db->fam_woman) {
- $pers_cal_date = calculate_person($fam_db->fam_woman);
+ $pers_cal_date = calculate_person($db_functions, $fam_db->fam_woman);
if ($pers_cal_date) {
$pers_cal_date += 25;
}
@@ -151,22 +146,15 @@ function calculate_person($gedcomnumber)
$pers_cal_date -= 60;
}
}
-
?>
+
= $person_db->pers_gedcomnumber; ?>
+ = $person_db->pers_firstname; ?> = strtolower(str_replace("_", " ", $person_db->pers_prefix)); ?>= $person_db->pers_lastname; ?> = $pers_cal_date; ?>
+ = $pers_cal_date == '' ? '' . __('No dates') . '' : ''; ?> pers_firstname . ' ' . strtolower(str_replace("_", " ", $person_db->pers_prefix)) . $person_db->pers_lastname; - echo ' ' . $pers_cal_date; - if ($pers_cal_date == '') { - echo '' . __('No dates') . ''; - } - echo ' '; - - $sql = "UPDATE humo_persons SET pers_cal_date='" . $pers_cal_date . "' WHERE pers_tree_id='" . $tree_id . "' AND pers_id='" . $person_db->pers_id . "'"; - $dbh->query($sql); + $dbh->query("UPDATE humo_persons SET pers_cal_date='" . $pers_cal_date . "' WHERE pers_tree_id='" . $tree_id . "' AND pers_id='" . $person_db->pers_id . "'"); } - ?> + ?> = __('Calculation of birth dates is completed. Sometimes more dates will be found if calculation is restarted!'); ?> |
-
-
- = __('Add page'); ?> - -
+ $page_nr++;
+ ?>
+ |
+
+
+
+
+
+ page_menu_id]) {
+ ?>
+
+
+ |
+
+
+ = $cms_pagesDb->page_title ? $cms_pagesDb->page_title : '[' . __('No page title') . ']'; ?>
+
+ |
+ '; - $page_id = $cms_pagesDb->page_id; - $page_text = $cms_pagesDb->page_text; - $page_status = $cms_pagesDb->page_status; - $page_title = $cms_pagesDb->page_title; - $page_menu_id = $cms_pagesDb->page_menu_id; - $page_counter = $cms_pagesDb->page_counter; - $page_edit = 'change'; - } else { - // *** Add new page *** - $page_id = ''; - $page_text = ''; - $page_status = '1'; - $page_title = __('Page title'); - $page_menu_id = ''; - $page_counter = ''; - $page_edit = 'add'; + $previous_page = $cms_pagesDb->page_id; } ?> - - = __('"Hide page in menu" is a special option. These pages can be accessed using a direct link.'); ?> - '; - echo '' . $path_tmp . '/index.php?page=cms_pages&select_page=', $page_id . '&menu=1 '; - // TODO link below shows menu and footer. Use menu=1 option. - if ($humo_option["url_rewrite"] == "j") { - echo ' ' . __('or') . ': ' . $path_tmp . '/cms_pages/' . $page_id . '?menu=1 '; - } + + = __('Add page'); ?> + + +
+ = __('"Hide page in menu" is a special option. These pages can be accessed using a direct link.'); ?> + + = __('This page can be accessed using this link: '); ?> + = $path_tmp; ?>/index.php?page=cms_pages&select_page== $edit_cms_pages['page_id']; ?>&menu=1 + + = __('or'); ?>: = $path_tmp; ?>/cms_pages/= $edit_cms_pages['page_id']; ?>?menu=1 + - ?> - |
-
= __('Database host'); ?> | -+ | localhost | localhost | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
= __('Database username'); ?> | -+ | database_username | root | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
= __('Database password'); ?> | -+ | database_password | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
= __('Database name'); ?> | - + | database_name | humo-gen | @@ -157,7 +126,7 @@= __('At a local PC also install database'); ?> |
- >
+ >
|
@@ -179,24 +148,21 @@
extension=pdo_sqlite.so
= __('General settings'); ?> | -- |
---|---|
= __('Default skin'); ?> | -- | -
= sprintf(__('Standard language %s'), 'HuMo-genealogy'); ?> | -
-
+
+ = sprintf(__('Standard language %s'), 'HuMo-genealogy'); ?>
+
+
+ |
-
= __('Standard language admin menu'); ?> | -
-
+
+ = __('Standard language admin menu'); ?>
+
+
+ |
-
= __('Change favicon icon'); ?> | -- = sprintf(__('Upload favicon.ico file. File size max: %1$d kB.'), '100'); ?> - - - | -
= __('Scripts in <head> section for all pages'); ?> | -
- + + + +
+
+
+ = __('Change favicon icon'); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ = __('Scripts in <head> section for all pages'); ?>
+
+
+
+
+
+
+
= __('Can be used for statistics, counter, etc.'); ?>
- |
-
= __('Text in footer for all pages'); ?> | -
- + + + +
+
+
+ = __('Text in footer for all pages'); ?>
+
+
+
+
+
+
+
= __('Can be used for statistics, counter, etc. It\'s possible to use HTML codes!'); ?>
- |
-
= sprintf(__('Debug %s front pages'), 'HuMo-genealogy'); ?> | -
-
+
+ = sprintf(__('Debug %s front pages'), 'HuMo-genealogy'); ?>
+
+
+
+
= sprintf(__('Only use this option to debug problems in %s.'), 'HuMo-genealogy'); ?>
- |
-
= sprintf(__('Debug %s admin pages'), 'HuMo-genealogy'); ?> | -
-
+
+ = sprintf(__('Debug %s admin pages'), 'HuMo-genealogy'); ?>
+
+
+
+
= sprintf(__('Only use this option to debug problems in %s.'), 'HuMo-genealogy'); ?>
- |
-
= __('Search engine settings'); ?> | -- |
url_rewrite = __('Improve indexing of search engines (like Google)'); ?> |
-
-
+
+
+
+
+
+ = __('Search engine settings'); ?>+
+
+
+
+
+
+ url_rewrite
+
+
+
+ + +
+ = __('ATTENTION: the Apache module "mod_rewrite" has to be installed!'); ?>
+
+
+
+
+ = __('Improve indexing of search engines (like Google)'); ?> URL : http://www.website.nl/humo-gen/index.php?page=family&tree_id=1&id=F12 = __('becomes:'); ?> http://www.website.nl/humo-gen/family/1/F12 - |
-
= __('Stop search engines'); ?> | -
-
+
+ = __('Stop search engines'); ?>
+
+
+ - - |
-
= __('Search engines: Hide family tree (no indexing) Show frontpage and CMS pages'); ?> |
-
-
+
+
+
+
+
+
+ = __('Stop search engines'); ?>
+
+
+ |
-
= __('Contact & registration form settings'); ?> | -- |
= __('Block spam question'); ?> = __('Block spam answer'); ?> |
-
- " size="60"> - " size="60"> - |
-
= __('Mail form: use spam question'); ?> | -
- Hide family tree (no indexing) Show frontpage and CMS pages'); ?> + + + + +
+
+
+
+
+
+ = __('Contact & registration form settings'); ?>+
+
+
+
+
+
+
+ = __('Block spam question'); ?>
+
+
+ " class="form-control form-control-sm">
+
+
+
+
+
+ = __('Block spam answer'); ?>
+
+
+ " class="form-control form-control-sm">
+
+
+
+ = __('Mail form: use spam question'); ?>
+
+
+ |
-
= __('Mail form: use newsletter question'); ?> | -
-
+
+ = __('Mail form: use newsletter question'); ?>
+
+
+
+
= __('Adds the question: "Receive newsletter: yes/ no" to the mailform.'); ?>
- |
-
= __('Visitors can register'); ?> | -
-
+
+ = __('Visitors can register'); ?>
+
+
+
+
= __('Default user-group for new users:'); ?>
-
+
+ |
-
= __('Registration form: e-mail address'); ?> | -" size="40"> = __('Send registration form to this e-mail address.'); ?> | -
= __('Visitor registration: use spam question'); ?> | -
-
+
+
+
+ = __('Registration form: e-mail address'); ?>
+
+
+ " size="40" class="form-control form-control-sm">
+
+
+ = __('Send registration form to this e-mail address.'); ?>
+
+
+
+ = __('Visitor registration: use spam question'); ?>
+
+
+
+ |
-
= __('Password forgotten e-mail address'); ?> | -" size="40" placeholder="no-reply@your-website.com"> = __('To enable password forgotten option: set a sender e-mail address.'); ?> | -
= __('Email Settings'); ?> | -- |
= __('Email Settings'); ?> | -= __('TIP: mail will work without changing these parameters at most hosting providers.'); ?> | -
= __('Mail: sender'); ?> | -" size="32"> - = __('Gmail: [email_address]@gmail.com'); ?>. = __('If filled in: will be used as mail sender.'); ?> - | -
= __('Mail: configuration'); ?> | -
-
+
+
+ = __('Password forgotten e-mail address'); ?>
+
+
+ " size="40" placeholder="no-reply@your-website.com" class="form-control form-control-sm">
+
+
+
+
+
+
+
+ = __('To enable password forgotten option: set a sender e-mail address.'); ?>
+
+
+
+
+
+
+
+ = __('Email Settings'); ?>+
+
+
+
+
+
+ = __('Email Settings'); ?>
+ = __('TIP: mail will work without changing these parameters at most hosting providers.'); ?>
+
+
+
+ = __('Mail: sender'); ?>
+
+
+
+ " size="32" class="form-control form-control-sm">
+
+ = __('Gmail: [email_address]@gmail.com'); ?>
+
+
+
+
+ = __('If filled in: will be used as mail sender.'); ?>
+
+
+
+ = __('Mail: configuration'); ?>
+
+
+
+ + +
+
+
= __('Setting: "auto" = use settings below. Setting: "manual" = change settings in /include/mail.php'); ?> - |
-
= __('Mail: username'); ?> | -" size="32">
+
+
+
+
+
+ = __('Mail: username'); ?>
+
+
+ " size="32" class="form-control form-control-sm">
+
+
= __('Gmail: [email_address]@gmail.com'); ?>
- |
-
= __('Mail: password'); ?> | -" size="32"> | -
= __('SMTP: mail server'); ?> | -" size="32">
+
+
+
+
+
+
+
+ = __('Mail: password'); ?>
+
+
+ " size="32" class="form-control form-control-sm">
+
+
+
+ = __('SMTP: mail server'); ?>
+
+
+ " size="32" class="form-control form-control-sm">
+
+
= __('Gmail: smtp.gmail.com'); ?>
- |
-
= __('SMTP: port'); ?> | -
-
+
+ = __('SMTP: port'); ?>
+
+
+
+
= __('Gmail: 587'); ?>
- |
-
= __('SMTP: authentication'); ?> | -
-
+
+ = __('SMTP: authentication'); ?>
+
+
+
+
= __('Gmail: true'); ?>
- |
-
= __('SMTP: encryption type'); ?> | -
-
+
+ = __('SMTP: encryption type'); ?>
+
+
+
+
= __('Gmail: TLS'); ?>
- |
-
= __('SMTP: debugging'); ?> | -
-
+
+ = __('SMTP: debugging'); ?>
+
+
+ |
-
= __('International settings'); ?> | -- |
= __('Timezone'); ?> | -
-
+
+
+
+
+
+ = __('International settings'); ?>+
+
+
+
+
+ = __('Timezone'); ?>
+
+
+ |
-
= __('Minimum characters in search box'); ?> | -" size="4"> = __('Minimum characters in search boxes (standard value=3. For Chinese set to 1).'); ?> | -
= __('Date display'); ?> | -
-
+
+
+
+ = __('Minimum characters in search box'); ?>
+
+
+ " size="4" class="form-control form-control-sm">
+
+
+ = __('Minimum characters in search boxes (standard value=3. For Chinese set to 1).'); ?>
+
+
+
+ = __('Date display'); ?>
+
+
+ |
-
= __('Order of names in reports'); ?> | -
-
+
+ = __('Order of names in reports'); ?>
+
+
+ |
-
= __('Default timeline file (per language)'); ?> | -
+
+
+ = __('Default timeline file (per language)'); ?>
+
+
-
+
+
+
+ |
-
= __('Settings Main Menu'); ?> | -- |
= __('Website name'); ?> | -" size="40"> | -
= __('Use logo image instead of text'); ?> | -
+
+
+
+ = __('First select language, then select the default timeline for that language.'); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ = __('Settings Main Menu'); ?>+
+
+
+
+
+
+
+ = __('Website name'); ?>
+
+
+ " size="40" class="form-control form-control-sm">
+
+
+
+
+ = __('Use logo image instead of text'); ?>
+
+
+
+
+
+
+
+
+
+
= printf(__('Upload logo image. Recommended size: 165 x 25 px. Picture max: %1$d MB.'), '1'); ?>
-
-
- |
-
= __('Link homepage'); ?> = __('Link description'); ?> |
- " size="40"> = __('(link to this site including http://)'); ?> - " size="40"> - |
-
= __('Link for birthdays RSS'); ?> | -
- " size="40"> = __('(link to this site including http://)'); ?> + + + +
+
+
+ = __('Link homepage'); ?>
+
+
+
+ " size="40" class="form-control form-control-sm">
+
+
+ = __('(link to this site including http://)'); ?>
+
+
+
+
+
+ = __('Link description'); ?>
+
+
+ " size="40" class="form-control form-control-sm">
+
+
+
+
+ = __('Link for birthdays RSS'); ?>
+
+
+ " size="40" class="form-control form-control-sm">
+
+
+ = __('(link to this site including http://)'); ?>
+
+
+
+
= __('This option can be turned on or off in the user groups.'); ?>
- |
-
= __('Settings family page'); ?> | -- |
= __('Number of generations in descendant report'); ?> | -" size="4"> = __('Show number of generation in descendant report (standard value=4).'); ?> | -
= __('Number of persons in search results'); ?> | -" size="4"> = __('Show number of persons in search results (standard value=30).'); ?> | -
= __('Watermark text in PDF file'); ?> | -- |
= __('Watermark text in PDF file'); ?> | -" size="40"> = __('Watermark text (clear to remove watermark)'); ?> | -
= __('Watermark RGB text color'); ?> | -
- R:" size="4">
- G:" size="4">
- B:" size="4">
+
+
+
+
+
+
+
+
+
+
+
+
+ = __('Settings family page'); ?>+
+
+
+
+
+
+
+ = __('Number of generations in descendant report'); ?>
+
+
+ " size="4" class="form-control form-control-sm">
+
+
+ = __('Show number of generation in descendant report (standard value=4).'); ?>
+
+
+
+
+ = __('Number of persons in search results'); ?>
+
+
+ " size="4" class="form-control form-control-sm">
+
+
+ = __('Show number of persons in search results (standard value=30).'); ?>
+
+
+
+
+
+
+
+ = __('Watermark text in PDF file'); ?>+
+
+
+
+
+
+
+ = __('Watermark text in PDF file'); ?>
+
+
+ " size="40" class="form-control form-control-sm">
+
+
+ = __('Watermark text (clear to remove watermark)'); ?>
+
+
+
+ = __('Watermark RGB text color'); ?>
+
+
+ R:
+
+
+ " size="4" class="form-control form-control-sm">
+
+
+ G:
+
+
+ " size="4" class="form-control form-control-sm">
+
+
+ B:
+
+
+ " size="4" class="form-control form-control-sm">
+
+
= __('Default values: R = 224, G = 224, B = 224.'); ?>
- |
-
= __('Display for One Name Study web sites'); ?> | -- |
= __('One Name Study display'); ?>? | -
+
+
+
+
+
+ = __('Display for One Name Study web sites'); ?>+
+
+
+
+
+ = __('One Name Study display'); ?>?
+
+
+
+
= __('Only use this option if you\'re doing a "One Name Study" project.'); ?>
- |
-
= __('Enter the One Name of this site'); ?> | -- " size="40"> - | -
= __('Save settings'); ?> | -- |
= __('Homepage template'); ?> + | = __('Homepage template'); ?>
[= __('Default settings'); ?>] = __("If the left column isn't used, the center column will be made large automatically."); ?> |
@@ -154,6 +15,7 @@
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
= __('Status'); ?> | = __('Position'); ?> | += __('Item'); ?> | @@ -185,9 +47,9 @@ ?> | |||||||||
> + | >
-
- |
+
+ setting_order != '1') { ?>
+
+
+
+
+
setting_order != '1') {
- echo ' ';
- }
- if ($dataDb->setting_order != $count_links) {
- echo ' ';
}
- ?>
+
+ if ($dataDb->setting_order != $count_links) { ?>
+
+
+
+
|
- |
+
+ = __('Columns'); ?>
+ |
'; - - $module_text = ''; - if (isset($lijst[4])) { - $module_text = $lijst[4]; - } - echo ' '; - - echo __('Show text block, HTML codes can be used.'); + ?> + + + + = __('Show text block, HTML codes can be used.'); ?> + setting_id . 'module_option_1" value="' . $header . '" size="30"> '; - $module_text = ''; - if (isset($lijst[4])) { - $module_text = $lijst[4]; - } - echo ' '; - echo __('File name (full path) of the file with own script.'); + ?> + + + + = __('File name (full path) of the file with own script.'); ?> + setting_id . 'module_option_1">'; $qry = $dbh->query("SELECT * FROM humo_cms_pages WHERE page_status!='' ORDER BY page_menu_id, page_order"); - while ($pageDb = $qry->fetch(PDO::FETCH_OBJ)) { - //$select=''; if ($lijst[3]==$pageDb->setting_id.'module_option_1'){ $select=' selected'; } - $selected = ''; - if ($lijst[3] == $pageDb->page_id) { - $selected = ' selected'; - } - echo ''; - } - echo ''; - echo ' ' . __('Show text from CMS system.'); + ?> +
-
+
+
|
| ||||||
- |
- |
+ + |
-
| | ' . __('Database is not yet available.') . ' | '; - } - ?> + +|||||||
= __('Database is not yet available.'); ?> | +
= __('Show list of favourites in homepage'); ?> | @@ -539,42 +264,46 @@|||||
---|---|---|---|---|---|
- + + = __('Link') . ' ' . $teller; ?> + setting_order != '1') { ?> + + + setting_order != '1') { - echo ' '; } + if ($dataDb->setting_order != $count_links) { - echo ' '; - } ?> + + + + | -- | + | + | ||
- | + | + | ' . __('Database is not yet available.') . ' | '; - } - ?> + +||
= __('Database is not yet available.'); ?> | +
= __('Slideshow on the homepage'); ?> | @@ -612,7 +341,7 @@|||||||||
---|---|---|---|---|---|---|---|---|---|
= __('Show slideshow on the homepage'); ?>? |
- = __('Jewish settings'); ?>- -= __('Jewish settings'); ?>+= __('Display settings'); ?>:
@@ -54,5 +54,5 @@
= __('Sitemap'); ?>= __('A sitemap can be used for quick indexing of the family screens by search engines. Add the sitemap link to a search engine (like Google), or add the link in a robots.txt file (in the root folder of your website). Example of robots.txt file, sitemap line:-Sitemap: http://www.yourwebsite.com/humo-gen/sitemap.php'); ?> - = __('Sitemap'); ?> \ No newline at end of file +Sitemap: http://www.yourwebsite.com/humo-gen/sitemap.php'); ?> += __('Sitemap'); ?> \ No newline at end of file diff --git a/admin/views/statistics_date.php b/admin/views/statistics_date.php index 1fcecb42..7f201147 100644 --- a/admin/views/statistics_date.php +++ b/admin/views/statistics_date.php @@ -1,59 +1,26 @@ - - - @@ -63,12 +30,12 @@ "; -year_graphics($month, $year); +echo ' '; +year_graphics($statistics['month'], $statistics['year']); diff --git a/admin/views/statistics_general.php b/admin/views/statistics_general.php index 1a0f6027..76cb680a 100644 --- a/admin/views/statistics_general.php +++ b/admin/views/statistics_general.php @@ -1,22 +1,9 @@ query("SELECT *, count(humo_stat_date.stat_easy_id) as count_lines -// FROM humo_stat_date LEFT JOIN humo_trees -// ON humo_trees.tree_id=humo_stat_date.stat_tree_id -// GROUP BY humo_stat_date.stat_tree_id -// ORDER BY tree_order desc"); - -$family_qry = $dbh->query(" -SELECT * FROM humo_trees as humo_trees2 -RIGHT JOIN -( - SELECT stat_tree_id, count(humo_stat_date.stat_easy_id) as count_lines FROM humo_stat_date - GROUP BY stat_tree_id -) as humo_stat_date2 -ON humo_trees2.tree_id=humo_stat_date2.stat_tree_id -ORDER BY tree_order desc -"); - +$family_qry = $dbh->query("SELECT * FROM humo_trees as humo_trees2 RIGHT JOIN +( SELECT stat_tree_id, count(humo_stat_date.stat_easy_id) as count_lines FROM humo_stat_date GROUP BY stat_tree_id ) + as humo_stat_date2 ON humo_trees2.tree_id=humo_stat_date2.stat_tree_id ORDER BY tree_order desc"); ?> + = __('Status statistics table'); ?>
@@ -37,12 +24,14 @@
$tree_id = $familyDb->tree_id;
// *** Show family tree name ***
$treetext = show_tree_text($familyDb->tree_id, $selected_language);
- echo ' ' . $treetext['name'] . ' | ';
- } else {
- echo '' . __('FAMILY TREE ERASED') . ' | ';
- }
- echo '' . $familyDb->count_lines . ' | ';
+ ?>
+ = $treetext['name']; ?> |
+
+ = __('FAMILY TREE ERASED'); ?> |
+
+ = $familyDb->count_lines; ?> |
+ tree_id) {
@@ -52,16 +41,13 @@
// WHERE humo_trees.tree_id=".$familyDb->tree_id."
// GROUP BY stat_ip_address
// ");
- $stat = $dbh->query("SELECT stat_ip_address
- FROM humo_stat_date LEFT JOIN humo_trees
- ON humo_trees.tree_id=humo_stat_date.stat_tree_id
- WHERE humo_trees.tree_id=" . $familyDb->tree_id . "
- GROUP BY stat_ip_address
- ");
+ $stat = $dbh->query("SELECT stat_ip_address FROM humo_stat_date LEFT JOIN humo_trees
+ ON humo_trees.tree_id=humo_stat_date.stat_tree_id WHERE humo_trees.tree_id=" . $familyDb->tree_id . "
+ GROUP BY stat_ip_address");
$count_visitors = $stat->rowCount();
}
- echo '' . $count_visitors . ' | ';
?>
+ = $count_visitors; ?> |
|
ℹ️ = __('If You create or change media path for any of your trees You must reenable, redisable this option.'); ?>
+= __('Order'); ?> | -= __('Name of family tree'); ?> | -= __('Family tree data'); ?> | -= __('Remove'); ?> | -
---|---|---|---|
- |
+
|
- - | - |
- = $dataDb->tree_order < 10 ? '0' : ''; ?>= $dataDb->tree_order; ?> - tree_order != '1') { ?> - - - - tree_order != $count_lines) { - ?> - - - - - | - -- tree_id, $trees['language']); - if ($dataDb->tree_prefix == 'EMPTY') { - ?> - * = __('EMPTY LINE'); ?> * - - - - = $treetext['name']; ?> - - | - -- tree_prefix != 'EMPTY') { ?> - - - - tree_prefix == 'EMPTY') { - // *** Empty line, don't show any text *** - } elseif ($dataDb->tree_persons > 0) { - ?> - = __('OK'); ?> - - = show_tree_date($dataDb->tree_date); ?>: = $dataDb->tree_persons; ?> = __('persons'); ?>, = $dataDb->tree_families; ?> = __('families'); ?> - - = __('This tree does not yet contain any data or has not been imported properly!'); ?> - - | - -- 1 || $dataDb->tree_prefix == 'EMPTY') { - ?> - - - - - | -
tree_id] + 1;
- echo __('Nr. ') . $num . __(' of ') . count($_SESSION['dupl_arr_' . $data2Db->tree_id]);
+ $num = $_SESSION['present_compare_' . $trees['tree_id']] + 1;
+ echo __('Nr. ') . $num . __(' of ') . count($_SESSION['dupl_arr_' . $trees['tree_id']]);
} elseif ($mode = 'relatives') {
$rl = explode(';', $trees['relatives_merge']);
$rls = count($rl) - 1;
@@ -1494,7 +1493,7 @@ function show_events($left_ged, $right_ged)
//*********************************************************************************************
function put_event($this_event, $name_event, $l_ev, $r_ev)
{
- global $color, $dbh, $data2Db, $language;
+ global $color, $dbh, $trees, $language;
if ($r_ev != '') {
// if right has no event all stays as it is
@@ -1508,13 +1507,14 @@ function put_event($this_event, $name_event, $l_ev, $r_ev)
foreach ($l_ev as $key => $value) {
if (substr($value, 0, 2) === '@I') { // this is a person GEDCOM number, not plain text -> show the name
$value = str_replace('@', '', $value);
- $result = $dbh->query("SELECT pers_lastname, pers_firstname FROM humo_persons WHERE pers_tree_id='" . $data2Db->tree_id . "' AND pers_gedcomnumber = '" . $value . "'");
+ $result = $dbh->query("SELECT pers_lastname, pers_firstname FROM humo_persons WHERE pers_tree_id='" . $trees['tree_id'] . "' AND pers_gedcomnumber = '" . $value . "'");
$resultDb = $result->fetch(PDO::FETCH_OBJ);
$value = $resultDb->pers_firstname . ' ' . $resultDb->pers_lastname;
}
if ($this_event == 'picture') { // show link to pic
- $datasql = $dbh->query("SELECT * FROM humo_trees WHERE tree_id='" . $data2Db->tree_id . "'");
+ $datasql = $dbh->query("SELECT * FROM humo_trees WHERE tree_id='" . $trees['tree_id'] . "'");
$dataDb = $datasql->fetch(PDO::FETCH_OBJ);
+ // TODO check if this works using a default picture path.
$tree_pict_path = $dataDb->tree_pict_path;
$dir = '../' . $tree_pict_path;
$value = $value . ' [' . __('Show') . ']';
@@ -1536,12 +1536,12 @@ function put_event($this_event, $name_event, $l_ev, $r_ev)
foreach ($r_ev as $key => $value) {
if (substr($value, 0, 2) === '@I') { // this is a person gedcom number, not plain text
$value = str_replace('@', '', $value);
- $result = $dbh->query("SELECT pers_lastname, pers_firstname FROM humo_persons WHERE pers_tree_id='" . $data2Db->tree_id . "' AND pers_gedcomnumber = '" . $value . "'");
+ $result = $dbh->query("SELECT pers_lastname, pers_firstname FROM humo_persons WHERE pers_tree_id='" . $trees['tree_id'] . "' AND pers_gedcomnumber = '" . $value . "'");
$resultDb = $result->fetch(PDO::FETCH_OBJ);
$value = $resultDb->pers_firstname . ' ' . $resultDb->pers_lastname;
}
if ($this_event == 'picture') {
- $datasql = $dbh->query("SELECT * FROM humo_trees WHERE tree_id='" . $data2Db->tree_id . "'");
+ $datasql = $dbh->query("SELECT * FROM humo_trees WHERE tree_id='" . $trees['tree_id'] . "'");
$dataDb = $datasql->fetch(PDO::FETCH_OBJ);
$tree_pict_path = $dataDb->tree_pict_path;
$dir = '../' . $tree_pict_path;
@@ -1835,7 +1835,7 @@ function merge_them($left, $right, $mode)
if (strstr($trees['relatives_merge'], $string1) === false && strstr($trees['relatives_merge'], $string2) === false) {
$trees['relatives_merge'] .= $string1;
}
- $db_functions->update_settings('rel_merge_' . $data2Db->tree_id, $trees['relatives_merge']);
+ $db_functions->update_settings('rel_merge_' . $trees['tree_id'], $trees['relatives_merge']);
}
}
}
@@ -2110,7 +2110,7 @@ function merge_them($left, $right, $mode)
if (strstr($trees['relatives_merge'], $string1) === false && strstr($trees['relatives_merge'], $string2) === false) {
$trees['relatives_merge'] .= $string1;
}
- $db_functions->update_settings('rel_merge_' . $data2Db->tree_id, $trees['relatives_merge']);
+ $db_functions->update_settings('rel_merge_' . $trees['tree_id'], $trees['relatives_merge']);
}
}
}
@@ -2179,7 +2179,7 @@ function merge_them($left, $right, $mode)
if (strstr($trees['relatives_merge'], $string1) === false && strstr($trees['relatives_merge'], $string2) === false) {
$trees['relatives_merge'] .= $string1;
}
- $db_functions->update_settings('rel_merge_' . $data2Db->tree_id, $trees['relatives_merge']);
+ $db_functions->update_settings('rel_merge_' . $trees['tree_id'], $trees['relatives_merge']);
}
}
}
@@ -2248,7 +2248,7 @@ function merge_them($left, $right, $mode)
$dbh->query("UPDATE humo_families SET fam_woman = '" . $par2Db->fam_woman . "'
WHERE fam_tree_id='" . $trees['tree_id'] . "' AND fam_gedcomnumber ='" . $result1Db->pers_famc . "'");
}
- $db_functions->update_settings('rel_merge_' . $data2Db->tree_id, $trees['relatives_merge']);
+ $db_functions->update_settings('rel_merge_' . $trees['tree_id'], $trees['relatives_merge']);
}
if (!$result1Db->pers_famc) {
// give left the famc of right
@@ -2545,16 +2545,16 @@ function merge_them($left, $right, $mode)
}
}
$trees['relatives_merge'] = substr($new_rel_string, 0, -1); // take off last ;
- $db_functions->update_settings('rel_merge_' . $data2Db->tree_id, $trees['relatives_merge']);
+ $db_functions->update_settings('rel_merge_' . $trees['tree_id'], $trees['relatives_merge']);
}
- if (isset($_SESSION['dupl_arr_' . $data2Db->tree_id])) { //remove this pair from the dupl_arr array
+ if (isset($_SESSION['dupl_arr_' . $trees['tree_id']])) { //remove this pair from the dupl_arr array
$found1 = $result1Db->pers_id . ';' . $result2Db->pers_id;
$found2 = $result2Db->pers_id . ';' . $result1Db->pers_id;
- for ($z = 0; $z < count($_SESSION['dupl_arr_' . $data2Db->tree_id]); $z++) {
- if ($_SESSION['dupl_arr_' . $data2Db->tree_id][$z] == $found1 or $_SESSION['dupl_arr_' . $data2Db->tree_id][$z] == $found2) {
+ for ($z = 0; $z < count($_SESSION['dupl_arr_' . $trees['tree_id']]); $z++) {
+ if ($_SESSION['dupl_arr_' . $trees['tree_id']][$z] == $found1 or $_SESSION['dupl_arr_' . $trees['tree_id']][$z] == $found2) {
//unset($_SESSION['dupl_arr'][$z]) ;
- array_splice($_SESSION['dupl_arr_' . $data2Db->tree_id], $z, 1);
+ array_splice($_SESSION['dupl_arr_' . $trees['tree_id']], $z, 1);
}
}
}
diff --git a/app/controller/addressController.php b/app/controller/addressController.php
index f93e8c3e..a3ea8e67 100644
--- a/app/controller/addressController.php
+++ b/app/controller/addressController.php
@@ -1,10 +1,4 @@
$picture_presentation,
"title" => __('Ancestor report')
);
-
+
return $data;
}
}
diff --git a/app/controller/ancestor_sheetController.php b/app/controller/ancestorSheetController.php
similarity index 90%
rename from app/controller/ancestor_sheetController.php
rename to app/controller/ancestorSheetController.php
index 93bdcf28..e6b6880f 100644
--- a/app/controller/ancestor_sheetController.php
+++ b/app/controller/ancestorSheetController.php
@@ -1,7 +1,5 @@
$ancestor_header,
"title" => __('Ancestor sheet')
);
-
+
return array_merge($data, $get_ancestors);
}
}
diff --git a/app/controller/anniversaryController.php b/app/controller/anniversaryController.php
index 5b1af3a5..70a103cc 100644
--- a/app/controller/anniversaryController.php
+++ b/app/controller/anniversaryController.php
@@ -1,21 +1,6 @@
db_functions = $db_functions;
- $this->user = $user;
- }
- */
-
public function anniversary()
{
$anniversaryModel = new AnniversaryModel();
diff --git a/app/controller/Controller.php b/app/controller/baseController.php
similarity index 84%
rename from app/controller/Controller.php
rename to app/controller/baseController.php
index 42dfc4b5..ae225552 100644
--- a/app/controller/Controller.php
+++ b/app/controller/baseController.php
@@ -1,10 +1,5 @@
dbh);
+ $CMS_pagesModel = new CmsPagesModel($this->dbh);
$authorised = $CMS_pagesModel->getCMS_pagesAuthorised($this->user);
$pages = $CMS_pagesModel->getPages($this->dbh);
diff --git a/app/controller/descendant_chartController.php b/app/controller/descendantChartController.php
similarity index 91%
rename from app/controller/descendant_chartController.php
rename to app/controller/descendantChartController.php
index 8ad7ff99..296f5dd5 100644
--- a/app/controller/descendant_chartController.php
+++ b/app/controller/descendantChartController.php
@@ -1,17 +1,6 @@
db_functions = $db_functions;
- // $this->user = $user;
- //}
-
public function getFamily($dbh, $tree_id)
{
$descendantModel = new DescendantModel($dbh);
diff --git a/app/controller/familyController.php b/app/controller/familyController.php
index fe9c4962..75e50189 100644
--- a/app/controller/familyController.php
+++ b/app/controller/familyController.php
@@ -1,16 +1,6 @@
db_functions = $db_functions;
- // $this->user = $user;
- //}
-
public function getFamily($dbh, $tree_id)
{
$familyModel = new FamilyModel($dbh);
@@ -26,9 +16,6 @@ public function getFamily($dbh, $tree_id)
$descendant_report = $familyModel->getDescendantReport();
$descendant_header = $familyModel->getDescendantHeader('Descendant report', $tree_id, $family_id, $main_person);
- //TEST
- //$familyModel->sayHello();
-
$data = array(
"family_id" => $family_id,
"main_person" => $main_person,
diff --git a/app/controller/fanchartController.php b/app/controller/fanchartController.php
index d08b19dd..662f6178 100644
--- a/app/controller/fanchartController.php
+++ b/app/controller/fanchartController.php
@@ -1,20 +1,6 @@
db_functions = $db_functions;
- }
- */
-
public function detail($dbh, $tree_id)
{
$get_fanchartModel = new FanchartModel($dbh);
diff --git a/app/controller/hourglassController.php b/app/controller/hourglassController.php
index 2801a65b..c7b734c3 100644
--- a/app/controller/hourglassController.php
+++ b/app/controller/hourglassController.php
@@ -1,17 +1,6 @@
db_functions = $db_functions;
- //}
-
public function getHourglass($dbh, $tree_id)
{
$descendantModel = new DescendantModel($dbh);
diff --git a/app/controller/indexController.php b/app/controller/indexController.php
new file mode 100644
index 00000000..03d8958c
--- /dev/null
+++ b/app/controller/indexController.php
@@ -0,0 +1,58 @@
+check_visitor($index['visitor_ip'], 'partial')) {
+ echo 'Access to website is blocked.';
+ exit;
+ }
+
+ timezone();
+ // *** TIMEZONE TEST ***
+ //echo date("Y-m-d H:i");
+
+ // *** Check if visitor is a bot or crawler ***
+ $index['bot_visit'] = preg_match('/bot|spider|crawler|curl|Yahoo|Google|^$/i', $_SERVER['HTTP_USER_AGENT']);
+ // *** Line for bot test! ***
+ //$index['bot_visit'] = true;
+
+ // *** Get ordered list of languages ***
+ $language_cls = new LanguageCls;
+ $index['language_file'] = $language_cls->get_languages();
+
+ // *** Language processing after header("..") lines. ***
+ include_once(__DIR__ . "/../../languages/language.php");
+ $index['language'] = $language; // $language = array.
+ $index['selected_language'] = $selected_language;
+
+ $login = $indexModel->login($dbh, $index['db_functions'], $index['visitor_ip']);
+ $index = array_merge($index, $login);
+
+ $ltr_rtl = $indexModel->process_ltr_rtl($index['language']);
+ $index = array_merge($index, $ltr_rtl);
+
+ $route = $indexModel->get_route($humo_option);
+ $index = array_merge($index, $route);
+
+ $family_tree = $indexModel->get_family_tree($dbh, $index['db_functions'], $user); // Get tree_id, tree_prefix.
+ $index = array_merge($index, $family_tree);
+
+ return $index;
+ }
+}
diff --git a/app/controller/latestChangesController.php b/app/controller/latestChangesController.php
new file mode 100644
index 00000000..f9031e36
--- /dev/null
+++ b/app/controller/latestChangesController.php
@@ -0,0 +1,11 @@
+listChanges($dbh, $tree_id);
+
+ return $listchanges;
+ }
+}
diff --git a/app/controller/latest_changesController.php b/app/controller/latest_changesController.php
deleted file mode 100644
index 7d35b3b7..00000000
--- a/app/controller/latest_changesController.php
+++ /dev/null
@@ -1,23 +0,0 @@
-dbh = $dbh;
- }
-
- public function list($dbh, $tree_id)
- {
- $latest_changesModel = new latest_changesModel($dbh);
- $listchanges = $latest_changesModel->listChanges($dbh, $tree_id);
- return array(
- "listchanges" => $listchanges,
- "title" => __('Latest changes')
- );
- }
-}
diff --git a/app/controller/listController.php b/app/controller/listController.php
index 03314b75..8cfdfcf3 100644
--- a/app/controller/listController.php
+++ b/app/controller/listController.php
@@ -1,23 +1,6 @@
db_functions = $db_functions;
- //$this->user = $user;
- }
- */
-
public function list_names($dbh, $tree_id, $user, $humo_option)
{
$listModel = new ListModel();
diff --git a/app/controller/list_namesController.php b/app/controller/listNamesController.php
similarity index 54%
rename from app/controller/list_namesController.php
rename to app/controller/listNamesController.php
index b4599f2c..92e78aad 100644
--- a/app/controller/list_namesController.php
+++ b/app/controller/listNamesController.php
@@ -1,22 +1,9 @@
db_functions = $db_functions;
- //$this->user = $user;
- }
- */
-
public function list_names($dbh, $tree_id, $user)
{
- $list_namesModel = new list_namesModel();
+ $list_namesModel = new listNamesModel();
$get_alphabet_array = $list_namesModel->getAlphabetArray($dbh, $tree_id, $user);
$get_max_cols = $list_namesModel->getMaxCols();
diff --git a/app/controller/list_places_familiesController.php b/app/controller/listPlacesFamiliesController.php
similarity index 77%
rename from app/controller/list_places_familiesController.php
rename to app/controller/listPlacesFamiliesController.php
index ad229dc3..d1f64782 100644
--- a/app/controller/list_places_familiesController.php
+++ b/app/controller/listPlacesFamiliesController.php
@@ -1,11 +1,4 @@
db_functions = $db_functions;
- $this->user = $user;
- }
- */
-
public function detail($humo_option, $dbh, $tree_id, $tree_prefix_quoted)
{
$mapsModel = new MapsModel();
diff --git a/app/controller/outline_reportController.php b/app/controller/outlineReportController.php
similarity index 87%
rename from app/controller/outline_reportController.php
rename to app/controller/outlineReportController.php
index c85e21f6..95295819 100644
--- a/app/controller/outline_reportController.php
+++ b/app/controller/outlineReportController.php
@@ -1,17 +1,6 @@
db_functions = $db_functions;
- // $this->user = $user;
- //}
-
public function getOutlineReport($dbh, $tree_id, $humo_option)
{
$OutlineReportModel = new OutlineReportModel($dbh);
diff --git a/app/controller/photoalbumController.php b/app/controller/photoalbumController.php
index 595dd3a9..fa6b9508 100644
--- a/app/controller/photoalbumController.php
+++ b/app/controller/photoalbumController.php
@@ -1,28 +1,22 @@
db_functions = $db_functions;
- }
- */
-
- public function detail($dbh)
+ public function detail($dbh, $tree_id, $db_functions)
{
$photoalbumModel = new PhotoalbumModel($dbh);
$photoalbum['show_pictures'] = $photoalbumModel->get_show_pictures();
$photoalbum['search_media'] = $photoalbumModel->get_search_media();
+ $photoalbum['show_categories'] = false;
+
+ $categories = $photoalbumModel->get_categories($dbh);
+ $photoalbum = array_merge($photoalbum, $categories);
+
+ $photoalbum['chosen_tab'] = $photoalbumModel->get_chosen_tab($photoalbum['category']);
+
+ $get_media_files = $photoalbumModel->get_media_files($dbh, $tree_id, $db_functions, $photoalbum['chosen_tab'], $photoalbum['search_media'], $photoalbum['category']);
+ $photoalbum = array_merge($photoalbum, $get_media_files);
+
return $photoalbum;
}
}
diff --git a/app/controller/registerController.php b/app/controller/registerController.php
index 28ca1e52..691f1f4d 100644
--- a/app/controller/registerController.php
+++ b/app/controller/registerController.php
@@ -1,6 +1,4 @@
db_functions = $db_functions;
- $this->user = $user;
- }
- */
-
public function getRelations($db_functions, $person_cls)
{
$RelationsModel = new RelationsModel();
diff --git a/app/controller/reset_passwordController.php b/app/controller/resetPasswordController.php
similarity index 72%
rename from app/controller/reset_passwordController.php
rename to app/controller/resetPasswordController.php
index 8e1f360a..d2b2e3e8 100644
--- a/app/controller/reset_passwordController.php
+++ b/app/controller/resetPasswordController.php
@@ -1,21 +1,9 @@
db_functions = $db_functions;
- $this->user = $user;
- }
- */
-
public function detail($dbh, $humo_option)
{
- $resetpasswordModel = new ResetpasswordModel();
+ $resetpasswordModel = new ResetPasswordModel();
$resetpassword['activation_key'] = $resetpasswordModel->get_activation_key();
$resetpassword['userid'] = $resetpasswordModel->get_userid();
diff --git a/app/controller/sourceController.php b/app/controller/sourceController.php
index aab9434e..df218b09 100644
--- a/app/controller/sourceController.php
+++ b/app/controller/sourceController.php
@@ -1,14 +1,5 @@
db_functions = $db_functions;
- $this->user = $user;
- }
- */
-
public function detail()
{
$statisticsModel = new StatisticsModel();
diff --git a/app/controller/timelineController.php b/app/controller/timelineController.php
index 60b62b86..bfb489db 100644
--- a/app/controller/timelineController.php
+++ b/app/controller/timelineController.php
@@ -1,21 +1,6 @@
db_functions = $db_functions;
- $this->user = $user;
- }
- */
-
public function getTimeline($db_functions, $id, $user, $dirmark1)
{
$TimelineModel = new TimelineModel();
diff --git a/app/controller/treeIndexController.php b/app/controller/treeIndexController.php
new file mode 100644
index 00000000..9881f621
--- /dev/null
+++ b/app/controller/treeIndexController.php
@@ -0,0 +1,10 @@
+show_tree_index();
+ return $item_array;
+ }
+}
diff --git a/app/controller/tree_indexController.php b/app/controller/tree_indexController.php
deleted file mode 100644
index 60e687d5..00000000
--- a/app/controller/tree_indexController.php
+++ /dev/null
@@ -1,21 +0,0 @@
-db_functions = $db_functions;
- }
- */
-
- public function get_items($dbh)
- {
- $mainindex = new Mainindex_cls($dbh);
- $item_array = $mainindex->show_tree_index();
- return $item_array;
- }
-}
diff --git a/app/controller/user_settingsController.php b/app/controller/userSettingsController.php
similarity index 61%
rename from app/controller/user_settingsController.php
rename to app/controller/userSettingsController.php
index 04113f99..1ad4faf0 100644
--- a/app/controller/user_settingsController.php
+++ b/app/controller/userSettingsController.php
@@ -1,22 +1,6 @@
db_functions = $db_functions;
- $this->user = $user;
- }
- */
-
public function user_settings($dbh, $dataDb, $humo_option, $user)
{
$user_settingsModel = new UserSettingsModel();
diff --git a/app/model/address.php b/app/model/addressModel.php
similarity index 98%
rename from app/model/address.php
rename to app/model/addressModel.php
index 9b08de40..d8b3c336 100644
--- a/app/model/address.php
+++ b/app/model/addressModel.php
@@ -50,7 +50,7 @@ public function getAddressSources($id)
public function getAddressConnectedPersons($id)
{
$text = '';
- $person_cls = new person_cls;
+ $person_cls = new PersonCls;
// *** Search address in connections table ***
//$event_qry = $db_functions->get_connections('person_address', $_GET['gedcomnumber']);
$event_qry = $this->db_functions->get_connections('person_address', $_GET['id']);
diff --git a/app/model/addresses.php b/app/model/addressesModel.php
similarity index 100%
rename from app/model/addresses.php
rename to app/model/addressesModel.php
diff --git a/app/model/ancestor.php b/app/model/ancestorModel.php
similarity index 88%
rename from app/model/ancestor.php
rename to app/model/ancestorModel.php
index 8c9b5fb3..7e2352e4 100644
--- a/app/model/ancestor.php
+++ b/app/model/ancestorModel.php
@@ -6,34 +6,8 @@
// *** This model is used by multiple ancestor reports (report/ chart/ sheet) ***
-include_once(__DIR__ . '/../../include/language_date.php');
-include_once(__DIR__ . '/../../include/language_event.php');
-include_once(__DIR__ . '/../../include/calculate_age_cls.php');
-include_once(__DIR__ . '/../../include/person_cls.php');
-include_once(__DIR__ . '/../../include/witness.php');
-// Needed for marriage:
-include_once(__DIR__ . '/../../include/process_text.php');
-include_once(__DIR__ . '/../../include/date_place.php');
-include_once(__DIR__ . '/../../include/marriage_cls.php');
-include_once(__DIR__ . '/../../include/show_sources.php');
-include_once(__DIR__ . '/../../include/show_addresses.php');
-include_once(__DIR__ . '/../../include/show_picture.php');
-include_once(__DIR__ . '/../../include/show_quality.php');
-
-// TODO move to controller?
-include_once(__DIR__ . '/family.php');
-
class AncestorModel extends FamilyModel
{
- /*
- private $Connection;
-
- public function __construct($Connection)
- {
- $this->Connection = $Connection;
- }
- */
-
//TODO check the $_GET. Normally main_person is used. ID is used for family number.
public function getMainPerson()
{
diff --git a/app/model/anniversary.php b/app/model/anniversaryModel.php
similarity index 95%
rename from app/model/anniversary.php
rename to app/model/anniversaryModel.php
index e55fc52b..5a7cebfb 100644
--- a/app/model/anniversary.php
+++ b/app/model/anniversaryModel.php
@@ -1,15 +1,6 @@
db_functions = $db_functions;
- }
- */
-
public function getMonth()
{
// *** Month to show ***
diff --git a/app/model/cms_pages.php b/app/model/cmsPagesModel.php
similarity index 99%
rename from app/model/cms_pages.php
rename to app/model/cmsPagesModel.php
index e91529b5..d59b0e3c 100644
--- a/app/model/cms_pages.php
+++ b/app/model/cmsPagesModel.php
@@ -1,5 +1,5 @@
dbh = $dbh;
- }
- */
-
public function getDNA()
{
$dna = "none"; // DNA setting
@@ -179,7 +170,7 @@ public function getBasepersongednr($dna)
public function getBasePerson($db_functions, $main_person)
{
@$dnaDb = $db_functions->get_person($main_person);
- $dnapers_cls = new person_cls;
+ $dnapers_cls = new PersonCls;
$dnaname = $dnapers_cls->person_name($dnaDb);
$base_person["name"] = $dnaname["standard_name"]; // need these 4 in report_descendant
$base_person["sexe"] = $dnaDb->pers_sexe;
@@ -219,7 +210,7 @@ function Prepare_genarray($db_functions, $data, $user)
@$dnaDb = $db_functions->get_person($data["main_person"]);
/*
- $dnapers_cls = new person_cls;
+ $dnapers_cls = new PersonCls;
$dnaname = $dnapers_cls->person_name($dnaDb);
$base_person_name = $dnaname["standard_name"]; // need these 4 in report_descendant
$base_person_sexe = $dnaDb->pers_sexe;
@@ -358,14 +349,14 @@ function Prepare_genarray($db_functions, $data, $user)
}
@$parent1Db = $db_functions->get_person($parent1);
// *** Proces parent1 using a class ***
- $parent1_cls = new person_cls($parent1Db);
+ $parent1_cls = new PersonCls($parent1Db);
@$parent2Db = $db_functions->get_person($parent2);
// *** Proces parent2 using a class ***
- $parent2_cls = new person_cls($parent2Db);
+ $parent2_cls = new PersonCls($parent2Db);
// *** Proces marriage using a class ***
- $marriage_cls = new marriage_cls($familyDb, $parent1_cls->privacy, $parent2_cls->privacy);
+ $marriage_cls = new MarriageCls($familyDb, $parent1_cls->privacy, $parent2_cls->privacy);
$family_privacy = $marriage_cls->privacy;
@@ -490,7 +481,7 @@ function Prepare_genarray($db_functions, $data, $user)
foreach ($child_array as $i => $value) {
@$childDb = $db_functions->get_person($child_array[$i]);
// *** Use person class ***
- $child_cls = new person_cls($childDb);
+ $child_cls = new PersonCls($childDb);
$chdn_in_gen = $nrchldingen + $childnr;
$place = $lst_in_array + $chdn_in_gen;
diff --git a/app/model/family.php b/app/model/familyModel.php
similarity index 95%
rename from app/model/family.php
rename to app/model/familyModel.php
index 04ab42ed..5bbf3bcb 100644
--- a/app/model/family.php
+++ b/app/model/familyModel.php
@@ -8,41 +8,16 @@
include_once(__DIR__ . '/../../include/language_event.php');
include_once(__DIR__ . '/../../include/date_place.php');
include_once(__DIR__ . '/../../include/process_text.php');
-include_once(__DIR__ . '/../../include/calculate_age_cls.php');
-include_once(__DIR__ . '/../../include/person_cls.php');
-include_once(__DIR__ . '/../../include/marriage_cls.php');
include_once(__DIR__ . '/../../include/show_sources.php');
include_once(__DIR__ . '/../../include/witness.php');
include_once(__DIR__ . '/../../include/show_addresses.php');
include_once(__DIR__ . '/../../include/show_picture.php');
include_once(__DIR__ . '/../../include/show_quality.php');
-
-
-//TEST to use multiple functions in multiple classes
-//https://www.w3schools.com/php/php_oop_traits.asp
-//https://wiki.php.net/rfc/traits
-/*
-trait Hello {
- public function sayHello() {
- echo 'Hello ';
- }
- }
-
- trait World {
- public function sayWorld() {
- echo ' World';
- }
- }
-*/
-
class FamilyModel
{
private $dbh;
- // TEST
- //use Hello, World;
-
public function __construct($dbh)
{
$this->dbh = $dbh;
@@ -229,7 +204,6 @@ function getDescendantHeader($name, $tree_id, $family_id, $main_person)
$data['header_active'][] = $name == 'Descendant report' ? 'active' : '';
$data['header_text'][] = __('Descendant report');
-
if (isset($_GET['dnachart'])) $name='DNA charts';
if ($humo_option["url_rewrite"] == 'j') {
diff --git a/app/model/fanchart.php b/app/model/fanchartModel.php
similarity index 89%
rename from app/model/fanchart.php
rename to app/model/fanchartModel.php
index 18ac65b5..a7be95b1 100644
--- a/app/model/fanchart.php
+++ b/app/model/fanchartModel.php
@@ -1,16 +1,6 @@
Connection = $Connection;
- }
- */
-
public function get_chosengen()
{
$chosengen = 5;
@@ -83,7 +73,8 @@ public function get_fan_width()
return $fan_width;
}
- public function get_real_width($fan_width){
+ public function get_real_width($fan_width)
+ {
if ($fan_width > 50 and $fan_width < 301) {
$tmp_width = $fan_width;
} else {
diff --git a/app/model/indexModel.php b/app/model/indexModel.php
new file mode 100644
index 00000000..e2c56273
--- /dev/null
+++ b/app/model/indexModel.php
@@ -0,0 +1,248 @@
+get_user($_POST["username"], $_POST["password"]);
+ if ($resultDb) {
+ $valid_user = true;
+
+ // *** 2FA is enabled, so check 2FA code ***
+ if (isset($resultDb->user_2fa_enabled) && $resultDb->user_2fa_enabled) {
+ $valid_user = false;
+ $index['fault'] = true;
+ include_once(__DIR__ . "/../../include/2fa_authentication/authenticator.php");
+
+ if ($_POST['2fa_code'] && is_numeric($_POST['2fa_code'])) {
+ $Authenticator = new Authenticator();
+ $checkResult = $Authenticator->verifyCode($resultDb->user_2fa_auth_secret, $_POST['2fa_code'], 2); // 2 = 2*30sec clock tolerance
+ if ($checkResult) {
+ $valid_user = true;
+ $index['fault'] = false;
+ }
+ }
+ }
+
+ if ($valid_user) {
+ $_SESSION['user_name'] = $resultDb->user_name;
+ $_SESSION['user_id'] = $resultDb->user_id;
+ $_SESSION['user_group_id'] = $resultDb->user_group_id;
+
+ // *** August 2023: Also login for admin pages ***
+ // *** Edit family trees [GROUP SETTING] ***
+ $groepsql = $dbh->query("SELECT * FROM humo_groups WHERE group_id='" . $resultDb->user_group_id . "'");
+ @$groepDb = $groepsql->fetch(PDO::FETCH_OBJ);
+ if (isset($groepDb->group_edit_trees)) {
+ $group_edit_trees = $groepDb->group_edit_trees;
+ }
+ // *** Edit family trees [USER SETTING] ***
+ if (isset($resultDb->user_edit_trees) && $resultDb->user_edit_trees) {
+ if ($group_edit_trees) {
+ $group_edit_trees .= ';' . $resultDb->user_edit_trees;
+ } else {
+ $group_edit_trees = $resultDb->user_edit_trees;
+ }
+ }
+ if ($groepDb->group_admin != 'j' && $group_edit_trees == '') {
+ // *** User is not an administrator or editor ***
+ //echo __('Access to admin pages is not allowed.');
+ //exit;
+ } else {
+ $_SESSION['user_name_admin'] = $resultDb->user_name;
+ $_SESSION['user_id_admin'] = $resultDb->user_id;
+ $_SESSION['group_id_admin'] = $resultDb->user_group_id;
+ }
+
+ // *** Save succesful login into log! ***
+ $sql = "INSERT INTO humo_user_log SET
+ log_date='" . date("Y-m-d H:i") . "',
+ log_username='" . $resultDb->user_name . "',
+ log_ip_address='" . $visitor_ip . "',
+ log_user_admin='user',
+ log_status='success'";
+ $dbh->query($sql);
+
+ // *** Send to secured page ***
+ // TODO check link
+ //header("Location: index.php?menu_choice=main_index");
+ header("Location: index.php");
+ exit();
+ }
+ } else {
+ // *** No valid user found ***
+ $index['fault'] = true;
+
+ // *** Save failed login into log! ***
+ $sql = "INSERT INTO humo_user_log SET
+ log_date='" . date("Y-m-d H:i") . "',
+ log_username='" . safe_text_db($_POST["username"]) . "',
+ log_ip_address='" . $visitor_ip . "',
+ log_user_admin='user',
+ log_status='failed'";
+ $dbh->query($sql);
+ }
+ }
+ return $index;
+ }
+
+ public function get_route($humo_option)
+ {
+ // *** New routing script sept. 2023. Search route, return match or not found ***
+ $index['page'] = 'index';
+ $index['main_admin'] = $humo_option["database_name"];
+ $index['tmp_path'] = '';
+
+ $router = new Router();
+ $matchedRoute = $router->get_route($_SERVER['REQUEST_URI']);
+ if (isset($matchedRoute['page'])) {
+ $index['page'] = $matchedRoute['page'];
+
+ // TODO remove title from router script
+ $index['main_admin'] = $matchedRoute['title'];
+
+ if (isset($matchedRoute['select_tree_id'])) {
+ $index['select_tree_id'] = $matchedRoute['select_tree_id'];
+ }
+
+ // *** Used for list_names ***
+ if (isset($matchedRoute['last_name']) && is_string($matchedRoute['last_name'])) {
+ $index['last_name'] = $matchedRoute['last_name'];
+ }
+
+ // Old link from http://www.stamboomzoeker.nl to updated website using new links.
+ // http://127.0.0.1/humo-genealogy/gezin.php?database=humo2_&id=F59&hoofdpersoon=I151
+ if ($humo_option["url_rewrite"] == 'j' && isset($_GET["database"]) && isset($_GET["id"])) {
+ // Skip routing. Just use $_GET["id"] from link.
+ } elseif (isset($matchedRoute['id'])) {
+ // *** Used for source ***
+ // TODO improve processing of these variables
+ $index['id'] = $matchedRoute['id']; // for source
+ $_GET["id"] = $matchedRoute['id']; // for family page, and other pages? TODO improve processing of these variables.
+ }
+
+ if ($matchedRoute['tmp_path']) {
+ $index['tmp_path'] = $matchedRoute['tmp_path'];
+ }
+ }
+ return $index;
+ }
+
+ public function process_ltr_rtl($language)
+ {
+ // *** Process LTR and RTL variables ***
+ $index['dirmark1'] = ""; //ltr marker
+ $index['dirmark2'] = ""; //rtl marker
+ $index['rtlmarker'] = "ltr";
+ $index['alignmarker'] = "left";
+
+ // *** Switch direction markers if language is RTL ***
+ if ($language["dir"] == "rtl") {
+ $index['dirmark1'] = ""; //rtl marker
+ $index['dirmark2'] = ""; //ltr marker
+ $index['rtlmarker'] = "rtl";
+ $index['alignmarker'] = "right";
+ }
+
+ //if (isset($screen_mode) && $screen_mode == "PDF") {
+ // $dirmark1 = '';
+ // $dirmark2 = '';
+ //}
+
+ return $index;
+ }
+
+ public function get_family_tree($dbh, $db_functions, $user)
+ {
+ // *** Family tree choice. Example: database=humo2_ (backwards compatible, now we use tree_id) ***
+ // Test link: http://127.0.0.1/humo-genealogy/gezin.php?database=humo2_&id=F59&hoofdpersoon=I151
+ $database = '';
+ if (isset($_GET["database"])) {
+ $database = $_GET["database"];
+ }
+ if (isset($_POST["database"])) {
+ $database = $_POST["database"];
+ }
+
+ // *** For example: database=humo2_ (backwards compatible, now we use tree_id) ***
+ if (isset($database) && is_string($database) && $database) {
+ // *** Check if family tree really exists ***
+ $dataDb = $db_functions->get_tree($database);
+ if ($dataDb && $database == $dataDb->tree_prefix) {
+ $_SESSION['tree_prefix'] = $database;
+ }
+ }
+
+ // *** Use family tree number in the url: database=humo_2 changed into: tree_id=1 ***
+ if (isset($_GET["tree_id"])) {
+ $index['select_tree_id'] = $_GET["tree_id"];
+ }
+ if (isset($_POST["tree_id"])) {
+ $index['select_tree_id'] = $_POST["tree_id"];
+ }
+ if (isset($index['select_tree_id']) && is_numeric($index['select_tree_id']) && $index['select_tree_id']) {
+ // *** Check if family tree really exists ***
+ $dataDb = $db_functions->get_tree($index['select_tree_id']);
+ if ($dataDb && $index['select_tree_id'] == $dataDb->tree_id) {
+ $_SESSION['tree_prefix'] = $dataDb->tree_prefix;
+ }
+ }
+
+ // *** No family tree selected yet ***
+ if (!isset($_SESSION["tree_prefix"]) || $_SESSION['tree_prefix'] == '') {
+ $_SESSION['tree_prefix'] = ''; // *** If all trees are blocked then session is empty ***
+
+ // *** Find first family tree that's not blocked for this usergroup ***
+ $datasql = $dbh->query("SELECT * FROM humo_trees WHERE tree_prefix!='EMPTY' ORDER BY tree_order");
+ while (@$dataDb = $datasql->fetch(PDO::FETCH_OBJ)) {
+ // *** Check is family tree is showed or hidden for user group ***
+ $hide_tree_array = explode(";", $user['group_hide_trees']);
+ if (!in_array($dataDb->tree_id, $hide_tree_array)) {
+ $_SESSION['tree_prefix'] = $dataDb->tree_prefix;
+ break;
+ }
+ }
+ }
+
+ // *** Check if selected tree is allowed for visitor and Google etc. ***
+ @$dataDb = $db_functions->get_tree($_SESSION['tree_prefix']);
+ $hide_tree_array = explode(";", $user['group_hide_trees']);
+ if (in_array(@$dataDb->tree_id, $hide_tree_array)) {
+ // *** Logged in or logged out user is not allowed to see this tree. Select another if possible ***
+ $_SESSION['tree_prefix'] = '';
+ $_SESSION['tree_id'] = 0;
+ $index['tree_id'] = 0;
+
+ // *** Find first family tree that's not blocked for this usergroup ***
+ $datasql = $dbh->query("SELECT * FROM humo_trees WHERE tree_prefix!='EMPTY' ORDER BY tree_order");
+ while (@$dataDb = $datasql->fetch(PDO::FETCH_OBJ)) {
+ // *** Check is family tree is showed or hidden for user group ***
+ $hide_tree_array = explode(";", $user['group_hide_trees']);
+ if (!in_array($dataDb->tree_id, $hide_tree_array)) {
+ $_SESSION['tree_prefix'] = $dataDb->tree_prefix;
+ $_SESSION['tree_id'] = $dataDb->tree_id;
+ $index['tree_id'] = $dataDb->tree_id;
+ break;
+ }
+ }
+ } elseif (isset($dataDb->tree_id)) {
+ $_SESSION['tree_id'] = $dataDb->tree_id;
+ $index['tree_id'] = $dataDb->tree_id;
+ }
+
+ // *** Guest or user has no permission to see any family tree ***
+ if (!isset($index['tree_id'])) {
+ $_SESSION['tree_prefix'] = '';
+ $_SESSION['tree_id'] = 0;
+ $index['tree_id'] = 0;
+ }
+
+ // *** Set variable for queries ***
+ $index['tree_prefix_quoted'] = safe_text_db($_SESSION['tree_prefix']);
+
+ return $index;
+ }
+}
diff --git a/app/model/latest_changes.php b/app/model/latestChangesModel.php
similarity index 83%
rename from app/model/latest_changes.php
rename to app/model/latestChangesModel.php
index 13a170ff..88bea1b5 100644
--- a/app/model/latest_changes.php
+++ b/app/model/latestChangesModel.php
@@ -1,22 +1,6 @@
dbh = $dbh;
- }
-
public function listChanges($dbh, $tree_id)
{
// *** EXAMPLE of a UNION querie ***
@@ -72,8 +56,8 @@ public function listChanges($dbh, $tree_id)
}
$person_result = $dbh->query($person_qry);
- $i = 1;
- $changes = array();
+ $i = 0;
+ $changes = [];
while (@$person = $person_result->fetch(PDO::FETCH_OBJ)) {
if ($person->pers_sexe == "M") {
$pers_sexe = '';
@@ -83,17 +67,14 @@ public function listChanges($dbh, $tree_id)
$pers_sexe = '';
}
- $person_cls = new person_cls($person);
+ $person_cls = new PersonCls($person);
// *** Person url example (optional: "main_person=I23"): http://localhost/humo-genealogy/family/2/F10?main_person=I23/ ***
$url = $person_cls->person_url2($person->pers_tree_id, $person->pers_famc, $person->pers_fams, $person->pers_gedcomnumber);
$name = $person_cls->person_name($person);
- $changes[$i] = new Change();
- $changes[$i]->show_person = $person_cls->person_popup_menu($person) . $pers_sexe;
- $changes[$i]->show_person .= '' . $name["standard_name"] . '';
-
- $changes[$i]->changed_date = show_datetime($person->pers_changed_datetime);
- $changes[$i]->new_date = show_datetime($person->pers_new_datetime);
+ $changes['show_person'][$i] = $person_cls->person_popup_menu($person) . $pers_sexe . '' . $name["standard_name"] . '';
+ $changes['changed_date'][$i] = show_datetime($person->pers_changed_datetime);
+ $changes['new_date'][$i] = show_datetime($person->pers_new_datetime);
$i++;
}
diff --git a/app/model/list.php b/app/model/listModel.php
similarity index 98%
rename from app/model/list.php
rename to app/model/listModel.php
index 8a409b40..b67a1c2b 100644
--- a/app/model/list.php
+++ b/app/model/listModel.php
@@ -149,6 +149,17 @@ public function getSelection()
$change = true;
}
+ // *** Enable / disable pers_prefix search. Only use option if advanced search page is started/ used ***
+ $selection['use_pers_prefix'] = 'USED';
+ if (isset($_POST['part_lastname']) && !isset($_POST['use_pers_prefix'])) {
+ $selection['pers_prefix'] = 'EMPTY';
+ $selection['use_pers_prefix'] = 'EMPTY';
+ }
+ // *** Page is called from menu bar or direct link from main menu. Option should be enabled then ***
+ if (isset($_GET['adv_search']) && $_GET['adv_search'] == '1') {
+ $selection['use_pers_prefix'] = 'USED';
+ }
+
// *** Lastname ***
$selection['pers_lastname'] = '';
if (isset($_POST['pers_lastname'])) {
@@ -935,11 +946,7 @@ public function build_query($dbh, $tree_id, $user, $humo_option)
// *** Check is family tree is shown or hidden for user group ***
$hide_tree_array = explode(";", $user['group_hide_trees']);
- $hide_tree = false;
- if (in_array($datapdo['tree_id'], $hide_tree_array)) {
- $hide_tree = true;
- }
- if ($hide_tree == false) {
+ if (!in_array($datapdo['tree_id'], $hide_tree_array)) {
if ($counter > 0) {
$multi_tree .= ' OR ';
}
@@ -1045,11 +1052,7 @@ public function build_query($dbh, $tree_id, $user, $humo_option)
}
// *** Check if family tree is shown or hidden for user group ***
$hide_tree_array = explode(";", $user['group_hide_trees']);
- $hide_tree = false;
- if (in_array($pdoresult['tree_id'], $hide_tree_array)) {
- $hide_tree = true;
- }
- if ($hide_tree == false) {
+ if (!in_array($pdoresult['tree_id'], $hide_tree_array)) {
if ($counter > 0) {
$multi_tree .= ' OR ';
}
diff --git a/app/model/list_names.php b/app/model/listNamesModel.php
similarity index 71%
rename from app/model/list_names.php
rename to app/model/listNamesModel.php
index 538b243c..38265fd0 100644
--- a/app/model/list_names.php
+++ b/app/model/listNamesModel.php
@@ -1,27 +1,17 @@
db_functions = $db_functions;
- }
- */
-
public function getAlphabetArray($dbh, $tree_id, $user)
{
- $person_qry = "SELECT UPPER(substring(pers_lastname,1,1)) as first_character
- FROM humo_persons WHERE pers_tree_id='" . $tree_id . "' GROUP BY first_character ORDER BY first_character";
+ $person_qry = "SELECT UPPER(substring(pers_lastname,1,1)) as first_character FROM humo_persons WHERE pers_tree_id='" . $tree_id . "' GROUP BY first_character ORDER BY first_character";
// *** Search pers_prefix for names like: "van Mons" ***
if ($user['group_kindindex'] == "j") {
- $person_qry = "SELECT UPPER(substring(CONCAT(pers_prefix,pers_lastname),1,1)) as first_character
- FROM humo_persons WHERE pers_tree_id='" . $tree_id . "' GROUP BY first_character ORDER BY first_character";
+ $person_qry = "SELECT UPPER(substring(CONCAT(pers_prefix,pers_lastname),1,1)) as first_character FROM humo_persons WHERE pers_tree_id='" . $tree_id . "' GROUP BY first_character ORDER BY first_character";
}
- @$person_result = $dbh->query($person_qry);
- while (@$personDb = $person_result->fetch(PDO::FETCH_OBJ)) {
+ $person_result = $dbh->query($person_qry);
+ $alphabet = [];
+ while ($personDb = $person_result->fetch(PDO::FETCH_OBJ)) {
$alphabet[] = $personDb->first_character;
}
return $alphabet;
diff --git a/app/model/list_places_families.php b/app/model/listPlacesFamiliesModel.php
similarity index 98%
rename from app/model/list_places_families.php
rename to app/model/listPlacesFamiliesModel.php
index 95ea3c0f..d13046e5 100644
--- a/app/model/list_places_families.php
+++ b/app/model/listPlacesFamiliesModel.php
@@ -1,15 +1,6 @@
db_functions = $db_functions;
- }
- */
-
public function getSelection()
{
// *** For index places ***
diff --git a/app/model/mailform.php b/app/model/mailformModel.php
similarity index 100%
rename from app/model/mailform.php
rename to app/model/mailformModel.php
diff --git a/app/model/maps.php b/app/model/mapsModel.php
similarity index 97%
rename from app/model/maps.php
rename to app/model/mapsModel.php
index 80b891b6..1b289627 100644
--- a/app/model/maps.php
+++ b/app/model/mapsModel.php
@@ -1,15 +1,6 @@
db_functions = $db_functions;
- }
- */
-
public function select_world_map($humo_option)
{
$select = 'Google';
@@ -269,7 +260,7 @@ public function get_locations($dbh, $tree_id, $maps)
// *** Use person class ***
// TODO: this slows down page for large family trees. Use Javascript to show persons?
- $person_cls = new person_cls($personDb);
+ $person_cls = new PersonCls($personDb);
$name = $person_cls->person_name($personDb);
$key = array_search($place, $maps['location']);
@@ -296,11 +287,11 @@ public function get_locations($dbh, $tree_id, $maps)
return $maps;
}
- //public function get_locations_google($dbh)
public function get_locations_google($dbh, $tree_id, $maps)
{
// TODO probably better not to load all places. Combine queries?
// Allready done for openstreetmap.
+ $locarray = [];
$location = $dbh->query("SELECT location_id, location_location, location_lat, location_lng FROM humo_location WHERE location_lat IS NOT NULL ORDER BY location_location");
while (@$locationDb = $location->fetch(PDO::FETCH_OBJ)) {
$locarray[$locationDb->location_location][0] = htmlspecialchars($locationDb->location_location);
diff --git a/app/model/outline_report.php b/app/model/outlineReportModel.php
similarity index 99%
rename from app/model/outline_report.php
rename to app/model/outlineReportModel.php
index aab02c72..5ea91a7e 100644
--- a/app/model/outline_report.php
+++ b/app/model/outlineReportModel.php
@@ -1,5 +1,4 @@
query("SHOW TABLES LIKE 'humo_photocat'");
+ if ($temp->rowCount()) {
+ // *** Get array of categories ***
+ $temp2 = $dbh->query("SELECT photocat_prefix FROM humo_photocat WHERE photocat_prefix != 'none'");
+ // the table contains more than the default category (otherwise display regular photoalbum)
+ if ($temp2->rowCount() >= 1) {
+ $qry = "SELECT photocat_id, photocat_prefix FROM humo_photocat GROUP BY photocat_prefix ORDER BY photocat_order";
+ $result = $dbh->query($qry);
+ $result_arr = $result->fetchAll();
+ foreach ($result_arr as $row) {
+ $photoalbum['category'][] = $row['photocat_prefix'];
+ $photoalbum['category_id'][$row['photocat_prefix']] = $row['photocat_id'];
+ $photoalbum['category_enabled'][$row['photocat_prefix']] = false;
+ }
+ }
+ }
+ return $photoalbum;
+ }
+
+ public function get_chosen_tab($category)
+ {
+ $chosen_tab = 'none';
+ if (isset($_SESSION['save_chosen_tab'])) {
+ $chosen_tab = $_SESSION['save_chosen_tab'];
+ }
+ if (isset($_GET['select_category'])) {
+ if ($_GET['select_category'] == 'none') {
+ $chosen_tab = $_GET['select_category'];
+ $_SESSION['save_chosen_tab'] = $chosen_tab;
+ }
+
+ // *** Get selected category ***
+ if (isset($category) && $_GET['select_category'] != 'none' && in_array($_GET['select_category'], $category)) {
+ $chosen_tab = $_GET['select_category'];
+ $_SESSION['save_chosen_tab'] = $chosen_tab;
+ }
+ }
+ return $chosen_tab;
+ }
+
+ public function get_media_files($dbh, $tree_id, $db_functions, $chosen_tab, $search_media, $category)
+ {
+ $photoalbum['media_files'] = [];
+
+ // *** Create an array of all pics with person_id's. Also check for OBJECT (Family Tree Maker GEDCOM file) ***
+ $qry = "SELECT event_event, event_kind, event_connect_kind, event_connect_id, event_gedcomnr FROM humo_events
+ WHERE (event_tree_id='" . $tree_id . "' AND event_connect_kind='person' AND event_kind='picture' AND event_connect_id NOT LIKE '')
+ OR (event_tree_id='" . $tree_id . "' AND event_kind='object')
+ ORDER BY event_event";
+ $picqry = $dbh->query($qry);
+ while ($picqryDb = $picqry->fetch(PDO::FETCH_OBJ)) {
+ $picname = $picqryDb->event_event;
+
+ // *** Show all media, or show only media from selected category ***
+ $process_picture = false;
+ if ($chosen_tab == 'none' && !isset($category)) {
+ // *** No categories ***
+ $process_picture = true;
+ }
+ // *** Example in subdir: subdir1/subdir2/ak_akte_mons.gif ***
+ elseif ($chosen_tab != 'none' && strpos($picname, $chosen_tab) !== false) {
+ // *** One category is selected ***
+ $process_picture = true;
+ }
+ // *** Example of category dir: xy/picture.jpg ***
+ elseif (strpos($picname, substr($chosen_tab, 0, 2) . '/') !== false) {
+ // *** One category is selected ***
+ $process_picture = true;
+ }
+ // *** If there are categories: filter category photo's from results ***
+ elseif ($chosen_tab == 'none' && isset($category)) {
+ // *** There are categories: filter these items in main page ***
+ $process_picture = true;
+ // *** Example in subdir: subdir1/subdir2/ak_akte_mons.gif ***
+ foreach ($category as $test_category) {
+ if (strpos($picname, $test_category) !== false) {
+ $process_picture = false;
+ }
+ // *** Example of subdir category: xy/subdir2/akte_mons.gif ***
+ if (strpos($picname, substr($test_category, 0, 2) . '/') !== false) {
+ $process_picture = false;
+ }
+ }
+ }
+
+ // *** Use search field (search for person) to show pictures ***
+ if ($search_media) {
+ $quicksearch = str_replace(" ", "%", $search_media);
+ $querie = "SELECT pers_firstname, pers_prefix, pers_lastname FROM humo_persons
+ WHERE pers_tree_id='" . $tree_id . "' AND pers_gedcomnumber='" . $picqryDb->event_connect_id . "'
+ AND CONCAT(pers_firstname,REPLACE(pers_prefix,'_',' '),pers_lastname) LIKE '%$quicksearch%'";
+ $persoon = $dbh->query($querie);
+ $personDb = $persoon->fetch(PDO::FETCH_OBJ);
+ if (!$personDb) {
+ $process_picture = false;
+ }
+ }
+
+ // *** Check for privacy of connected persons ***
+ if ($process_picture) {
+ if ($picqryDb->event_connect_id) {
+ // *** Check privacy filter ***
+ // TODO: use the person_cls constructor (adding personDb).
+ $person_cls = new PersonCls;
+ $personDb = $db_functions->get_person($picqryDb->event_connect_id);
+ // TODO check $privacy. This line isn't needed anymore?
+ $privacy = $person_cls->set_privacy($personDb);
+ if ($privacy) {
+ $process_picture = false;
+ }
+ //$name=$person_cls->person_name($personDb);
+ // *** Person url example (optional: "main_person=I23"): http://localhost/humo-genealogy/family/2/F10?main_person=I23/ ***
+ //$url=$person_cls->person_url2($personDb->pers_tree_id,$personDb->pers_famc,$personDb->pers_fams,$personDb->pers_gedcomnumber);
+ //$picture_text.=''.$name["standard_name"].' '; + //$picture_text2.=$name["standard_name"]; + } else { + // *** OBJECTS: Family Tree Maker GEDCOM file *** + $connect_qry = $dbh->query("SELECT connect_connect_id FROM humo_connections + WHERE connect_tree_id='" . $tree_id . "' AND connect_sub_kind='pers_object' AND connect_source_id='" . $picqryDb->event_gedcomnr . "'"); + while ($connectDb = $connect_qry->fetch(PDO::FETCH_OBJ)) { + $person_cls = new PersonCls; + $personDb = $db_functions->get_person($connectDb->connect_connect_id); + $privacy = $person_cls->set_privacy($personDb); + if ($privacy) { + $process_picture = false; + } + } + } + } + + if ($process_picture) { + if (!isset($photoalbum['media_files']) || !in_array($picname, $photoalbum['media_files'])) { // this pic does not appear in the array yet + //$connected_persons[$picname]=$picqryDb->event_connect_id; // example: $connected_persons['an_example.jpg']="I354" + + // *** Skip PDF and RTF files *** + $check_file = strtolower($picname); + if (substr($check_file, -4) !== '.pdf' && substr($check_file, -4) !== '.rtf') { + $photoalbum['media_files'][] = $picname; + } + } + + //else { // pic already exists in array with other person_id. Append this one. + // $connected_persons[$picname] .= '@@'.$picqryDb->event_connect_id; // example: $connected_persons['an_example.jpg']="I354@@I653" + // //$photoalbum['media_files'][]=$picname; + //} + } + + // *** Check if media belongs to category *** + if (isset($category)) { + foreach ($category as $test_category) { + // *** Check if media belongs to category *** + // *** Example in subdir: subdir1/subdir2/ak_akte_mons.gif *** + if (strpos($picname, $test_category) !== false) { + $photoalbum['show_categories'] = true; // *** There are categories *** + $photoalbum['category_enabled'][$test_category] = true; // *** This categorie will be shown *** + } + + // *** Check if directory belongs to category, example: xy/picture.jpg *** + if (strpos($picname, substr($test_category, 0, 2) . '/') !== false) { + $photoalbum['show_categories'] = true; // *** There are categories *** + $photoalbum['category_enabled'][$test_category] = true; // *** This categorie will be shown *** + } + } + } else { + // *** There were categories, but they were disabled or removed *** + //$chosen_tab = 'none'; + //$_SESSION['save_chosen_tab'] = $chosen_tab; + } + } + return $photoalbum; + } +} diff --git a/app/model/register.php b/app/model/registerModel.php similarity index 100% rename from app/model/register.php rename to app/model/registerModel.php diff --git a/app/model/relations.php b/app/model/relationsModel.php similarity index 98% rename from app/model/relations.php rename to app/model/relationsModel.php index ff1390b0..f800baaa 100644 --- a/app/model/relations.php +++ b/app/model/relationsModel.php @@ -1,15 +1,6 @@ db_functions = $db_functions; - } - */ - public function resetValues(): void { // *** Reset values *** diff --git a/app/model/reset_password.php b/app/model/resetPasswordModel.php similarity index 92% rename from app/model/reset_password.php rename to app/model/resetPasswordModel.php index 6e9d2fa6..3735aa49 100644 --- a/app/model/reset_password.php +++ b/app/model/resetPasswordModel.php @@ -1,26 +1,6 @@ db_functions = $db_functions; - } - */ - - /* - public function getId() - { - return $this->id; - } - public function setId($id) - { - $this->id = $id; - } - */ - public function get_activation_key() { $activation_key = ''; diff --git a/app/model/source.php b/app/model/sourceModel.php similarity index 100% rename from app/model/source.php rename to app/model/sourceModel.php diff --git a/app/model/sources.php b/app/model/sourcesModel.php similarity index 100% rename from app/model/sources.php rename to app/model/sourcesModel.php diff --git a/app/model/statistics.php b/app/model/statisticsModel.php similarity index 79% rename from app/model/statistics.php rename to app/model/statisticsModel.php index 4ce0d1d7..a0e9744b 100644 --- a/app/model/statistics.php +++ b/app/model/statisticsModel.php @@ -1,15 +1,6 @@ db_functions = $db_functions; - } - */ - public function get_menu_tab() { // *** Tab menu *** diff --git a/app/model/timeline.php b/app/model/timelineModel.php similarity index 96% rename from app/model/timeline.php rename to app/model/timelineModel.php index 1a756b33..29409b57 100644 --- a/app/model/timeline.php +++ b/app/model/timelineModel.php @@ -1,25 +1,6 @@ db_functions = $db_functions; - } - */ - - /* - private function julgreg($date) - { // alters a julian/gregorian date entry such as 4 mar 1572/3 to use regular date for calculations - if (strpos($date, '/') > 0) { - $date_array = explode('/', $date); - $date = $date_array[0]; - } - return $date; - } - */ // TODO remove return_array check (and use array in all julgreg lines.). private function julgreg($process_date, $return_array = false) { @@ -47,7 +28,7 @@ private function julgreg($process_date, $return_array = false) public function getPersonData($personDb) { - $process_age = new calculate_year_cls; + $process_age = new CalculateDates; $data["isborn"] = 0; $data["isdeath"] = 0; @@ -177,7 +158,7 @@ public function getTimelinePersons($db_functions, $personDb, $user, $dirmark1) { // *** MARRIAGES & CHILDREN *** if (isset($personDb->pers_fams) && $personDb->pers_fams) { - $process_age = new calculate_year_cls; + $process_age = new CalculateDates; $data["marriages"] = explode(";", $personDb->pers_fams); $count_marriages = count($data["marriages"]); @@ -190,7 +171,7 @@ public function getTimelinePersons($db_functions, $personDb, $user, $dirmark1) $spouse2Db = $db_functions->get_person($spouse); $privacy = true; if ($spouse2Db) { - $person_cls = new person_cls($spouse2Db); + $person_cls = new PersonCls($spouse2Db); $privacy = $person_cls->privacy; $name = $person_cls->person_name($spouse2Db); } @@ -276,7 +257,7 @@ public function getTimelinePersons($db_functions, $personDb, $user, $dirmark1) $child = __('child '); } - $person2_cls = new person_cls($chldDb); + $person2_cls = new PersonCls($chldDb); $privacy = $person2_cls->privacy; $name = $person2_cls->person_name($chldDb); @@ -329,7 +310,7 @@ public function getTimelinePersons($db_functions, $personDb, $user, $dirmark1) // CHILDREN'S MARRIAGES $chspouse = $chldDb->pers_gedcomnumber == $chfamilyDb->fam_man ? $chfamilyDb->fam_woman : $chfamilyDb->fam_man; $chspouse2Db = $db_functions->get_person($chspouse); - $person_cls = new person_cls($chspouse2Db); + $person_cls = new PersonCls($chspouse2Db); $privacy = $person_cls->privacy; $name = $person_cls->person_name($chspouse2Db); if (!$privacy) { @@ -377,7 +358,7 @@ public function getTimelinePersons($db_functions, $personDb, $user, $dirmark1) $count_grchildren = count($data["grchildren"][$i][$m][$p]); for ($g = 0; $g < $count_grchildren; $g++) { $grchldDb = $db_functions->get_person($data["grchildren"][$i][$m][$p][$g]); - $person3_cls = new person_cls($grchldDb); + $person3_cls = new PersonCls($grchldDb); $privacy = $person3_cls->privacy; $name = $person3_cls->person_name($grchldDb); if (!$privacy) { diff --git a/app/model/tree_index.php b/app/model/treeIndexModel.php similarity index 85% rename from app/model/tree_index.php rename to app/model/treeIndexModel.php index b75f3eae..52f11d4b 100644 --- a/app/model/tree_index.php +++ b/app/model/treeIndexModel.php @@ -3,23 +3,13 @@ include_once(__DIR__ . '/../../include/date_place.php'); include_once(__DIR__ . "/../../include/show_tree_date.php"); -class Mainindex_cls +class TreeIndexModel { - - /* - public function __construct() - { - $this->var = $var; - } - */ - public function show_tree_index() { global $dbh, $tree_id, $tree_prefix_quoted, $dataDb, $selected_language, $treetext_name, $dirmark2, $bot_visit, $humo_option, $db_functions; global $link_cls, $uri_path; - include_once(__DIR__ . '/../../include/person_cls.php'); - // *** Option to only index CMS page for bots *** if ($bot_visit && $humo_option["searchengine_cms_only"] == 'y') { $item_array[0]['position'] = 'center'; @@ -252,11 +242,7 @@ public function tree_list($datasql) while (@$dataDb = $datasql->fetch(PDO::FETCH_OBJ)) { // *** Check is family tree is shown or hidden for user group *** $hide_tree_array = explode(";", $user['group_hide_trees']); - $hide_tree = false; - if (in_array($dataDb->tree_id, $hide_tree_array)) { - $hide_tree = true; - } - if ($hide_tree == false) { + if (!in_array($dataDb->tree_id, $hide_tree_array)) { $treetext = show_tree_text($dataDb->tree_id, $selected_language); $treetext_name = $treetext['name']; @@ -267,13 +253,6 @@ public function tree_list($datasql) } elseif (isset($_SESSION['tree_prefix']) && $_SESSION['tree_prefix'] == $dataDb->tree_prefix) { $tree_name = '' . $treetext_name . ''; } else { - // *** url_rewrite *** - //if ($humo_option["url_rewrite"] == "j") { - // $path_tmp = $uri_path . 'tree_index/' . $dataDb->tree_id; - //} else { - // //$path_tmp = 'tree_index.php?tree_id=' . $dataDb->tree_id; - // $path_tmp = 'index.php?page=tree_index&tree_id=' . $dataDb->tree_id; - //} $path_tmp = $link_cls->get_link($uri_path, 'tree_index', $dataDb->tree_id); $tree_name = '' . $treetext_name . ''; } @@ -332,7 +311,6 @@ public function last_names($columns, $rows) $maxnames = $rows * $maxcols; } - //$table2_width="500"; $text = ''; if (!function_exists('tablerow')) { @@ -652,8 +630,15 @@ public function search_box() // *** Random photo *** public function random_photo() { - global $dataDb, $tree_id, $dbh, $db_functions; + global $dataDb, $tree_id, $dbh, $db_functions, $humo_option; + // adding static table for displayed photos storage + static $temp_pic_names_table = []; $text = ''; + // characters limit for rounding text below photo 100 looks good at photos inline, 200 should be good for lightbox desc + //this for text without lightbox + $char_limit = 100; + //this for lightbox + $char_limit2 = 400; $tree_pict_path = $dataDb->tree_pict_path; if (substr($tree_pict_path, 0, 1) === '|') { @@ -661,50 +646,115 @@ public function random_photo() } // *** Loop through pictures and find first available picture without privacy filter *** + // i added also family kind photos $qry = "SELECT * FROM humo_events - WHERE event_tree_id='" . $tree_id . "' AND event_kind='picture' AND event_connect_kind='person' AND event_connect_id NOT LIKE '' + WHERE event_tree_id='" . $tree_id . "' AND event_kind='picture' AND (event_connect_kind='person' OR event_connect_kind='family') AND event_connect_id NOT LIKE '' ORDER BY RAND()"; $picqry = $dbh->query($qry); + // We will go unique-random aproach than only randomness + // 'ORDER BY RAND' is pseudorandom. It's still not random - now im implementing uniqueness + // first we count number of rows with this query + // $rowCount = $picqry->rowCount(); + // then we skip some rows if sum of rows is enough to skip - thats why we count + // $skipCount = random_int(0, $rowCount - 5); + // for ($i = 0; $i < $skipCount; $i++) { + // if (!$picqry->fetch(PDO::FETCH_OBJ)) { + // return null; + // } + // } + while ($picqryDb = $picqry->fetch(PDO::FETCH_OBJ)) { - $picname = str_replace(" ", "_", $picqryDb->event_event); - $check_file = strtolower(substr($picname, -3, 3)); - if (($check_file === 'png' || $check_file === 'gif' || $check_file === 'jpg') && file_exists($tree_pict_path . $picname)) { - @$personmnDb = $db_functions->get_person($picqryDb->event_connect_id); - $man_cls = new person_cls($personmnDb); - $man_privacy = $man_cls->privacy; - if ($man_cls->privacy == '') { - $date_place = ''; + $picname = $picqryDb->event_event; + // adding new var to store kind of connection - will be useful to use different approach for person photos and family photos + $pic_conn_kind = $picqryDb->event_connect_kind; + // this code was taking extension from name and was not working with 4 letter extensions: $check_file = strtolower(substr($picname, -3, 3)); + // im now using dedicated function to determine extension - it get 3 letter extensions and 4 letter for jpeg which i'm adding too below + $check_file = pathinfo($picname, PATHINFO_EXTENSION); + + // im adding jpeg also and adding uniqueness + if (($check_file === 'png' || $check_file === 'gif' || $check_file === 'jpg' || $check_file === 'jpeg') && file_exists($tree_pict_path . $picname) && !in_array($picname, $temp_pic_names_table)) { + + $is_privacy = true; + + if ($pic_conn_kind == 'person') { + @$personmnDb = $db_functions->get_person($picqryDb->event_connect_id); + $man_cls = new PersonCls($personmnDb); + if ($man_cls->privacy == '') { + $is_privacy = false; + + $name = $man_cls->person_name($personmnDb); + $link_text = $name["standard_name"]; + + $url = $man_cls->person_url2($personmnDb->pers_tree_id, $personmnDb->pers_famc, $personmnDb->pers_fams, $personmnDb->pers_gedcomnumber); + } + } elseif ($pic_conn_kind == 'family') { + $qry2 = "SELECT * FROM humo_families WHERE fam_gedcomnumber='" . $picqryDb->event_connect_id . "'"; + $picqry2 = $dbh->query($qry2); + $picqryDb2 = $picqry2->fetch(PDO::FETCH_OBJ); + + @$personmnDb2 = $db_functions->get_person($picqryDb2->fam_man); + $man_cls = new PersonCls($personmnDb2); + + @$personmnDb3 = $db_functions->get_person($picqryDb2->fam_woman); + $woman_cls = new PersonCls($personmnDb3); + // *** Only use this picture if both man and woman have disabled privacy options *** + if ($man_cls->privacy == '' && $woman_cls->privacy == '') { + $is_privacy = false; + + $name = $man_cls->person_name($personmnDb2); + $man_name = $name["standard_name"]; + + $name = $woman_cls->person_name($personmnDb3); + $woman_name = $name["standard_name"]; + + $link_text = __('Family') . ': ' . $man_name . ' & ' . $woman_name; + + if ($humo_option["url_rewrite"] == "j") { + $url = 'family/' . $picqryDb->event_tree_id . '/' . $picqryDb->event_connect_id; + } else { + $url = 'index.php?page=family&tree_id=' . $picqryDb->event_tree_id . '&id=' . $picqryDb->event_connect_id; + } + // TODO use function to build link: + //$vars['pers_family'] = $familyDb->stat_gedcom_fam; + //$link = $link_cls->get_link('../', 'family', $familyDb->tree_id, false, $vars); + //echo '' . __('Family') . ': '; + } + } + + if (!$is_privacy) { + $date_place = ''; if ($picqryDb->event_date || $picqryDb->event_place) { $date_place = date_place($picqryDb->event_date, $picqryDb->event_place) . ' '; } + // i decided tu put give_media_path() in new file in include dir + include_once('./include/give_media_path.php'); + $picture_path = give_media_path($tree_pict_path, $picname); + // u can delete this variables if there are some global variables for protocol and omain combined + // Get the protocol (HTTP or HTTPS) $text .= ' ';
// *** Show picture using GLightbox ***
- //$text .= 'event_text) . '"> '; - $text .= 'event_text) . '"> '; - - // *** Person url example (optional: "main_person=I23"): http://localhost/humo-genealogy/family/2/F10?main_person=I23/ *** - $url = $man_cls->person_url2($personmnDb->pers_tree_id, $personmnDb->pers_famc, $personmnDb->pers_fams, $personmnDb->pers_gedcomnumber); + $desc_for_lightbox = $date_place . str_replace("&", "&", $picqryDb->event_text); + $desc_for_lightbox = (mb_strlen($desc_for_lightbox, "UTF-8") > $char_limit2) ? mb_substr($desc_for_lightbox, 0, $char_limit2, "UTF-8") . '...' : $desc_for_lightbox; - //$text.=''.$picqryDb->event_text.' '; - $text .= '' . $date_place . $picqryDb->event_text . ''; + $text .= ' '; + // *** Person url example (optional: "main_person=I23"): http://localhost/humo-genealogy/family/2/F10?main_person=I23/ *** + $text .= '' . $link_text . ''; + if ($picqryDb->event_text !== '' or $date_place !== '') { + // this code shortens event text below photos to 50 chars and adds '...' if its above 50 chars. Photos with long texts added looks bad... + $shortEventText = (mb_strlen($picqryDb->event_text, "UTF-8") > $char_limit) ? mb_substr($picqryDb->event_text, 0, $char_limit, "UTF-8") . '...' : $picqryDb->event_text; + $text .= ' ' . $date_place . $shortEventText; + } + $text .= ''; + // add displayed photo to table for checking uniqueness + $temp_pic_names_table[] = $picname; // *** Show first available picture without privacy restrictions *** break; } - - // *** TEST privacy filter *** - //else{ - // $picname = str_replace(" ","_",$picqryDb->event_event); - // $text.=''; - // $text.=$picqryDb->event_id.' tree_id:'.$picqryDb->event_tree_id.' '; - // $text.=$man_cls->privacy.'PRIVACY '; - //} } } return $text; @@ -729,8 +779,8 @@ public function extra_links() $person = $dbh->query("SELECT * FROM humo_persons WHERE pers_tree_id='" . $tree_id . "' AND pers_own_code NOT LIKE ''"); while ($personDb = $person->fetch(PDO::FETCH_OBJ)) { if (in_array($personDb->pers_own_code, $pers_own_code)) { - $person_cls = new person_cls; - //$person_cls = new person_cls($personDb); + $person_cls = new PersonCls; + //$person_cls = new PersonCls($personDb); // *** Person url example (optional: "main_person=I23"): http://localhost/humo-genealogy/family/2/F10?main_person=I23/ *** $path_tmp = $person_cls->person_url2($personDb->pers_tree_id, $personDb->pers_famc, $personDb->pers_fams, $personDb->pers_gedcomnumber); @@ -847,8 +897,7 @@ public function alphabet() } } - $person = "SELECT pers_patronym FROM humo_persons - WHERE pers_tree_id='" . $tree_id . "' AND pers_patronym LIKE '_%' AND pers_lastname ='' LIMIT 0,1"; + $person = "SELECT pers_patronym FROM humo_persons WHERE pers_tree_id='" . $tree_id . "' AND pers_patronym LIKE '_%' AND pers_lastname ='' LIMIT 0,1"; @$personDb = $dbh->query($person); if ($personDb->rowCount() > 0) { $path_tmp = $link_cls->get_link($uri_path, 'list', $tree_id, true); @@ -895,7 +944,7 @@ public function today_in_history($view = 'with_table') // *** Save results in an array, so it's possible to order the results by date *** while ($record = $birth_qry->fetch(PDO::FETCH_OBJ)) { - $person_cls = new person_cls($record); + $person_cls = new PersonCls($record); $name = $person_cls->person_name($record); if (!$person_cls->privacy) { if (trim(substr($record->pers_birth_date, 0, 6)) === $today || substr($record->pers_birth_date, 0, 6) === $today2) { @@ -997,79 +1046,101 @@ public function today_in_history($view = 'with_table') return $text . ''; } - public function show_footer(): void - { - global $bot_visit, $humo_option, $uri_path; - - echo ' ';
- // *** Show owner of family tree ***
- echo $this->owner();
-
- // *** Show HuMo-genealogy link ***
- //printf(__('This database is made by %s, a freeware genealogical program'), 'HuMo-genealogy');
- printf(__('This website is created using %s, a freeware genealogical program'), 'HuMo-genealogy');
- echo '. ';
- }
-
// *** Show slideshow ***
public function show_slideshow(): void
{
global $humo_option;
+?>
- // *** Used inline CSS, so it will be possible to use other CSS style (can be used for future slideshow options) ***
- echo '';
-?>
+
'; - - // *** Show European cookie information *** - $url = $humo_option["url_rewrite"] == "j" ? $uri_path . 'cookies' : 'index.php?page=cookies'; - if (!$bot_visit) { - printf(__('European law: %s cookie information'), 'HuMo-genealogy'); - } - echo ''; - echo ' |