Example #1
0
function process_indiv($p_node)
{
    global $g_node_strings, $g_node_parents, $g_node_indkey, $g_nodes;
    # populate keyword array
    keyword_push($p_node->full_name());
    $g_node_indkey[$p_node->ns_number] = $p_node->indkey;
    if ($p_node->father_indkey || $p_node->mother_indkey) {
        $g_node_parents[$p_node->ns_number] = true;
    } else {
        $g_node_parents[$p_node->ns_number] = false;
    }
    $g_nodes[$p_node->ns_number] = $p_node;
}
Example #2
0
/**
 * Gets Marriage Sentence
 * @access public
 * @param Person $p Individual
 * @return string
 */
function get_marriage_sentences($p)
{
    global $g_family_page;
    $s = ' ';
    for ($i = 0; $i < $p->marriage_count; $i++) {
        $marriage =& $p->marriages[$i];
        if ($marriage->spouse) {
            $spouse = new Person($marriage->spouse, 3);
            $spouse_link = '<a class="secondary" href="' . $_SERVER['PHP_SELF'] . '?m=family&amp;id=' . $spouse->indkey . '">' . $spouse->full_name() . '</a>';
            # populate keyword array
            keyword_push($spouse->full_name());
            if ($marriage->beginstatus == 'Marriage') {
                if ($p->sex == 'M') {
                    # structure for male married with date and place
                    if ($marriage->date and $marriage->place) {
                        $s .= sprintf(gtc("male %s married %s on %s in %s."), $p->first_name(), $spouse_link, $marriage->date, $marriage->place);
                    } elseif ($marriage->date) {
                        $s .= sprintf(gtc("male %s married %s on %s."), $p->first_name(), $spouse_link, $marriage->date);
                    } elseif ($marriage->place) {
                        $s .= sprintf(gtc("male %s married %s in %s."), $p->first_name(), $spouse_link, $marriage->place);
                    } else {
                        $s .= sprintf(gtc("male %s married %s."), $p->first_name(), $spouse_link);
                    }
                    if ($marriage->endstatus) {
                        $s .= ' ';
                        $s .= sprintf(gtc("This marriage ended in %s."), strtolower(gtc($marriage->endstatus)));
                    }
                } elseif ($p->sex == 'F') {
                    # structure for female married with date and place
                    if ($marriage->date and $marriage->place) {
                        $s .= sprintf(gtc("female %s married %s on %s in %s."), $p->first_name(), $spouse_link, $marriage->date, $marriage->place);
                    } elseif ($marriage->date) {
                        $s .= sprintf(gtc("female %s married %s on %s."), $p->first_name(), $spouse_link, $marriage->date);
                    } elseif ($marriage->place) {
                        $s .= sprintf(gtc("female %s married %s in %s."), $p->first_name(), $spouse_link, $marriage->place);
                    } else {
                        $s .= sprintf(gtc("female %s married %s."), $p->first_name(), $spouse_link);
                    }
                    if ($marriage->endstatus) {
                        $s .= ' ';
                        $s .= sprintf(gtc("This marriage ended in %s."), strtolower(gtc($marriage->endstatus)));
                    }
                }
            } else {
                if ($p->sex == 'M') {
                    # structure for male relationship with date and place
                    if ($marriage->date and $marriage->place) {
                        $s .= sprintf(gtc("male %s had a relationship with %s on %s in %s."), $p->first_name(), $spouse_link, $marriage->date, $marriage->place);
                    } elseif ($marriage->date) {
                        $s .= sprintf(gtc("male %s had a relationship with %s on %s."), $p->first_name(), $spouse_link, $marriage->date);
                    } elseif ($marriage->place) {
                        $s .= sprintf(gtc("male %s had a relationship with %s in %s."), $p->first_name(), $spouse_link, $marriage->place);
                    } else {
                        $s .= sprintf(gtc("male %s had a relationship with %s."), $p->first_name(), $spouse_link);
                    }
                    if ($marriage->endstatus) {
                        $s .= ' ';
                        $s .= sprintf(gtc("This marriage ended in %s."), gtc($marriage->endstatus));
                    }
                } elseif ($p->sex == 'F') {
                    # structure for female relationship with date and place
                    if ($marriage->date and $marriage->place) {
                        $s .= sprintf(gtc("female %s had a relationship with %s on %s in %s."), $p->first_name(), $spouse_link, $marriage->date, $marriage->place);
                    } elseif ($marriage->date) {
                        $s .= sprintf(gtc("female %s had a relationship with %s on %s."), $p->first_name(), $spouse_link, $marriage->date);
                    } elseif ($marriage->place) {
                        $s .= sprintf(gtc("female %s had a relationship with %s in %s."), $p->first_name(), $spouse_link, $marriage->place);
                    } else {
                        $s .= sprintf(gtc("female %s had a relationship with %s."), $p->first_name(), $spouse_link);
                    }
                    if ($marriage->endstatus) {
                        $s .= ' ';
                        $s .= sprintf(gtc("This relationship ended in %s."), gtc($marriage->endstatus));
                    }
                }
            }
        }
        if ($s) {
            $s .= ' ';
        }
    }
    return $s;
}
Example #3
0
 * GNU General Public License contained in the file GNU.txt for
 * more details.
 */
/**
 * $Id$
 */
# Ensure this file is being included by a parent file
defined('_RGDS_VALID') or die('Direct access to this file is not allowed.');
# process expected get/post variables
$g_indiv = isset($_GET['id']) ? $_GET['id'] : exit;
# get first person information
$o = new person($g_indiv);
$smarty->assign('indiv', $o);
# populate keyword array
keyword_push(gtc("Comments"));
keyword_push($o->full_name());
# assign other smarty variables
$smarty->assign('page_title', sprintf(gtc("Comments for %s"), $o->full_name()));
$smarty->assign('surname_title', sprintf(gtc("%s Surname"), $o->sname));
$content_title = $o->prefix . ' ' . $o->full_name();
if ($o->suffix) {
    $content_title .= ', ' . $o->suffix;
}
$smarty->assign('content_title', $content_title);
# grab all the comments
$comments = get_visible_comments($g_indiv);
for ($i = 0; $i < count($comments); $i++) {
    $comments[$i]['comment'] = stripslashes($comments[$i]['comment']);
    $comments[$i]['comment'] = rgds_parse_links($comments[$i]['comment']);
}
$smarty->assign('COMMENTS', $comments);
Example #4
0
# Ensure this file is being included by a parent file
defined('_RGDS_VALID') or die('Direct access to this file is not allowed.');
/**
 * Require Atree class
 */
require_once CORE_PATH . 'atree.class.php';
/**
 * Require report functions
 */
require_once CORE_PATH . 'f_report.php';
# process expected get/post variables
$g_indiv = isset($_GET['id']) ? $_GET['id'] : exit;
$g_max_gens = isset($_GET['g']) ? $_GET['g'] : 250;
# populate keyword array
keyword_push(gtc("Ahnentafel"));
keyword_push(gtc("Ancestors"));
# initialize other variables
$g_generation = 0;
# current generation
$individuals = array();
# get first person information
$o = new Person($g_indiv);
$smarty->assign('indiv', $o);
# instantiate new tree and populate with ancestors
$tree = new ATree($g_indiv);
$tree->fill_tree($g_max_gens);
# assign other smarty variables
$smarty->assign_by_ref('page_title', sprintf(gtc("Ahnentafel Report for %s"), $o->full_name()));
$smarty->assign_by_ref('surname_title', sprintf(gtc("%s Surname"), $o->sname));
$content_title = $o->prefix . ' ' . $o->full_name();
if ($o->suffix) {
Example #5
0
$smarty->assign('form_gname', $gname);
$sname = isset($_GET['sname']) ? $_GET['sname'] : null;
$smarty->assign('form_sname', $sname);
$soundex = isset($_GET['soundex']) ? true : false;
$smarty->assign('form_soundex', $soundex);
$begin_month = isset($_GET['begin_month']) ? $_GET['begin_month'] : null;
$begin_day = isset($_GET['begin_day']) ? $_GET['begin_day'] : null;
$begin_year = isset($_GET['begin_year']) ? $_GET['begin_year'] : null;
$smarty->assign('form_begin_month', $begin_month);
$smarty->assign('form_begin_day', $begin_day);
$smarty->assign('form_begin_year', $begin_year);
$end_month = isset($_GET['end_month']) ? $_GET['end_month'] : null;
$end_day = isset($_GET['end_day']) ? $_GET['end_day'] : null;
$end_year = isset($_GET['end_year']) ? $_GET['end_year'] : null;
$smarty->assign('form_end_month', $end_month);
$smarty->assign('form_end_day', $end_day);
$smarty->assign('form_end_year', $end_year);
$location = isset($_GET['locat']) ? $_GET['locat'] : null;
$smarty->assign('form_location', $location);
$search_type = isset($_GET['search_type']) ? $_GET['search_type'] : null;
$smarty->assign('form_search_type', $search_type);
$parts = isset($_GET['parts']) ? $_GET['parts'] : null;
$smarty->assign('form_parts', $parts);
$note = isset($_GET['note']) ? $_GET['note'] : null;
$smarty->assign('form_note', $note);
# set page title
$smarty->assign('page_title', gtc("Search"));
$smarty->assign('content_title', gtc("Search"));
# populate keyword array
keyword_push(gtc("Search"));
Example #6
0
 * GNU General Public License contained in the file GNU.txt for
 * more details.
 */
/**
 * $Id$
 */
# Ensure this file is being included by a parent file
defined('_RGDS_VALID') or die('Direct access to this file is not allowed.');
# process expected get/post variables
$sn = isset($_GET['sn']) ? $_GET['sn'] : null;
if ($sn == null) {
    $g_alpha = isset($_GET['alpha']) ? $_GET['alpha'] : 'TOP100';
}
$smarty->assign('sn', $sn);
# populate keyword array
keyword_push(gtc("Surname List"));
/**
 * Get the css class based on the selected alpha character
 * @access public
 * @param string $p_alpha
 */
function get_alpha_class($p_alpha)
{
    global $g_alpha;
    $p_alpha = strtoupper($p_alpha);
    if ($p_alpha == $g_alpha) {
        return ' id="selected"';
    } else {
        return '';
    }
}
Example #7
0
$smarty->assign('cnt_events', $cnt_events);
# events - birth
$sql = "SELECT COUNT(*) FROM " . TBL_FACT . " WHERE type='Birth'";
$cnt_events_birth = $db->GetOne($sql);
$smarty->assign('cnt_events_birth', $cnt_events_birth);
# events - death
$sql = "SELECT COUNT(*) FROM " . TBL_FACT . " WHERE type='Death'";
$cnt_events_death = $db->GetOne($sql);
$smarty->assign('cnt_events_death', $cnt_events_death);
# events - marriage
$sql = "SELECT COUNT(*) FROM " . TBL_FACT . " WHERE type='Marriage'";
$cnt_events_marriage = $db->GetOne($sql);
$smarty->assign('cnt_events_marriage', $cnt_events_marriage);
# facts - other
$cnt_events_other = $cnt_events - $cnt_events_birth - $cnt_events_death - $cnt_events_marriage;
$smarty->assign('cnt_events_other', $cnt_events_other);
# notes
$sql = "SELECT COUNT(*) FROM " . TBL_NOTE;
$smarty->assign('cnt_notes', $db->GetOne($sql));
# sources
$sql = "SELECT COUNT(*) FROM " . TBL_SOURCE;
$smarty->assign('cnt_sources', $db->GetOne($sql));
# source citations
$sql = "SELECT COUNT(*) FROM " . TBL_CITATION;
$smarty->assign('cnt_citations', $db->GetOne($sql));
# comments
$sql = "SELECT COUNT(*) FROM " . TBL_COMMENT;
$smarty->assign('cnt_comments', $db->GetOne($sql));
# populate keyword array
keyword_push(gtc("Statistics"));