Jump to content
TNG Community
Janos Dibusz

//do children - show sex

Recommended Posts

Janos Dibusz

I wouldlike showing the sex icon for the children in the page. But this not working.

getperson.php

$gender = getGenderIcon( $row['sex'], -1 );

$famchildren[0] .= "<tr><td valign=\"top\" width=\"10\">$ifkids</td><td onmouseover=\"highlightChild(1,'$childID');\" onmouseout=\"highlightChild(0,'$childID');\" class=\"unhighlightedchild\" id=\"child$childID\"><span class=\"normal\">$kidcount. <a href=\"$getperson_url" . "personID=$childID&amp;tree=$tree\">$childname.$gender</a>";

        if(!$gotfile) {
        if( $gender && $tngconfig['usedefthumbs'] ) {
            if($gender == "M") {
    $photocheck = "img/male.jpg";
            }
         elseif ($gender == "F") {
                $photocheck = "img/female.jpg";
   }
            $photoref = $photocheck;
            $gotfile = file_exists( "$rootpath$photocheck" );
        }
    }

Share this post


Link to post
Share on other sites
manofmull

The male/female images appear already in getperson, and on group sheet/family chart

male.jpgfemale.jpg

Share this post


Link to post
Share on other sites
manofmull

That's the way it's designed. The gender icons would have to be tiny in the children's list, otherwise it would look ugly. Might be worth a suggestion,  though it could be done with a mod.

Share this post


Link to post
Share on other sites
Janos Dibusz

On teh picture which one is the boy and which one is the girl?
So I want here the icon.

family.png

Share this post


Link to post
Share on other sites
Janos Dibusz
26 minutes ago, manofmull said:

Boy is blue (short hair) and girl pink  (long hair)

Other picture. Yellow-braun.

Share this post


Link to post
Share on other sites
bhemph

The tng_male.gif and tng_female.gif files would be small enough to fit and not extend the page.

Is the problem with your code that it is showing the sex of the getperson page instead of the child?  That might be because $row is for the person who the page belongs, while $child would be for the current child in the loop.

Share this post


Link to post
Share on other sites
Janos Dibusz
9 minutes ago, bhemph said:

The tng_male.gif and tng_female.gif files would be small enough to fit and not extend the page.

Is the problem with your code that it is showing the sex of the getperson page instead of the child?  That might be because $row is for the person who the page belongs, while $child would be for the current child in the loop.

Yes, this the problem: if see a male, all children male, if see female, all children female. 
I think here is the problem: $row['sex']

Share this post


Link to post
Share on other sites
Janos Dibusz
10 minutes ago, Janos Dibusz said:

Yes, this the problem: if see a male, all children male, if see female, all children female. 
I think here is the problem: $row['sex']

 

Share this post


Link to post
Share on other sites
tngrlkrz

Janos, I like that.  Could you share here the final code in getperson.php that worked for you? Or send a private message if you wish? Would like to include in my personal mods.  Also, the family preview mod (see image) has a popup which, when hovering over a child, displays the gender symbol. 

Thanks

Ron

2017-09-01_10-53-30.jpg

Share this post


Link to post
Share on other sites
manofmull

I misunderstood the icon thing. Yes this does look good, so maybe someone could "mod" it.

Share this post


Link to post
Share on other sites
tngrlkrz
2 hours ago, manofmull said:

I misunderstood the icon thing. Yes this does look good, so maybe someone could "mod" it.

I've sent Janos a personal message as well. Hope he responds.  I put all my changes to TNG in Mods, but haven't published any.  I could 'Mod'ify the changes. My issue is integrating to the many published Mods and  a large private Mod I have in place now.

I've actually removed the 'gender' row on the individual page since the universal gender symbol is already beneath the name header.

Ron

Share this post


Link to post
Share on other sites
tngrlkrz

After rereading, I see now that Janos appeared to still be having a problem, since 'Katalin' (female?) is appearing as a boy, so as he says if person on page is male, then all children are male, conversedly for female. Needs more work.

Share this post


Link to post
Share on other sites
tngrlkrz

Well, I've got the child's gender as M and F by the name, now I just need to convert to symbols. So far just couple lines of code. Note this is my modified children's rows which include the person ID edit hyperlink at the side as well. I would likely put the symbols after the name, just getting the data available now.

 

2017-09-01_16-39-33.jpg

Share this post


Link to post
Share on other sites
Janos Dibusz
1 hour ago, tngrlkrz said:

Well, I've got the child's gender as M and F by the name, now I just need to convert to symbols. So far just couple lines of code. Note this is my modified children's rows which include the person ID edit hyperlink at the side as well. I would likely put the symbols after the name, just getting the data available now.

 

2017-09-01_16-39-33.jpg

Great job. How you do this?

Share this post


Link to post
Share on other sites
bhemph

Child list.png

 

$gender = getGenderIcon( $child['sex'], -1 );
$persontext .= "<tr><td valign=\"top\" width=\"10\">$ifkids</td><td onmouseover=\"highlightChild(1,'$childID');\" onmouseout=\"highlightChild(0,'$childID');\" class=\"unhighlightedchild\" id=\"child$childID\"><span class=\"normal\">$kidcount. <a href=\"$getperson_url" . "personID=$childID&amp;tree=$tree\">$gender $childname</a>";

Share this post


Link to post
Share on other sites
jayat1familytree

where do you change the code in the getperson.php to get that result ?

 

 

Share this post


Link to post
Share on other sites
bhemph

The "unhighlightedchild" text only exists once in the unmodified 10.1.3 getperson.php and the only part of that line that was changed was to add the $gender in the string.  I am guessing that Janos might be on 11 and that accounts for the code that he posted in the initial post setting a different variable than my code.  So I just changed the row variable to the child variable in that first message as I had suggested was the issue.

Share this post


Link to post
Share on other sites
Janos Dibusz
20 minutes ago, bhemph said:

The "unhighlightedchild" text only exists once in the unmodified 10.1.3 getperson.php and the only part of that line that was changed was to add the $gender in the string.  I am guessing that Janos might be on 11 and that accounts for the code that he posted in the initial post setting a different variable than my code.  So I just changed the row variable to the child variable in that first message as I had suggested was the issue.

Thank you very much, it's great job.

WORKING!!!

Share this post


Link to post
Share on other sites
klooster

It is not working in TNG 11.1.1

where and how do you change the code in the getperson.php TNG 1.1.1 to get that result ?

Share this post


Link to post
Share on other sites
klooster

There is no $gender in TNG. 11.1.1 only $childname.

 

If I change $childname = getName( $child );

into 

$childname = getGenderIcon( $child['sex'], -1 );

I do get the icons but the names are gone

Schermafbeelding 2017-09-02 om 10.39.11.png

Share this post


Link to post
Share on other sites
tngrlkrz

changes I made (TNG 11.1.1.,

sent my phone, blocked on my wifi yesterday with earlier response. Gustav contacted. 

 

Added  one line in 'getperson.php' after the following line (~541) in getperson.php (pristine version), puts gender symbol in front of child's name.           

$childname = getName( $child );  

$childname= getGenderIcon($child['sex']-2)." ".$childname;

You get names too.

 

Ron

 

 

Share this post


Link to post
Share on other sites
klooster

Thanks for the response, but it it is not working, page is cut off:

 

 

Schermafbeelding 2017-09-02 om 21.52.35.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×