Jump to content
TNG Community

Name and Nickname


Korycki

Recommended Posts

Hello,

I need help with the placing/showing the nickname. As you can see on the screenshot the title and the prefix go before the name as should but the nickname is not showing in the bold letters above, it is showing up only in the description.

IPB Image

I would like to have the nickname showing up after first name and before the lastname but I have no idea how to do that. Please help.

Thank you,

Piotr Korycki

IPB Image

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

I need help with the placing/showing the nickname. As you can see on the screenshot the title and the prefix go before the name as should but the nickname is not showing in the bold letters above, it is showing up only in the description.

The way I did it was to edit a few lines in globallib.php, adding in the nickname variable.

this function at line 55 (edited)

function constructName($firstnames, $nicknames, $lastnames, $suffix, $order) {
    $nn .= "";
    if($nicknames) $nn .= "\"$nicknames\"";
    switch($order) {
        case "3":
            if($lastnames && $firstnames) $lastnames .= ",";
            $namestr = trim("$lastnames $firstnames $nn $suffix");
            break;
        case "2":
            $namestr = trim("$lastnames $firstnames $nn");
            if($suffix) $namestr .= ", $suffix";
            break;
        default:
            $namestr = trim("$firstnames $nn $lastnames");
            if($suffix) $namestr .= ", $suffix";
            break;
    }

    return $namestr;
}
then lines 102 and 110 in this function
function getNameUniversal($row, $order) {
    global $text, $admtext, $tngconfig, $nonames;

    //$nonames = showNames($row);
    $lastname = trim( $row['lnprefix']." ".$row['lastname'] );
    if($tngconfig['ucsurnames']) $lastname = tng_strtoupper($lastname);
    $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 = trim( $title . " " .$row['firstname'] );
        $namestr = constructName($firstname, $row['nickname'], $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 = trim( $title . " " . initials( $row['firstname']) );
        $namestr = constructName($firstname, $row['nickname'], $lastname, $row['suffix'], $order);
    }

    return $namestr;

Link to comment
Share on other sites

  • 1 year later...

Thank You!

To protect against future upgrades (getperson.php is almost always changed at an upgrade) these changes should be incorporated in a mod.

There is already a mod on the TNG Wiki that does something similar: Show Nicknames

Link to comment
Share on other sites

To protect against future upgrades (getperson.php is almost always changed at an upgrade) these changes should be incorporated in a mod.

There is already a mod on the TNG Wiki that does something similar: Show Nicknames

Just a comment to demonstrate how I handle 'nicknames'. Rather than create a separate Tag, I incorporate a nickname in the First Name tag in my gedcom, ex: Glenn Glessner 'Gladstone' BILLER.

ex: http://www.ourfamilysaga.com/getperson.php...;tree=ourfam001

I include these comments in my 'What's New' page to aide visitors:

"Searching for someone in our database

You can search by name for a person by utilizing the Search boxes visible in the header area of each page of our website. Utilizing these search boxes you can search for a person by their Nickname only or Nickname + Last Name because some folks were never or rarely known by their real names... "

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...