当前位置: 首页>>代码示例>>PHP>>正文


PHP DateUtil::ged_date方法代码示例

本文整理汇总了PHP中DateUtil::ged_date方法的典型用法代码示例。如果您正苦于以下问题:PHP DateUtil::ged_date方法的具体用法?PHP DateUtil::ged_date怎么用?PHP DateUtil::ged_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DateUtil的用法示例。


在下文中一共展示了DateUtil::ged_date方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: print_person

function print_person($search, $per)
{
    global $famarray;
    // if trying to access a restriced person
    if (!$per->isExportable()) {
        return;
    }
    $config = Config::getInstance();
    //get surename right for gedcom NAME field
    //if there is just one name filled in name and surname
    $surname = "";
    if ($per->name->link != "") {
        $surname = $per->name->link;
    }
    $surname .= $per->name->surname;
    if ($per->name->suffix != "") {
        $surname .= $per->name->suffix;
    }
    if ($per->name->forenames != "") {
        $ged_name = $per->name->forenames . " /" . $surname . "/";
    } else {
        $ged_name = $surname;
    }
    //If this person was previously imported from a gedcom file then use that id
    $id = $per->person_id;
    $gdao = getGedcomDAO();
    $gedids = $gdao->getReferences($id);
    if (count($gedids) === 1) {
        $id = $gedids[0]["gedrefid"];
    }
    output_ged(0, "@", $id, "@ INDI");
    output_ged(1, "NAME ", $ged_name);
    output_ged(2, "GIVN ", $per->name->forenames);
    if ($per->name->link != "") {
        output_ged(2, "SPFX ", $per->name->link);
    }
    output_ged(2, "SURN ", $surname);
    if ($per->name->title != "") {
        output_ged(2, "NPFX ", $per->name->title);
    }
    if ($per->name->suffix != "") {
        output_ged(2, "NSFX ", $per->name->suffix);
    }
    if ($per->name->knownas != "") {
        output_ged(2, "NICK ", $per->name->knownas);
    }
    output_ged(1, "SEX ", $per->gender);
    $edao = getEventDAO();
    $e = new Event();
    $e->person->person_id = $per->person_id;
    $edao->getEvents($e, Q_BD, true);
    $sdao = getSourceDAO();
    $classes = array("1 BIRT", "1 BAPM", "1 DEAT", "1 BURI");
    foreach ($e->results as $e) {
        if ($e->hasData()) {
            echo $classes[$e->type] . "\n";
            $events[$e->type] = $e;
            #			$sdao->getEventSources($e);
            echo DateUtil::full_ged_date1($e);
            if ($e->location->place != "") {
                output_ged(2, "PLAC ", $e->location->place);
            }
            if ($e->type == DEATH_EVENT && $per->death_reason != "") {
                output_ged(2, "CAUS ", $per->death_reason);
            }
            if ($e->notes != "") {
                echo "2 NOTE\n";
                output_ged(3, "CONT ", $e->notes);
                if (isset($e->source) && $e->source != "") {
                    output_ged(2, "SOUR ", $e->source->title);
                } else {
                    output_ged(3, "SOUR ", "phpmyfamily");
                }
            }
        }
    }
    if ($per->mother->person_id != "00000" and $per->father->person_id != "00000") {
        $famc = $per->father->person_id . $per->mother->person_id;
        output_ged(1, "FAMC @", $famc . "@");
        if (!array_key_exists($famc, $famarray)) {
            $famarray[$famc] = array();
        }
        $famarray[$famc][] = $per;
    }
    if ($per->narrative != "") {
        //Textfield could have Returns, separate them in gedcom CONT lines
        $narrative = preg_replace("/\n/", "\n2 CONT ", $per->narrative);
        output_ged(1, "NOTE ", $narrative);
    }
    $exploded = explode(" ", $per->updated);
    $updated = DateUtil::ged_date($exploded[0]);
    echo "1 CHAN\n";
    output_ged(2, "DATE ", $updated);
    //find photos
    $eid = -1;
    $sid = -1;
    $images = new Image();
    $images->person = $per;
    $idao = getImageDAO();
    $idao->getImages($images);
//.........这里部分代码省略.........
开发者ID:redbugz,项目名称:rootstech2013,代码行数:101,代码来源:gedcom.php

示例2: full_ged_date1

 static function full_ged_date1($event)
 {
     $date = "";
     if ($event->date1 != "0000-00-00") {
         $date = "2 DATE ";
         $mod = "";
         switch ($event->date1_modifier) {
             case 9:
                 //	"In"
             //	"In"
             case 1:
                 //  "About"
                 $mod = "ABT ";
                 break;
             case 2:
                 // "Circa"
             // "Circa"
             case 3:
                 // "Estimated
             // "Estimated
             case 4:
                 // "Roughly"
                 $mod = "EST ";
                 break;
             case 5:
                 // Calculated
                 $mod = "CAL ";
                 break;
             case 6:
                 // "Before"
                 $mod = "BEF ";
                 break;
             case 7:
                 // "After"
                 $mod = "AFT ";
                 break;
         }
         $date .= $mod;
         $date .= DateUtil::ged_date($event->date1);
         $date .= "\n";
     }
     return $date;
 }
开发者ID:redbugz,项目名称:rootstech2013,代码行数:43,代码来源:DateUtil.php


注:本文中的DateUtil::ged_date方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。