-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgendex.php
110 lines (95 loc) · 4.67 KB
/
gendex.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
header('Content-type: text/plain; charset=iso-8859-1');
// **************************************************
// *** Privacy person ***
// **************************************************
include_once(__DIR__ . "/include/db_login.php"); //Inloggen database.
include_once(__DIR__ . "/include/safe.php"); //Variabelen
// *** Needed for privacy filter ***
include_once(__DIR__ . "/include/settings_global.php"); //Variables
include_once(__DIR__ . "/include/settings_user.php"); // USER variables
include_once(__DIR__ . "/include/personCls.php");
include_once(__DIR__ . "/include/DbFunctions.php");
$db_functions = new DbFunctions($dbh);
// *** Database ***
$datasql = $db_functions->get_trees();
//$num_rows=count($datasql);
foreach ($datasql as $dataDb) {
// *** Check is family tree is shown or hidden for user group ***
$hide_tree_array = explode(";", $user['group_hide_trees']);
if (!in_array($dataDb->tree_id, $hide_tree_array)) {
$person_qry = $dbh->query("SELECT * FROM humo_persons WHERE pers_tree_id='" . $dataDb->tree_id . "' ORDER BY pers_lastname");
//GENDEX:
//person-URL|FAMILYNAME|Firstname /FAMILYNAME/|
//Birthdate|Birthplace|Deathdate|Deathplace|
while (@$personDb = $person_qry->fetch(PDO::FETCH_OBJ)) {
// *** Use class for privacy filter ***
$person_cls = new PersonCls($personDb);
$privacy = $person_cls->privacy;
// *** Completely filter person ***
if (
$user["group_pers_hide_totally_act"] == 'j' && strpos(' ' . $personDb->pers_own_code, $user["group_pers_hide_totally"]) > 0
) {
// *** Don't show person ***
} else {
$person_url = '';
if ($personDb->pers_famc) {
$person_url = $personDb->pers_famc;
}
if ($personDb->pers_fams) {
$pers_fams = explode(';', $personDb->pers_fams);
$person_url = $pers_fams[0];
}
if ($person_url == '') {
// *** Person without parents or own family ***
$person_url = '&main_person=' . $personDb->pers_gedcomnumber;
}
$text = $person_url . '&database=' . $dataDb->tree_prefix . '|';
//$pers_lastname=strtoupper(str_replace("_", " ", $personDb->pers_prefix));
//$pers_lastname.=strtoupper($personDb->pers_lastname);
$pers_lastname = mb_strtoupper(str_replace("_", " ", $personDb->pers_prefix), 'iso-8859-1');
$pers_lastname .= mb_strtoupper($personDb->pers_lastname, 'iso-8859-1');
$text .= $pers_lastname . '|';
$text .= $personDb->pers_firstname . ' /' . $pers_lastname . '/|';
if (!$privacy) { // Privacy restricted person
$birth_bapt_date = "";
if ($personDb->pers_bapt_date) {
$birth_bapt_date = $personDb->pers_bapt_date;
}
if ($personDb->pers_birth_date) {
$birth_bapt_date = $personDb->pers_birth_date;
}
$text .= $birth_bapt_date . '|';
$birth_bapt_place = "";
if ($personDb->pers_bapt_place) {
$birth_bapt_place = $personDb->pers_bapt_place;
}
if ($personDb->pers_birth_place) {
$birth_bapt_place = $personDb->pers_birth_place;
}
$text .= $birth_bapt_place . '|';
$died_bur_date = "";
if ($personDb->pers_death_date) {
$died_bur_date = $personDb->pers_death_date;
}
if ($personDb->pers_buried_date) {
$died_bur_date = $personDb->pers_buried_date;
}
$text .= $died_bur_date . '|';
$died_bur_place = "";
if ($personDb->pers_death_place) {
$died_bur_place = $personDb->pers_death_place;
}
if ($personDb->pers_buried_place) {
$died_bur_place = $personDb->pers_buried_place;
}
$text .= $died_bur_place . '|';
} else {
$text .= '||||';
}
//echo html_entity_decode($text)."\r\n";
echo $text . "\r\n";
}
}
} // *** End of hidden family tree ***
} // *** End of multiple family trees ***