Jump to content
TNG Community
Clan Maclellan

Mod Wanted or Code

Recommended Posts

Clan Maclellan

Would be nice to be able to set "Dad Side Label & Mom Side Label" for each members tree.

At present you can only set one, in the: Setup >> Configuration >> Template Settings, as seen in image.

Buttons do nothing on members pages.

Any ideas? Can this feature be add with a little code perhaps.

Beyond my skill.. 

Mod Wanted.jpg

Mod Wanted 2.jpg

Share this post


Link to post
Share on other sites
Merv

There is code that takes users to their ancestors chart (which includes both parents) if that would suit you?

cap.jpg

Share this post


Link to post
Share on other sites
Clan Maclellan

Hello: Merv

Yea, I gave it a try and don't like it, doesn't fit well with the look of my pages and it's only when you login.

Share this post


Link to post
Share on other sites
Merv
17 hours ago, Clan Maclellan said:

Would be nice to be able to set "Dad Side Label & Mom Side Label" for each members tree.

Could you elaborate on this statement? Do you want a his/her chart for each of your trees? If so, how many trees do you have?

Share this post


Link to post
Share on other sites
Clan Maclellan

Would like to have linkage of "Dad Side & Mom Side" for each user account to ether chose, Pedigree >> Ancestors or Descendants; standard chart, and they could chose how many generations. 

In my case I named them Father Side and Mother Side.

So somewhere in the users administrator panel they could chose linkage. (see sample images)

1st one sample Administrator Page for a user.

2nd one is configuration page.

This could also be done with a Mod, with Options.

Dose any of this make sense?

sampleAdmin.jpg

sampleLinkage.jpg

Share this post


Link to post
Share on other sites
Merv

Going back to your first reply... TNG won't know whose charts to display unless the user is logged in hence the reason why the personalised links/buttons do not display until the user is logged in. This would also apply to your proposal.

The personalised links can display in various ways, As standard links, in drop-down menus, as clickable buttons, in custom menus etc. A combination of these options would probably fit with the look of most websites. Which template do you use?

Share this post


Link to post
Share on other sites
Clan Maclellan

The header buttons Dad Side | Mom Side, will only work from the Admin's account at present from the Template settings, users don't have access to change template settings in there accounts.

I'm using Template 14, TNG 11.1.1. 

Yes, all accounts/Trees are private.

In picture 2, configuration page, "Tree ID" maybe this would already be set by the system, based on login account and tree,

that way you couldn't add a bad Tree ID., the worst that could happen with a dad ID, is, no page would be displayed.

Having the choice to pick a parent by, Person ID, and select whether to have it displayed:  Pedigree>Ancestor or Pedigree>Descendant, and,

maybe a drop down  with selector on how many Generations to display, and also maybe  a selection for view choice, Standard, Vertical, Box or Fan Chart.

I've never used any other templates to see if the settings are different. I think this would be a way cool feature.

Share this post


Link to post
Share on other sites
Merv

The personalised buttons will make your His/Her Side links redundant as users will be able to go directly to their personal charts (Unless you want to rename them "McCellan Side and (Whatever your Mum's maiden name is) Side so that they have access to both sides of your parentage as well.

On 8/3/2017 at 2:12 AM, Clan Maclellan said:

Yea, I gave it a try and don't like it, doesn't fit well with the look of my pages and it's only when you login.

Admittedly the buttons are rather prominent but that is part of their purpose. If you want them to display as links only, you can just use the code without the styling.

FireShot Capture 007 - whakapapaonline.com - https___whakapapaonline.com_index.php.png

Share this post


Link to post
Share on other sites
Merv

FYI... I had a little difficulty finding your TNG site....

This page's Genealogy tab didn't take me to it, or give me any idea how to get to it... http://www.clanmaclellan.net/

On this page it is a little difficult to find as it is an inconspicuous link in one of the drop-down menus... http://www.clanmaclellanancestry.com/index.html

If you are getting very few visitors to your TNG site, then this could be why.

 

ps It would be helpful for those trying to help you here if you were to add your site URL to your future posts... Clan MacLellan Ancestral Trees of Life

To save you having to add it manually every time, you can add it to your signature line... Account Settings>> Signature

Share this post


Link to post
Share on other sites
Clan Maclellan

Sorry Merv,  thought you already knew. I did as you suggested, added >> Signature.

Had a little trouble with Joseph.

As you can see my Welcome Page is pretty full and adding extra links is not the goal.

I have members who keep asking me to fix the 2 links in the header, His Side <> Her Side

I think if I can find a way to fix them, I may have to remove the header all together, just to put it to rest.

But I thought I would be cool if somehow I could get it to work, so I asked.

Share this post


Link to post
Share on other sites
Merv

I think the confusion with your users is that when they see Father's and Mother's side. They expect to be linked to THEIR Father's and Mother's charts however that is not the way those links are designed. To "fix" them, you need to either rename them as to whose charts they actually display or remove them.

Many TNG members remove them because they make a website feel exclusive to the website administrator rather than inclusive of every registered user . If your site is about your own personal genealogy crusade, then keeping them makes sense. If however, the crusade involves a large group of people/families, then it is probably better to remove them.

Like I said earlier. The Personal links can replace the His and Her side links (Fathers/Mothers Side in your case) as they take your users to their own personal pages and charts which (I think) is what you are trying to achieve.

Your users will probably be happier with direct links to their own standard My Page, My Family and My Ancestors pages rather than only having direct links to their Fathers and Mothers ancestor charts anyway.

Share this post


Link to post
Share on other sites
Clan Maclellan

How about changing His Side & Her Side, to the button text links "My Page" and "My Family" like your suggesting but in the header.

Share this post


Link to post
Share on other sites
Merv
16 minutes ago, Clan Maclellan said:

How about changing His Side & Her Side, to the button text links "My Page" and "My Family" like your suggesting but in the header.

That is possible but will require the header <span> coding included in the PHP personalised links coding. You are welcome to give it a crack.

Share this post


Link to post
Share on other sites
Clan Maclellan

Yea, I wouldn't have a clue, that why I was asking/requesting. I now near nothing of php.

Share this post


Link to post
Share on other sites
Merv

Ok then... I'm up for a challenge. Watch this space.

Share this post


Link to post
Share on other sites
Merv

A bit rough but try this code. You will need to replace the His/Her side code in both your index.php and topmenu.php files.

<!–Start Personalised Links for TNG V11 Template 14 header)–>
<li>
<a href="<?php if ( $_SESSION['mypersonID'] != "" && $currentuser && $_SESSION['mygedcom'] != "") {
$xerxxTarget = $cms['tngpath'] . "getperson.php?personID=" . $_SESSION['mypersonID'] ."&amp;tree=" . $_SESSION['mygedcom'];
echo "{$cms['tngpath']}$xerxxTarget";}
else  echo "{$cms['tngpath']}login.php"; ?>
"><span class="l"></span><span class="r"></span><span class="t">&#128100; My Page</a></span></a>
</li>
<li>
<a href="<?php if ( $_SESSION['mypersonID'] != "" && $currentuser && $_SESSION['mygedcom'] != "") {
$xerxxTarget = $cms['tngpath'] . "familychart.php?personID=" . $_SESSION['mypersonID'] ."&amp;tree=" . $_SESSION['mygedcom'];
echo "{$cms['tngpath']}$xerxxTarget";}
else  echo "{$cms['tngpath']}login.php"; ?>
"><span class="l"></span><span class="r"></span><span class="t">&#128100; My Family</a></span></a>
</li>
<li>
<a href="<?php if ( $_SESSION['mypersonID'] != "" && $currentuser && $_SESSION['mygedcom'] != "") {
$xerxxTarget = $cms['tngpath'] . "verticalchart.php?personID=" . $_SESSION['mypersonID'] ."&amp;tree=" . $_SESSION['mygedcom'];
echo "{$cms['tngpath']}$xerxxTarget";}
else  echo "{$cms['tngpath']}login.php"; ?>
"><span class="l"></span><span class="r"></span><span class="t">&#128100; My Ancestry</a></span></a>
</li>
<!–End Personalised Links for TNG V11 Template 14 header)–>       

IMPORTANT!!

Additional code is required to the topmenu.php file to get the links to work on all pages other than the Homepage.

This additional code is a couple of posts down from this one

cap.jpg

 

Share this post


Link to post
Share on other sites
Clan Maclellan

Wow, that was quick.

I added code to > Template 14 >> topmenu.php & index.php.

After login when I click on a link it goes to the right page >> perfect!

after going to one of the pages, links not working, takes you to login.php.

so the code on index.php, all links work.

and links on topmenu.php are not seeing that your already login.

 

Share this post


Link to post
Share on other sites
Merv
18 hours ago, Clan Maclellan said:

Wow, that was quick.

Obviously too quick

18 hours ago, Clan Maclellan said:

after going to one of the pages, links not working, takes you to login.php.

so the code on index.php, all links work.

and links on topmenu.php are not seeing that your already login.

IMPORTANT!!

This additional code is required to the topmenu.php file to get the links to work on all pages other than the Homepage.

Try changing topmenu.php line 1

from

<?php global $text, $cms, $subroot, $tmp; ?>

to

<?php global $text, $currentuser, $cms, $allow_admin, $subroot, $tmp;?>

Share this post


Link to post
Share on other sites
Merv

Considerations

  1. With the My Ancestry button pointing to the vertical chart, you may like to install the Verticalchart Photos mod which adds photos to these charts.
  2. You may also like to set initial number of ancestor generations to maximum to give your users a full(er) initial view of their ancestry. Admin>> Set Up>> Chart Settings>> Pedigree>> Initial Generations>> (Match field with Max Generations entry)>> Save. If you decide to do this, it would also pay to set the vertical chart as your default ancestor chart otherwise your users may have to wait an eternity for the other ancestor charts to load when clicking on the ancestor tabs if it isn’t the default. Admin>> Set Up>> Chart Settings>> Pedigree>> Initial Display>> (Select Vertical)>> Save

Share this post


Link to post
Share on other sites
Clan Maclellan

Well Merv, you have done an outstanding job, new additional code did the trick, I thoroughly tested and with much appreciation  approve.

I added one more little bit of code to the >>topmenu.php>> for a "Return Home" text button; 

 

<li>
     <a href="index.php" target="_self"><span class="l"></span><span class="r"></span><span class="t">Return Home</span></a>
</li>

 

I also added the Verticalchart Photo mod as suggested, for that fuller and enhanced view.

I must say,  this turned out much better. All that's left to do is post it in the Wiki, with your other Button Script as an "Alternate Button Location" >> Button Text Links.

 

Big Thank you, for your scripting addition, I think you can up your *TNG Experience to, "Expert" - Expert coding ability/capable of most things.

 

Here is was the final outcome looks like:

Template_14_button_addition-topmenu.jpg

Share this post


Link to post
Share on other sites
tngrlkrz

Very nice Merv.  I too have personalized the header of all pages (with a fixed row which doesn't scroll away) for registered users, so they can see immediately their specific TNG pages.  I added a Relatives page as well which permits seeing a linkable list of cousins as well.

 

top.png

Share this post


Link to post
Share on other sites
Merv

The code seems to work okay with template 13 as well.

I don't have template 15 because I'm still on TNG 10 and the <span> coding looks to be different in that top menu so the code may not work with that template.

Unless someone can flick me a fresh copy of the template 15 folder?

cap.jpg

Share this post


Link to post
Share on other sites
Clan Maclellan

Sent 15 to you in a message.. Template 13 looks great..

Share this post


Link to post
Share on other sites
jayat1familytree

Maybe its time we create a single page for ALL the links that a registered user might need to use;

 

My User Page/Profile/Settings/Ancestry

My Page
My Family Page
My Ancestor chart

My Profile settings (edit)
My Bookmarks
My Tree
My Branch

 

 

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

×