示例#1
0
function get_person_china_full_name($id, $type)
{
    $chinaGenDatas = get_person_china_generation_name($id);
    $chinaGenData = mysql_fetch_assoc($chinaGenDatas);
    $chinaNameDatas = get_person_china_name($id);
    $chinaNameData = mysql_fetch_assoc($chinaNameDatas);
    $gender = get_gender($id);
    if ($type == 0 && $gender == 2) {
        return "林(" . $chinaGenData['GENERATION_NAME'] . ")" . $chinaNameData['CHINANAME_NAME'];
    } else {
        if ($type == 1 && $gender == 2) {
            return "lin (" . $chinaGenData['GENERATION_PINYIN'] . ") " . $chinaNameData['CHINANAME_PINYIN'];
        } else {
            if ($type == 2 && $gender == 2) {
                return "ลื้ม (" . $chinaGenData['GENERATION_TH'] . ") " . $chinaNameData['CHINANAME_TH'];
            } else {
                if ($type == 0) {
                    return "林" . $chinaGenData['GENERATION_NAME'] . $chinaNameData['CHINANAME_NAME'];
                } else {
                    if ($type == 1) {
                        return "lin " . $chinaGenData['GENERATION_PINYIN'] . " " . $chinaNameData['CHINANAME_PINYIN'];
                    } else {
                        if ($type == 2) {
                            return "ลื้ม " . $chinaGenData['GENERATION_TH'] . " " . $chinaNameData['CHINANAME_TH'];
                        }
                    }
                }
            }
        }
    }
}
示例#2
0
function generate_xr_projects($projects, $parameters)
{
    $spam_mode = $parameters['spam_mode'];
    $xr_label = $parameters['xr_label'];
    $xr_tpl = $parameters['xr_tpl'];
    //$content = preg_replace("/\[BANER\-$W\-$H\]/",get_baner($W,$H),$content,1);
    $tpl_name = $xr_tpl['tpl_name'];
    $tpl_content = $xr_tpl['tpl_content'];
    $id_mail_type = $xr_tpl['id_mail_type'];
    $id_hp_links = $xr_tpl['id_hp_links'];
    $id_sign_links = $xr_tpl['id_sign_links'];
    $id_post_links = $xr_tpl['id_post_links'];
    $lang = $xr_tpl['lang'];
    $rand_text = $xr_tpl['rand_text'];
    //echo get_nick_mask("NICK_MASK-3-8") ;
    //exit;
    foreach ($projects as $project) {
        //print_r($project);
        $tpl = $tpl_content;
        $project_names = get_project_names();
        //$tpl = preg_replace("/\[NICK\_MASK\-$X\-$Y\]/",get_nick_mask("NICK_MASK-$X-$Y"),$tpl,1);
        //$tpl = preg_replace('/\[NICK_MASK\-(\d+)\-(\d+)\]/',get_nick_mask("NICK_MASK-$1-$2"),$tpl);
        //$tpl = str_replace('NICK_MASK',get_nick_mask(),$tpl);
        $HOME_RAND_URL_VARS = get_home_rand_url_vars($id_hp_links, $project);
        $NICK_MASK = get_nick_mask();
        $CITY = get_city();
        $city = $CITY['city'];
        $country = $CITY['country'];
        $occupation = get_occupation($lang);
        $interest = get_interest($lang);
        $genders = get_gender();
        $gender = $genders['gender'];
        $firstname = ucfirst(strtolower($genders['firstname']));
        echo $gender . "\n" . $firstname;
        exit;
        //разделение по типам проектов
        # Href:
        $href_tpl = $tpl;
        $href_project_name = $project_names['Href'];
    }
}
 $bx->box_title($t->translate("Personal Data"));
 $bx->box_body_begin();
 echo "<table border=0 width=100% align=center cellspacing=3 cellpadding=3>\n";
 //echo "<tr><td align=right width=30%>".$t->translate("Username").":</td><td width=70%> $username\n";
 if ($db->f("showname") == "yes") {
     echo "<tr><td align=right width=30%>" . $t->translate("Realname") . ":</td><td width=70%>" . $db->f("realname") . "\n";
 }
 $year_of_birth = $db->f("year_of_birth");
 if ($year_of_birth == "0") {
     $year_of_birth = $t->translate("No Entry");
 } else {
     $year_of_birth = "19" . $year_of_birth;
 }
 echo "<tr><td align=right width=30%>" . $t->translate("Year of Birth") . ":</td><td width=70%>{$year_of_birth}\n";
 $gendid = $db->f("gender");
 $gender = get_gender($gendid);
 echo "<tr><td align=right width=30%>" . $t->translate("Gender") . ":</td><td width=70%>" . $t->translate("{$gender}") . "\n";
 $nationality = $db->f("nationality");
 echo "<tr><td align=right width=30%>" . $t->translate("Nationality") . ":</td><td width=70%>\n";
 print_country($nationality);
 $actual_country = $db->f("actual_country");
 echo "<tr><td align=right width=30%>" . $t->translate("Currently lives in") . ":</td><td width=70%>\n";
 print_country($actual_country);
 echo "<tr><td align=right valign=top width=30%>" . $t->translate("Mother tongue") . ":</td><td width=70%>\n";
 $mother_tongue = $db->f("mother_tongue");
 print_lang($mother_tongue);
 echo "<tr><td align=right valign=top width=30%>" . $t->translate("Other languages") . ":</td><td width=70%>\n";
 $other_lang_1 = $db->f("other_lang_1");
 echo "1. ";
 print_lang($other_lang_1);
 $other_lang_2 = $db->f("other_lang_2");
function child_of($p, $url = './family.php')
{
    global $_son, $_daughter, $_child, $_of, $_and;
    $str = '';
    if (has_parents($p)) {
        $gender = get_gender($p);
        if ($gender == 0) {
            $ch = $_child;
        } elseif ($gender == 1) {
            $ch = $_son;
        } elseif ($gender == 2) {
            $ch = $_daughter;
        }
        $father = find_father($p);
        $mother = find_mother($p);
        if ($father && $mother) {
            $str = paren("{$ch} {$_of} " . linked_name($father, $url) . " {$_and} " . linked_name($mother, $url));
        } elseif ($father) {
            $str = paren("{$ch} {$_of} " . linked_name($father, $url));
        } elseif ($mother) {
            $str = paren("{$ch} {$_of} " . linked_name($mother, $url));
        }
    }
    return $str;
}
示例#5
0
    ?>
</td>
					<td><?php 
    echo $record[$i]->email;
    ?>
</td>
					<td><?php 
    echo $record[$i]->created_at;
    ?>
</td>
					<td><?php 
    echo $record[$i]->ip;
    ?>
</td>
					<td><?php 
    echo get_gender($record[$i]->gender);
    ?>
</td>
					<td><?php 
    echo substr($record[$i]->birthday, 0, 10);
    ?>
</td>
					<td><?php 
    echo get_status($record[$i]->baby_status);
    ?>
</td>
					<td>
						<!--  
						<a href="edit_info.php?id=<?php 
    echo $record[$i]->id;
    ?>
示例#6
0
function build_tree($p)
{
    // The indices of the tree array are plain Sosa-Stradonitz numbers.
    // The proband is number 1. The father of any person P in the pedigree
    // has index P * 2, the mother of P has P * 2 + 1. Missing persons are
    // assigned a 0.
    $tree_array[1] = $p;
    // hunt down ancestors
    for ($i = 1; $i < 16; $i++) {
        if ($tree_array[$i]) {
            $tree_array[$i * 2] = find_father($tree_array[$i]);
        } else {
            $tree_array[$i * 2] = 0;
        }
        if ($tree_array[$i]) {
            $tree_array[$i * 2 + 1] = find_mother($tree_array[$i]);
        } else {
            $tree_array[$i * 2 + 1] = 0;
        }
    }
    // populate name array
    $name[1] = get_name_and_dates('./family.php', $p);
    for ($i = 2; $i < 32; $i++) {
        if ($tree_array[$i]) {
            $name[$i] = get_name_and_dates('', $tree_array[$i]);
        } else {
            $name[$i] = '';
        }
    }
    // if a gggparent has registered ancestors, append right arrow
    for ($i = 16; $i < 32; $i++) {
        if (has_parents($tree_array[$i])) {
            $name[$i] .= "</td><td rowspan=\"2\"><img src=\"./graphics/arr_rt.gif\" alt=\"\" />";
        }
    }
    if (get_gender($p) == 1) {
        $pcolor = 'blue';
    } elseif (get_gender($p) == 2) {
        $pcolor = 'red';
    } else {
        $pcolor = 'green';
    }
    // The following vars are space-saving abbreviations for the matrix below.
    // Each line in the matrix, except for the proband, occupies *two* table rows.
    // The reason is of course that the lines and angles are done with pure CSS.
    // Even if it's actually validating with W3C, the semantic fundamentalists
    // will hold their noses over such blatant table abuse. I may consider
    // rewriting it for SVG when IE supports it out of the box, and all earlier
    // versions of IE have gone to bit heaven. (I'm probably pushing up daisies
    // myself before that happens.) Until then, this format is understood by all
    // browsers more recent than Netscape 4. It's even (sort of) working in Lynx.
    // two empty cells
    $ec = "<td>&nbsp;</td><td>&nbsp;</td>";
    // four empty cells in a two-by-two block
    $eb = "<td rowspan=\"2\" colspan=\"2\">&nbsp;</td>";
    // a red box for a female ancestor
    $red = "<td rowspan=\"2\" colspan=\"2\" class=\"red\">";
    // a blue box for a male ancestor
    $blue = "<td rowspan=\"2\" colspan=\"2\" class=\"blue\">";
    // a box for the proband
    $proband = "<td colspan=\"2\" class=\"{$pcolor}\">";
    // the upper angle to a father box
    $tf = "<td>&nbsp;</td><td class=\"tofath\">&nbsp;</td>";
    // the lower angle to a mother box
    $tm = "<td>&nbsp;</td><td class=\"tomoth\">&nbsp;</td>";
    // vertical line
    $vl = "<td>&nbsp;</td><td class=\"vline\">&nbsp;</td>";
    // table row end and newline
    $nl = "</tr>\n<tr>";
    // The Matrix From Hell. Don't mess with it. Note that every line in
    // the matrix is conditional, no need to print empty boxes.
    echo "<table cellspacing=\"0\"><!-- the pedigree monster table -->\n";
    if ($name[16]) {
        echo "<tr>{$eb}{$eb}{$eb}{$ec}{$blue} 16 {$name['16']}</td>{$nl}{$tf}</tr>\n";
    }
    if ($name[8]) {
        echo "<tr>{$eb}{$eb}{$ec}{$blue} 8 {$name['8']}</td>{$eb}{$nl}{$tf}</tr>\n";
    }
    if ($name[17]) {
        echo "<tr>{$eb}{$eb}{$vl}{$tm}{$red} 17 {$name['17']}</td>{$nl}{$vl}{$ec}</tr>\n";
    }
    if ($name[4]) {
        echo "<tr>{$eb}{$ec}{$blue} 4 {$name['4']}</td>{$eb}{$eb}{$nl}{$tf}</tr>\n";
    }
    if ($name[18]) {
        echo "<tr>{$eb}{$vl}{$vl}{$ec}{$blue} 18 {$name['18']}</td>{$nl}{$vl}{$vl}{$tf}</tr>\n";
    }
    if ($name[9]) {
        echo "<tr>{$eb}{$vl}{$tm}{$red} 9 {$name['9']}</td>{$eb}{$nl}{$vl}{$ec}</tr>\n";
    }
    if ($name[19]) {
        echo "<tr>{$eb}{$vl}{$eb}{$tm}{$red} 19 {$name['19']}</td>{$nl}{$vl}{$ec}</tr>\n";
    }
    if ($name[2]) {
        echo "<tr>{$ec}{$blue} 2 {$name['2']}</td>{$eb}{$eb}{$eb}{$nl}{$tf}</tr>\n";
    }
    if ($name[20]) {
        echo "<tr>{$vl}{$vl}{$eb}{$ec}{$blue} 20 {$name['20']}</td>{$nl}{$vl}{$vl}{$tf}</tr>\n";
    }
    if ($name[10]) {
        echo "<tr>{$vl}{$vl}{$ec}{$blue} 10 {$name['10']}</td>{$eb}{$nl}{$vl}{$vl}{$tf}</tr>\n";
    }
    if ($name[21]) {
        echo "<tr>{$vl}{$vl}{$vl}{$tm}{$red} 21 {$name['21']}</td>{$nl}{$vl}{$vl}{$vl}{$ec} </tr>\n";
    }
    if ($name[5]) {
        echo "<tr>{$vl}{$tm}{$red} 5 {$name['5']}</td>{$eb}{$eb}{$nl}{$vl}{$ec}</tr>\n";
    }
    if ($name[22]) {
        echo "<tr>{$vl}{$eb}{$vl}{$ec}{$blue} 22 {$name['22']}</td>{$nl}{$vl}{$vl}{$tf}</tr>\n";
    }
    if ($name[11]) {
        echo "<tr>{$vl}{$eb}{$tm}{$red} 11 {$name['11']}</td>{$eb}{$nl}{$vl}{$ec}</tr>\n";
    }
    if ($name[23]) {
        echo "<tr>{$vl}{$eb}{$eb}{$tm}{$red} 23 {$name['23']}</td>{$nl}{$vl}{$ec}</tr>\n";
    }
    echo "<tr>{$proband} 1 {$name['1']}</td>{$ec}{$ec}{$ec}{$ec}</tr>\n";
    if ($name[24]) {
        echo "<tr>{$vl}{$eb}{$eb}{$ec}{$blue} 24 {$name['24']}</td>{$nl}{$vl}{$tf}</tr>";
    }
    if ($name[12]) {
        echo "<tr>{$vl}{$eb}{$ec}{$blue} 12 {$name['12']}</td>{$eb}{$nl}{$vl}{$tf}</tr>\n";
    }
    if ($name[25]) {
        echo "<tr>{$vl}{$eb}{$vl}{$tm}{$red} 25 {$name['25']}</td>{$nl}{$vl}{$vl}{$ec}</tr>\n";
    }
    if ($name[6]) {
        echo "<tr>{$vl}{$ec}{$blue} 6 {$name['6']}</td>{$eb}{$eb}{$nl}{$vl}{$tf}</tr>\n";
    }
    if ($name[26]) {
        echo "<tr>{$vl}{$vl}{$vl}{$ec}{$blue} 26 {$name['26']}</td>{$nl}{$vl}{$vl}{$vl}{$tf}</tr>\n";
    }
    if ($name[13]) {
        echo "<tr>{$vl}{$vl}{$tm}{$red} 13 {$name['13']}</td>{$eb}{$nl}{$vl}{$vl}{$ec}</tr>\n";
    }
    if ($name[27]) {
        echo "<tr>{$vl}{$vl}{$eb}{$tm}{$red} 27 {$name['27']}</td>{$nl}{$vl}{$vl}{$ec}</tr>\n";
    }
    if ($name[3]) {
        echo "<tr>{$tm}{$red} 3 {$name['3']}</td>{$eb}{$eb}{$eb}{$nl}{$ec}</tr>\n";
    }
    if ($name[28]) {
        echo "<tr>{$eb}{$vl}{$eb}{$ec}{$blue} 28 {$name['28']}</td>{$nl}{$vl}{$tf}</tr>\n";
    }
    if ($name[14]) {
        echo "<tr>{$eb}{$vl}{$ec}{$blue} 14 {$name['14']}</td>{$eb}{$nl}{$vl}{$tf}</tr>\n";
    }
    if ($name[29]) {
        echo "<tr>{$eb}{$vl}{$vl}{$tm}{$red} 29 {$name['29']}</td>{$nl}{$vl}{$vl}{$ec}</tr>\n";
    }
    if ($name[7]) {
        echo "<tr>{$eb}{$tm}{$red} 7 {$name['7']}</td>{$eb}{$eb}{$nl}{$ec}</tr>\n";
    }
    if ($name[30]) {
        echo "<tr>{$eb}{$eb}{$vl}{$ec}{$blue} 30 {$name['30']}</td>{$nl}{$vl}{$tf}</tr>\n";
    }
    if ($name[15]) {
        echo "<tr>{$eb}{$eb}{$tm}{$red} 15 {$name['15']}</td>{$eb}{$nl}{$ec}</tr>\n";
    }
    if ($name[31]) {
        echo "<tr>{$eb}{$eb}{$eb}{$tm}{$red} 31 {$name['31']}</td>{$nl}{$ec}</tr>\n";
    }
    echo "</table>\n";
}
require "../functions.php";
require "./forms.php";
if (!isset($_POST['posted'])) {
    $person = isset($_GET['person']) ? $_GET['person'] : 0;
    if (isset($_GET['addparent'])) {
        $child = $_GET['person'];
        $gender = $_GET['gender'];
    } else {
        $child = 0;
        $gender = 0;
    }
    $spouse = 0;
    $spgender = 0;
    if (isset($_GET['addspouse'])) {
        $spouse = $_GET['person'];
        $spgender = get_gender($spouse);
        if ($spgender == 1) {
            $gender = 2;
        }
        if ($spgender == 2) {
            $gender = 1;
        }
    }
    $father = isset($_GET['father']) ? $_GET['father'] : 0;
    $mother = isset($_GET['mother']) ? $_GET['mother'] : 0;
    $title = "{$_Add}";
    if ($father && $mother) {
        $title .= " {$_child} {$_of} " . get_name($father) . " {$_and} " . get_name($mother);
    } elseif ($father) {
        $title .= " {$_child} {$_of} " . get_name($father);
    } elseif ($mother) {
            echo "</ul>\n";
        }
        echo "</li>\n";
    }
    echo "</ol>\n";
}
// *****************************************************************************
// section II: print list of relations cited by this source
// *****************************************************************************
if ($props['number_of_relations']) {
    $child[1] = $_son;
    $child[2] = $_daughter;
    echo "<h3>{$_Relations}:</h3>\n<ol>";
    $handle = pg_query("\n        SELECT\n            r.relation_id,\n            r.parent_fk,\n            r.child_fk,\n            get_lsurety(r.surety_fk) AS surety\n        FROM\n            relations r,\n            relation_citations c\n        WHERE\n            c.relation_fk = r.relation_id\n        AND\n            c.source_fk = {$self}\n        ORDER BY\n            get_pbdate(r.child_fk),\n            r.child_fk,\n            get_gender(r.parent_fk)\n    ");
    while ($row = pg_fetch_assoc($handle)) {
        echo li(linked_name($row['child_fk'], './family.php') . " {$_is} " . $row['surety'] . ' ' . $child[get_gender($row['child_fk'])] . " {$_of} " . linked_name($row['parent_fk'], './family.php'));
    }
    echo "</ol>\n";
}
// *****************************************************************************
// section III: print list of subsources
// *****************************************************************************
if ($props['number_of_subsources']) {
    echo "<h3>{$_Subsources}:</h3>\n";
    echo "<table>";
    $handle = pg_query("\n        SELECT\n            source_id,\n            link_expand(source_text) AS txt,\n            sort_order,\n            source_date,\n            ecc(source_id) AS e,\n            rcc(source_id) AS r,\n            ssc(source_id) AS s,\n            usc(source_id) AS u,\n            spt.{$label} AS {$label}\n        FROM\n            sources, source_part_types spt\n        WHERE\n            spt.part_type_id = sources.part_type\n        AND\n            parent_id = {$self}\n        AND\n            source_id <> 0\n        ORDER BY\n            sort_order,\n            source_date,\n            source_text\n    ");
    // change between FALSE and TRUE to select terse / informative mode
    $friendly = TRUE;
    while ($row = pg_fetch_assoc($handle)) {
        $id = $row['source_id'];
        echo '<tr>';