예제 #1
0
function getNameUniversal($row, $order, $hcard = null)
{
    global $text, $admtext, $tngconfig, $nonames;
    //$nonames = showNames($row);
    $lastname = trim($row['lnprefix'] . " " . $row['lastname']);
    if ($tngconfig['ucsurnames']) {
        $lastname = tng_strtoupper($lastname);
    }
    if ($hcard) {
        $lastname = "<span class=\"family-name\">" . $lastname . "</span>";
    }
    $title = $row['title'] && $row['title'] == $row['prefix'] ? $row['title'] : trim($row['title'] . " " . $row['prefix']);
    if (($row['allow_living'] || !$nonames) && ($row['allow_private'] || !$tngconfig['nnpriv'])) {
        $firstname = $hcard ? "<span class=\"given-name\">" . $row['firstname'] . "</span>" : $row['firstname'];
        $firstname = trim($title . " " . $firstname);
        $namestr = constructName($firstname, $lastname, $row['suffix'], $order);
    } elseif ($row['living'] && !$row['allow_living'] && $nonames == 1) {
        $namestr = $text['living'];
    } elseif ($row['private'] && !$row['allow_private'] && $tngconfig['nnpriv'] == 1) {
        $namestr = $admtext['text_private'];
    } else {
        //initials
        $firstname = $hcard ? "<span class=\"given-name\">" . initials($row['firstname']) . "</span>" : initials($row['firstname']);
        $firstname = trim($title . " " . $firstname);
        $namestr = constructName($firstname, $lastname, $row['suffix'], $order);
    }
    if ($hcard) {
        $namestr = "<span class=\"n\">{$namestr}</span>";
    }
    return $namestr;
}
예제 #2
0
파일: genlib.php 프로젝트: seta-hungnh/test
function getSurnameOnly($row)
{
    global $text, $admtext, $tngconfig;
    $nonames = showNames($row);
    if ($row['allow_living'] || $nonames != 1) {
        $namestr = trim($row['lnprefix'] . " " . $row['lastname']);
        if ($tngconfig['ucsurnames']) {
            $namestr = tng_strtoupper($namestr);
        }
    } elseif ($row['private']) {
        $namestr = $admtext['text_private'];
    } else {
        $namestr = $text['living'];
    }
    return $namestr;
}