Jump to content
TNG Community

Ability to show a persons First Name ONLY on the Individuals Page


RickM

Recommended Posts

Hi there,

I'm working on TNGv13.0 on a local server at the mo.

I would like to have the ability to show a persons firstname ONLY at various places on the individuals page (I think generated by getperson.php.. I am not a coder and don't seem to be able to find where the getPerson function (I think it is a function) is to work out how to get the firstname ONLY.

Is a kindly person able to help me out either by providing some code that I can insert into getperson.php to generate a way to show the firstname at various places OR by pointing me in the right direction so I can try to figure it out..

Many Thanks in Advance..

Link to comment
Share on other sites

Admin > Setup > General Settings > Names provides the options for how to display names in TNG.  Show First Name Only is not one of the options.

Edited  - Note that the Names > Name Order:  option is for the whole TNG Site, not just the Individual or getperson.php page

Link to comment
Share on other sites

Thanks Ken,

I am hoping to be able to add the first name to specific points on the getperson page. In one instance I would like to show it in the events list heading next to the Events Map.. Example Kirstys' Life Events

 

Link to comment
Share on other sites

Rick, I’m away from home this week but willing to look at it next week. Can you name all the places on the page you want this and I’ll have a play.

Phil

Link to comment
Share on other sites

Phil

You would be a gentleman & scholar!!

Really only in one spot at the moment, that of in the "events list heading" (I have an extra table row in the event list table) next to the Events Map. I am toying with adding to the likes of the various media tables that load depending on what media is attached to the person.. That might be too much though..

I was going to ask Michel author of Show Age at Marriage Mod if he could add the first names in there as well. (Maybe too much already, but maybe an option??) 

This is a snip of what my Event Map looks like. You can see the Events List Heading "Their Life Events". Either add Firstname in there or as part of the Heading EVENT MAP

JHF-EventMap.jpg

If I can be of any help <Smile>..

Many Thanks..

Link to comment
Share on other sites

Famous last words, but I think that should be easy...but disclaimer, I’m not a coder, just an admirer/user of other’s coding. It just needs to pull the first name from the database followed by “‘s Life Events” in that table row you added. I’ll look at it next week unless someone beats me to it. Hard to FTP etc on an iPad 😉

Link to comment
Share on other sites

Hey Phil,

 

No rush and like you I am no coder but can plagiarise.. I wondered about having to query the database (hmmmmmmm def not good at that one) I will have a peek myself, but I am currently working on getting other media type tables to have the labels across the top of the table such as the Event Map..

Next time I am down that way I must make time to meet you (if you would be ok with that <smile>). That may be late Nov or Christmas/New Year.

Enjoy the weekend..

Link to comment
Share on other sites

OK, I think I have bitten off more than I can chew on this one...but I did get it running on a test site.

getperson.php

Line 602 is....

$persontext .= "<td class=\"databack\"><div style=\"height:{$mapheight};\" id=\"mapevents\"><table cellpadding=\"4\" class=\"whiteback\">\n";
		

AFTER that, add....

$persontext .= ($row['firstname']);
$persontext .= "'s Life Events";

I literally stole that code from elsewhere and it works for me...although it pulls all first names. I also haven't bothered about styling as (a) to each their own and (b) everyone has different templates.

Let me know how you get on....but if you need more help, I don't think I'll be able to do much more.

Phil

Link to comment
Share on other sites

  • 2 weeks later...

Hi Phil

Hey really sorry.. I totally missed this post, and have only just found it.. Really weird that I have missed it.. But there you go..

That was pretty damned smart work (unyet tried) and maybe now another really smart person might be able to help better moving forward..

I will have a play about and see what comes of it..

Very much appreciate your effort..

Thank YOU!

 

Link to comment
Share on other sites

Phil,

I took your suggestion and added it to my site, with a few changes due to the way I have made other changes within getperson.php.. I have also improved upon it by adding the ability to use the persons 'Nickname' IF they have one..

        $personname = "";
            if ($row['nickname']) {
                $personname = $row['nickname'];
            }
            else
                $personname = $row['firstname'];

It works here at alineofmalkins John Henry Falloon this is with my modifications written in getperson.php TNG V 12.3

Doing it for a virgin install of TNG v13 would probably be

      if ($row['nickname']) {
                $persontext .= $row['nickname'];
            }
            else {
                $persontext .= $row['firstname'];
			}
	$persontext .= "'.s Life Events";

I Think!! 😁 and should work for TNG V 12.3 as well.

 

Many THANKS for figuring that out for me Phil.. I hope you can use it too!! Let me know if you would like to use some of my other changes.. I am currently doing them up in a mod or two for TNG v13.0 for my 'Private Use'. I will be looking to truncate the firstname to just the first name so instead of 'John Henry's' is will be 'John's' because some folk have REALLY long names..

FOLK SHOULD NOTE: If you are going to try this code change out, in each case these changes may affect Mods already installed so making changes are at your risk..

Mods I am pretty sure are NOT affected (I have them installed on both TNG v12.3 and TNG v13.0)

Show Age at Marriage

Ancestor Map

Cemetery Burials Table

Fixed Family Tab

Lat-Long NSEW

OpenStreetMap

Show Nicknames

and

Tables of Descendants

Cheers @Philip Roy

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...