Jump to content
TNG Community

Display descendants with Living flag set


Ken Roy

Recommended Posts

Have you ever wanted to see who had a Living flag set when no birth date was shown in a Descendant list?

If so you can make the following modification to descend.php to work in conjuction with the script to backup the living flags in the following post http://www.tngforum.us/index.php?s=&showto...findpost&p=4564

After Line Line 97 (before any changes) after global $text; - add following global

global $allow_admin;    
after Line 117 (before any changes) just before the return $vitalinfo; - add following code
      if ( $allow_admin ) {
            if ( $row[living]){
              $vitalinfo .= " - $text[living] ";
        }
        else  {
            $vitalinfo .= " ";
        }
        }

The above code will add - Living after the birth and death information as for the descendants listed. So if a person has no birth date, you will see - Living if the living flag is set, when you are logged in with Admin privilege. You will also be able to see if you have the living flag set for persons with a death date. This code checks for users logged in with Admin privilege, so visitors and logged in users without Admin privilege will continue to see what the saw before.

This modification is handy if you have a lot of living relatives in your database where you also have no birth date information. It allowed me to see an additional 300 Living flags this morning.

The Backup and Restore Living flag script above also allows for replacing all data and re-applying the living flags, provided person IDs have not changed.

Link to comment
Share on other sites

  • 4 months later...

For Version 6, the mod to display the Living flag has moved to the descendtext.php file as follows in the

function getVitalDates

added after Line 98 (before any changes) after global $text;

    global $allow_admin;    
added after Line 118 (V5.1.4) after line 121 in V6.0 (before any changes) just before the return $vitalinfo;
        if ( $allow_admin ) {
            if ( $row[living]){
              $vitalinfo .= " - $text[living] ";
        }
        else  {
            $vitalinfo .= " ";
        }
        }

Link to comment
Share on other sites

  • 4 months later...

Ken,

Nice feature....

At some point in time I had this implemented and the text living used the color green, now it is the same color as the other text. I can't seem to figure out how to do this or find another reference on this.

Is it possible to do this?

Scotty

For Version 6, the mod to display the Living flag has moved to the descendtext.php file as follows in the

added after Line 98 (before any changes) after global $text;

    global $allow_admin;    
added after Line 118 (V5.1.4) after line 121 in V6.0 (before any changes) just before the return $vitalinfo;
        if ( $allow_admin ) {
            if ( $row[living]){
              $vitalinfo .= " - $text[living] ";
        }
        else  {
            $vitalinfo .= " ";
        }
        }

Link to comment
Share on other sites

Ken,

Nice feature....

At some point in time I had this implemented and the text living used the color green, now it is the same color as the other text. I can't seem to figure out how to do this or find another reference on this.

Is it possible to do this?

Scotty

Scotty,

To display the Living text in green use the following code

        if ( $allow_admin ) {
            if ( $row[living]){
              $vitalinfo .= " - <span style=\"color: green\">$text[living]</span> ";
        }
        else  {
            $vitalinfo .= " ";
        }
        }

Link to comment
Share on other sites

Scotty,

To display the Living text in green use the following code

        if ( $allow_admin ) {
            if ( $row[living]){
              $vitalinfo .= " - <span style=\"color: green\">$text[living]</span> ";
        }
        else  {
            $vitalinfo .= " ";
        }
        }

Thanx Ken,

Making that in a different color other than the text makes it really stand out.

Scotty

Link to comment
Share on other sites

  • 7 months later...

Ken,

I put this back into 6.1.2 and can't get it to work..... it did work in 6.1.1

I've looked at both versions but don't know enough to figure it out.

Any chance you could look at this.

Scotty

Scotty,

The usermod to display the living flag in descendtext.php for TNG 6.1.2 should be added as follows

Before line 137

return $vitalinfo;
add the following code
        if ( $allow_admin ) {
            if ( $row[living]){
              $vitalinfo .= " - <span style=\"color: green\">$text[living]</span> ";
        }
        else  {
            $vitalinfo .= " ";
        }
        }    // added by Ken Roy to display Living flag if logged in as Admin
and after lines 112-113
function getVitalDates( $row ) { global $text;
add the following
    global $allow_admin;    // added by Ken Roy to display Living flag if logged in as Admin

You should be able to use a utility like WinMerge to compare the TNG 6.1.2 version of descendtext.php and the modified version of TNG 6.1.1 of the same module. The mod appears to be in the same location as it was in TNG 6.1.1

Link to comment
Share on other sites

Scotty,

The usermod to display the living flag in descendtext.php for TNG 6.1.2 should be added as follows

Before line 137

add the following code

        if ( $allow_admin ) {
            if ( $row[living]){
              $vitalinfo .= " - <span style=\"color: green\">$text[living]</span> ";
        }
        else  {
            $vitalinfo .= " ";
        }
        }    // added by Ken Roy to display Living flag if logged in as Admin
and after lines 112-113add the following
    global $allow_admin;    // added by Ken Roy to display Living flag if logged in as Admin

You should be able to use a utility like WinMerge to compare the TNG 6.1.2 version of descendtext.php and the modified version of TNG 6.1.1 of the same module. The mod appears to be in the same location as it was in TNG 6.1.1

WELLLL.... I'd rather not say whom screwed up and looked at it 10 times..... but he finally got it working.

Actually, when I looked at it earlier I just saw one difference between the 2 versions and didn't think that would break this....

Scotty

Link to comment
Share on other sites

  • 2 months later...

WELLLL.... I'd rather not say whom screwed up and looked at it 10 times..... but he finally got it working.

Actually, when I looked at it earlier I just saw one difference between the 2 versions and didn't think that would break this....

Scotty

Did anyone get this working on the lastest TNG version? I still can't seem to get it working and I've been folowing the thread for some time now.. Anyone???

Link to comment
Share on other sites

Did anyone get this working on the lastest TNG version? I still can't seem to get it working and I've been folowing the thread for some time now.. Anyone???

Thanx for reminding me to put this back in.... And it does work.

At line 117 in descendtext.php find this code.

 function getVitalDates( $row ) {
    global $text;
and change it to this
function getVitalDates( $row ) {
    global $text;
    global $allow_admin;    // added by Ken Roy to display Living flag if logged in as Admin
assuming you made the above change: on line 141 you will find this code:
     }
    return $vitalinfo;
and make it look like this:
    }
                if ( $allow_admin ) {
            if ( $row[living]){
              $vitalinfo .= " - <span style=\"color: red\">$text[living]</span> ";
        }
        else  {
            $vitalinfo .= " ";
        }
        }    // added by Ken Roy to display Living flag if logged in as Admin
    return $vitalinfo;

in others words between the right bracket and return $vitalinfo. If you still get an error you probably have one too many or not enough of those brackets. I use the color red, but you can play with other colors if you want.

Give this a whirl...

Scotty

Link to comment
Share on other sites

Thanx for reminding me to put this back in.... And it does work.

At line 117 in descendtext.php find this code.

 function getVitalDates( $row ) {
    global $text;
and change it to this
function getVitalDates( $row ) {
    global $text;
    global $allow_admin;    // added by Ken Roy to display Living flag if logged in as Admin
assuming you made the above change: on line 141 you will find this code:
     }
    return $vitalinfo;
and make it look like this:
    }
                if ( $allow_admin ) {
            if ( $row[living]){
              $vitalinfo .= " - <span style=\"color: red\">$text[living]</span> ";
        }
        else  {
            $vitalinfo .= " ";
        }
        }    // added by Ken Roy to display Living flag if logged in as Admin
    return $vitalinfo;
in others words between the right bracket and return $vitalinfo. If you still get an error you probably have one too many or not enough of those brackets. I use the color red, but you can play with other colors if you want. Give this a whirl... Scotty
Scotty, Thanks for updating my mod for TNG 6.1.3. The following is an additional tweak which puts the Living text in a CSS style class that you can add to your mytngstyle.css and play with colors, bold, and other text options. Line 144 after making the above change would become
          $vitalinfo .= " - <span class=\"emphasis\">$text[living]</span> ";
and then add the following to your mytngstyle.css file


.emphasis {
     font-weight: bold;
     color: blue;
}

Link to comment
Share on other sites

  • 6 months later...

Scotty,

Thanks for updating my mod for TNG 6.1.3. The following is an additional tweak which puts the Living text in a CSS style class that you can add to your mytngstyle.css and play with colors, bold, and other text options.

Line 144 after making the above change would become

          $vitalinfo .= " - <span class=\"emphasis\">$text[living]</span> ";
and then add the following to your mytngstyle.css file


.emphasis {
     font-weight: bold;
     color: blue;
}

Ken,

I tried to add the living flag to V7 and I can't seem to get it right! Yet alone adding the above....

If you get a chance could you take a look at this.

Scotty

Link to comment
Share on other sites

I would be interested in this too, for v7. Thanks in advance.

Mod to display Living Flag in Descendant Text Only chart for TNG 7.0.0

descendtext.php

before line 161 return $vitalinfo add


            if ( $allow_admin ) {
            if ( $row[living]){
              $vitalinfo .= " - <span class=\"emphasis\">$text[living]</span> ";
        }
        else  {
            $vitalinfo .= " ";
        }
        }    // added by Ken Roy to display Living flag if logged in as Admin
after line 137 global $text; add

    global $allow_admin;    // added by Ken Roy to display Living flag if logged in as Admin
++++++++ Note requires adding class to mytngstyle.css

.emphasis {
  font-style: bold;
  color: blue;
  }

Link to comment
Share on other sites

Ken,

I tried to add the living flag to V7 and I can't seem to get it right! Yet alone adding the above....

If you get a chance could you take a look at this.

Scotty

WELL, dunno what I did the first time but I tried it again and it worked this time.....

I added

global $allow_admin;
at line 138. which then makes
return $vitalinfo;

to be found at line 167.

and inserted the second code to do the actual display.

I may play with the css changes later.

Scotty

Link to comment
Share on other sites

  • 3 years later...

I would like to display a custom event in the descendency chart ( for administrator only). I have the Living Flag Mod installed in v9 and wondered if someone could help me modify this to display a custom event, in similar way to the LIVING flag. The text for the custom event is dependent on the blood line (similar to clan) so the descendency chart would be perfect for displaying this for me. The event no is 10 and I only need to display the info bit (e10.info)

Would this be possible?

TIA

Link to comment
Share on other sites

I would like to display a custom event in the descendency chart ( for administrator only). I have the Living Flag Mod installed in v9 and wondered if someone could help me modify this to display a custom event, in similar way to the LIVING flag. The text for the custom event is dependent on the blood line (similar to clan) so the descendency chart would be perfect for displaying this for me. The event no is 10 and I only need to display the info bit (e10.info)

Would this be possible?

TIA

OK. I have got it worked out now.

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