Jump to content
TNG Community

//do children - show sex


Janos Dibusz

Recommended Posts

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" );
        }
    }

Link to comment
Share on other sites

  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

  • tngrlkrz

    32

  • Janos Dibusz

    16

  • klooster

    9

  • bhemph

    5

Top Posters In This Topic

Posted Images

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.

Link to comment
Share on other sites

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']

Link to comment
Share on other sites

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']

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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>";

Link to comment
Share on other sites

jayat1familytree

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

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

Schermafbeelding 2017-09-02 om 22.04.37.pngFound the solution, slight error in your code;

 

instead of what you wrote;

$childname = getName( $child );  

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

It should be:

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

 

THANKS again, works great !!

Link to comment
Share on other sites

See correction, sorry, working from phone now until block removed by Gustav.

I actually had this solution last night but got blocked during the submit.😣

 

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