From 04059d01ba73a2f5ee54a5bd91f7c6ee2dbb995b Mon Sep 17 00:00:00 2001 From: fisharebest Date: Sun, 21 Jul 2013 19:15:14 +0000 Subject: PHP error in personal facts module --- modules_v3/personal_facts/module.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'modules_v3') diff --git a/modules_v3/personal_facts/module.php b/modules_v3/personal_facts/module.php index 9222b2d2f9..ca3dfb9bcf 100644 --- a/modules_v3/personal_facts/module.php +++ b/modules_v3/personal_facts/module.php @@ -414,21 +414,22 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { private static function historical_facts(WT_Individual $person) { global $SHOW_RELATIVES_EVENTS; - if (!$SHOW_RELATIVES_EVENTS) return; $facts = array(); - // Only include events between birth and death - $birt_date = $person->getEstimatedBirthDate(); - $deat_date = $person->getEstimatedDeathDate(); - - if (file_exists(WT_Site::preference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php')) { - require WT_Site::preference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php'; - foreach ($histo as $hist) { - $fact = new WT_Fact($hist, $person, 'histo'); - $sdate = $fact->getDate(); - if ($sdate->isOK() && WT_Date::Compare($birt_date, $sdate)<=0 && WT_Date::Compare($sdate, $deat_date)<=0) { - $facts[] = $fact; + if ($SHOW_RELATIVES_EVENTS) { + // Only include events between birth and death + $birt_date = $person->getEstimatedBirthDate(); + $deat_date = $person->getEstimatedDeathDate(); + + if (file_exists(WT_Site::preference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php')) { + require WT_Site::preference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php'; + foreach ($histo as $hist) { + $fact = new WT_Fact($hist, $person, 'histo'); + $sdate = $fact->getDate(); + if ($sdate->isOK() && WT_Date::Compare($birt_date, $sdate)<=0 && WT_Date::Compare($sdate, $deat_date)<=0) { + $facts[] = $fact; + } } } } -- cgit v1.3