Jump to content
TNG Community
Clan Maclellan

Mod Wanted or Code

Recommended Posts

MichaelM

Success !

I had to read all entries in this thread.
Now it works !

Thank you all for great support.

 

Share this post


Link to post
Share on other sites
MichaelM

Success !

I had to read all entries in this thread.
Now it works !

Thank you all for great support.

 

Share this post


Link to post
Share on other sites
MichaelM

for Guernman20:

I replaced this

<?php
    if($dadlabel) {
?>
            <li>
                <a href="<?php echo $cms['tngpath']; ?>pedigree.php?personID=<?php echo $tmp['t14_dadperson']; ?>&amp;tree=<?php echo $tmp['t14_dadtree']; ?>"><span class="l"></span><span class="r"></span><span class="t"><?php echo $dadlabel; ?></span></a>
            </li>
<?php        
    }
    if($momlabel) {
?>
            <li>
                <a href="<?php echo $cms['tngpath']; ?>pedigree.php?personID=<?php echo $tmp['t14_momperson']; ?>&amp;tree=<?php echo $tmp['t14_momtree']; ?>"><span class="l"></span><span class="r"></span><span class="t"><?php echo $momlabel; ?></span></a>
            </li>
<?php        
    }
    if($tmp['t14_featurelinks'])
        echo showLinks($tmp['t14_featurelinks'],false,"","<span class=\"l\"></span><span class=\"r\"></span><span class=\"t\">xxx</span>");
?>
 

with following code:

<!–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; Meine Seite</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; Meine Familie</a></span></a>
</li>
<li>
<a href="<?php if ( $_SESSION['mypersonID'] != "" && $currentuser && $_SESSION['mygedcom'] != "") {
$xerxxTarget = $cms['tngpath'] . "pedigree.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; Meine Vorfahren</a></span></a>
</li>
<!–End Personalised Links for TNG V11 Template 14 header)–>       


<?php        
    
    if($tmp['t18_featurelinks'])
        echo showLinks($tmp['t18_featurelinks'],false);
?>


May be there is some confusion with the {} - brackets

 

 

Share this post


Link to post
Share on other sites
Guernman20

Thank you for all your input I now have got it to work

All the best

Peter

Share this post


Link to post
Share on other sites
MichaelM

Thanks Merv, 

for this ignition for personalised links.

I've further developed the code (for my page).

- my person, my site, my ancestoes is only shown when the use is logged in

- If person is Julia, its shown as "Julias page"  or in german as "Julias Seite"

- if there is a user like Markus, the SIte uses correct Genitive  like "Markus' page"

see screenshot.

see  http://ahnengalerie.michaelmandel.de

 

code:

        <!–Start personalised Links    basically by Merv from TNG-Forum)–>
        <?php if ( $_SESSION['mypersonID'] != "" && $currentuser && $_SESSION['mygedcom'] != "") {
            ?>
                <?php 
                    //for usernames ending with "s", like "Matthias"  or "Lars" , here is the correct DUDEN genitive .... 
                    $_myGenitive = "s ";
                    if (substr($currentuser, -1) == "s") $_myGenitive = "'  ";     
                ?> 
                <li>
                <a href="<?php $xerxxTarget = $cms['tngpath'] . "getperson.php?personID=" . $_SESSION['mypersonID'] ."&amp;tree=" . $_SESSION['mygedcom'];
                echo "{$cms['tngpath']}$xerxxTarget";?>
                " title="meine Seite/my page"><span class="l"></span><span class="r"></span><span class="t">&#128100;<b><?php echo "$currentuser","$_myGenitive ", $text['page'] ?></b></span></a>

                <a href="<?php $xerxxTarget = $cms['tngpath'] . "familychart.php?personID=" . $_SESSION['mypersonID'] ."&amp;tree=" . $_SESSION['mygedcom'];
                echo "{$cms['tngpath']}$xerxxTarget";?>
                " title="meine Familie/my family"><span class="l"></span><span class="r"></span><span class="t">&#128100;<b><?php echo "$currentuser","$_myGenitive ", $text['family'] ?></b></span></a>

                <a href="<?php $xerxxTarget = $cms['tngpath'] . "pedigree.php?personID=" . $_SESSION['mypersonID'] ."&amp;tree=" . $_SESSION['mygedcom'];
                echo "{$cms['tngpath']}$xerxxTarget";?>
                " title="meine Vorfahren/my ancestors"><span class="l"></span><span class="r"></span><span class="t">&#128100;<b><?php echo "$currentuser","$_myGenitive ", $text['ancestors'] ?></b></span></a>
                </li>
            <?php       
        }?>
        <!–End personalised Links)–>

screenshot.JPG

Share this post


Link to post
Share on other sites
Merv

Great alternative. Well done!!

 

Share this post


Link to post
Share on other sites
Philip Roy

I cannot for the life of me get this to work with topmenu.php and template 18. It simply doesn't seem to know that I am logged in.

I've moved away from the code I was trying and at the moment, all I have done in the attached file is adjust the first line of code as Merv indicated in other posts and pasted in MichaelM's code as a test...and nothing appears. It doesn't seem to know that I am logged in.

What I am trying to achieve is discussed here (sorry for the cross post) I just want to have "Log In" as a link at the top pf the page after the dad and mum links (if that's what they are called), which is then replaced by "Most Wanted" and "Log Out" if you are logged in.

I've got that working on the main page (index.php) but cannot get this code to work on any other page of the site using the topmenu.php file.

I know the attached code won't exactly achieve that...but I just need to get it (at least) understanding that someone is logged in....and then I might be able to tweak it.

Cheers, Phil

 

topmenu.php

Share this post


Link to post
Share on other sites
Philip Roy

Solved it! I've posted the answer in my other thread...but the mistake for me wasn't the code...I was using a test account and I hadn't assigned that person to a tree and a person ID. When I do that, it all works!

Phil

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

×