Guernman20 Posted October 23, 2023 Report Share Posted October 23, 2023 This is a follow on from a previous discussion called Mod Wanted or Code I have upgraded to 14.01 from 13 and tried to put in the Top Menu mod. Website:-https://guernseyfamilytrees.co.uk But I can't get it to work. It is some time since I got the mod to work in a previous version and I have probably forgotten a vital step. I have modified the topmenu.php but it might be that I haven't modified the index.php and I don't know at which line to insert the extra coding. Below is the existing coding on my live site topmenu.php <?php global $text, $currentuser, $cms, $allow_admin, $subroot, $tmp, $homepage; $dadlabel = getTemplateMessage('t15_dadside'); $momlabel = getTemplateMessage('t15_momside'); $title = getTemplateMessage('t15_maintitle'); ?> <body class="home-page content-sidebar tng-nav tng-home"> <div class="site-container"> <nav class="nav-primary"> <div class="wrap"> <div class="responsive-menu-icon"></div> <ul class="menu nav-menu menu-primary responsive-menu"> <li class="first menu-item current-menu-item"><a href="<?php echo $cms['tngpath'] . $homepage; ?>">Home</a></li> <!–Start Personalised Links for Template 15 top menu)–> <li class="menu-item"><a href="<?php if ( $_SESSION['mypersonID'] != "" && $currentuser && $_SESSION['mygedcom'] != "") { $xerxxTarget = $cms['tngpath'] . "getperson.php?personID=" . $_SESSION['mypersonID'] ."&tree=" . $_SESSION['mygedcom']; echo "{$cms['tngpath']}$xerxxTarget";} else echo "{$cms['tngpath']}login.php"; ?> "><span class="l"></span><span class="r"></span><span class="t"><b>👤 My Page</b></a></span></a> </li> <li class="menu-item"><a href="<?php if ( $_SESSION['mypersonID'] != "" && $currentuser && $_SESSION['mygedcom'] != "") { $xerxxTarget = $cms['tngpath'] . "family.php?personID=" . $_SESSION['mypersonID'] ."&tree=" . $_SESSION['mygedcom']; echo "{$cms['tngpath']}$xerxxTarget";} else echo "{$cms['tngpath']}login.php"; ?> "><span class="l"></span><span class="r"></span><span class="t"><b>👤 My Family</b></a></span></a> </li> <li class="menu-item"><a href="<?php if ( $_SESSION['mypersonID'] != "" && $currentuser && $_SESSION['mygedcom'] != "") { $xerxxTarget = $cms['tngpath'] . "verticalchart.php?personID=" . $_SESSION['mypersonID'] ."&tree=" . $_SESSION['mygedcom']; echo "{$cms['tngpath']}$xerxxTarget";} else echo "{$cms['tngpath']}login.php"; ?> "><span class="l"></span><span class="r"></span><span class="t"><b>👤 My Ancestry</b></a></span></a> </li> <!–End Personalised Links for Template 15 top menu)–> </ul> </div> </nav> <header class="site-header"> <div class="wrap"> <div class="title-area"> <h1 class="site-title"><a href="<?php echo $cms['tngpath'] . $homepage; ?>"><?php echo $title; ?></a></h1> </div> <aside class="widget-area"> <section class="widget"> <div class="widget-wrap"> <aside class="widget-area"> <section class="widget"> <div class="widget-wrap"> <a href="<?php echo $cms['tngpath'] . $homepage; ?>"><img src="<?php echo $cms['tngpath'] . $templatepath . $tmp['t15_titleimg']; ?>" title="" alt=""></a> </div> </section> </aside> </div> </section> </aside> </div> </header> <div class="site-inner"> index.php <?php include("tng_begin.php"); //Insert the following lines in your index.php to take advantage of template switching if($templateswitching && $templatenum) { include($cms['tngpath'] . "templates/$templatepfx$templatenum/index.php"); exit; } //end of lines to be inserted for template switching $flags['noicons'] = true; $flags['noheader'] = true; tng_header( $text['mnuheader'], $flags ); ?> <!-- "Home Page" (the text for these messages can be found at near the bottom of text.php --> <h1><?php echo $text['mnuheader']; ?></h1> <?php if( $currentuser ) { echo "<p><strong>{$text['welcome']}, $currentuserdesc.</strong></p>\n"; } ?> <h2><?php echo $text['mnusearchfornames']; ?></h2> <!-- Do not change the form action or field names! --> <form action="search.php" method="get"> <table border="0" cellspacing="5" cellpadding="0"> <tr><td><span class="normal"><?php echo $text['mnulastname']; ?>: </span><br/><input type="text" name="mylastname" size="14"></td></tr> <tr><td><span class="normal"><?php echo $text['mnufirstname']; ?>:</span><br/><input type="text" name="myfirstname" size="14"></td></tr> <tr><td><input type="hidden" name="mybool" value="AND" /><input type="hidden" name="offset" value="0" /><input type="submit" name="search" value="<?php echo $text['mnusearch']; ?>" /></td></tr> </table> </form> <h2><?php echo $text['mnufeatures']; ?></h2> <ul> <?php if( $currentuser ) { //this means you're logged in echo "<li><a href=\"logout.php\">{$text['mnulogout']}</a></li>\n"; } else { //this means you're logged out echo "<li><a href=\"login.php\">{$text['mnulogon']}</a></li>\n"; } echo "<li><a href=\"newacctform.php\">{$text['mnuregister']}</a></li>\n"; echo "<li><a href=\"searchform.php\">{$text['mnuadvancedsearch']}</a></li>\n"; echo "<li><a href=\"surnames.php\">{$text['mnulastnames']}</a></li>\n"; echo "<li><a href=\"bookmarks.php\">{$text['bookmarks']}</a></li>\n"; echo "<li><a href=\"statistics.php\">{$text['mnustatistics']}</a></li>\n"; echo "<li><a href=\"browsemedia.php?mediatypeID=photos\">{$text['mnuphotos']}</a></li>\n"; echo "<li><a href=\"browsemedia.php?mediatypeID=histories\">{$text['mnuhistories']}</a></li>\n"; echo "<li><a href=\"browsemedia.php?mediatypeID=documents\">{$text['documents']}</a></li>\n"; echo "<li><a href=\"browsemedia.php?mediatypeID=videos\">{$text['videos']}</a></li>\n"; echo "<li><a href=\"browsemedia.php?mediatypeID=recordings\">{$text['recordings']}</a></li>\n"; echo "<li><a href=\"browsealbums.php\">{$text['albums']}</a></li>\n"; echo "<li><a href=\"browsemedia.php\">{$text['allmedia']}</a></li>\n"; echo "<li><a href=\"cemeteries.php\">{$text['mnucemeteries']}</a></li>\n"; echo "<li><a href=\"browsemedia.php?mediatypeID=headstones\">{$text['mnutombstones']}</a></li>\n"; echo "<li><a href=\"places.php\">{$text['places']}</a></li>\n"; echo "<li><a href=\"browsenotes.php\">{$text['notes']}</a></li>\n"; echo "<li><a href=\"anniversaries.php\">{$text['anniversaries']}</a></li>\n"; echo "<li><a href=\"reports.php\">{$text['mnureports']}</a></li>\n"; echo "<li><a href=\"browsesources.php\">{$text['mnusources']}</a></li>\n"; echo "<li><a href=\"browserepos.php\">{$text['repositories']}</a></li>\n"; echo "<li><a href=\"whatsnew.php\">{$text['mnuwhatsnew']}</a></li>\n"; echo "<li><a href=\"mostwanted.php\">{$text['mostwanted']}</a></li>\n"; echo "<li><a href=\"changelanguage.php\">{$text['mnulanguage']}</a></li>\n"; if( $allow_admin ) { echo "<li><a href=\"showlog.php\">{$text['mnushowlog']}</a></li>\n"; echo "<li><a href=\"admin.php\">{$text['mnuadmin']}</a></li>\n"; } echo "<li><a href=\"suggest.php\">{$text['contactus']}</a></li>\n"; ?> </ul> <p><strong>Please customize this page!</strong></p> </body> </html> Any assistance would be greatly appreciated Peter Quote Link to comment Share on other sites More sharing options...
edglimited Posted October 24, 2023 Report Share Posted October 24, 2023 Peter, Not sure, what's going on there, but there's a few things wrong. You show code for topmenu.php and index.php ...is all that contained within your Top Menu..?? You do understand that by using that code by Eric Hoppe, will produce a vertical menu not a horizontal menu. This will push your image and title heading way down your home page. As for the index.php code, you have mentioned, I can assure you none of what you have listed comes standard in the Template 15 index file. You'll have to explain further. 🙃 I know Template 15, inside out, upside down and back to front. I have an idea at what your trying to achieve, but in reality, your'e doing it the hard way. Just use the K.I.S.S method. As an example, the screenshot below, shows a Tab MenuBar, that will allow you to link buttons to an external Site, an Individual, a Family, an Album, etc etc. You can add the Tab MenuBar above the header image in your Site or above the Slimline MenuBar as seen below. You can also use the code without the buttons, in the blue band in the header menu. This will still allow you to link to, what has been mentioned above. You also have various other options and ways to add code directly to different areas and within the T15 template itself. Drew Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted October 24, 2023 Report Share Posted October 24, 2023 On 10/23/2023 at 4:59 AM, Guernman20 said: $xerxxTarget = $cms['tngpath'] . "verticalchart.php? Please be aware that Erik Hoppe's Verticalchart Photos Mod was incorporated into TNG v13 and is now marked Obsolete. When upgrading mods from previous TNG version, one must read the page that is anchored on the TNG Wiki Main Page TNG Major Features for all the versions one is upgrading from Quote Link to comment Share on other sites More sharing options...
Guernman20 Posted October 27, 2023 Author Report Share Posted October 27, 2023 I have got it to work, but with a small problem. I have modified Template15/topheader.php as follows:- <?php global $text, $currentuser, $cms, $allow_admin, $subroot, $tmp, $homepage; $dadlabel = getTemplateMessage('t15_dadside'); $momlabel = getTemplateMessage('t15_momside'); $pagetitle = getTemplateMessage('t15_maintitle'); ?> <body id="bodytop" class="<?php echo pathinfo(basename($_SERVER['SCRIPT_NAME']), PATHINFO_FILENAME); ?> home-page content-sidebar tng-nav tng-home"> <div class="site-container"> <nav class="nav-primary"> <div class="wrap"> <div class="responsive-menu-icon"></div> <ul class="menu nav-menu menu-primary responsive-menu"> <li class="first menu-item current-menu-item"><a href="<?php echo $cms['tngpath'] . $homepage; ?>">Home</a></li> <!–Start Personalised Links for Template 15 top menu)–> <li class="menu-item"><a href="<?php if ( $_SESSION['mypersonID'] != "" && $currentuser && $_SESSION['mygedcom'] != "") { $xerxxTarget = $cms['tngpath'] . "getperson.php?personID=" . $_SESSION['mypersonID'] ."&tree=" . $_SESSION['mygedcom']; echo "{$cms['tngpath']}$xerxxTarget";} else echo "{$cms['tngpath']}login.php"; ?> "><span class="l"></span><span class="r"></span><span class="t"><b>👤 My Page</b></a></span></a> </li> <li class="menu-item"><a href="<?php if ( $_SESSION['mypersonID'] != "" && $currentuser && $_SESSION['mygedcom'] != "") { $xerxxTarget = $cms['tngpath'] . "familychart.php?personID=" . $_SESSION['mypersonID'] ."&tree=" . $_SESSION['mygedcom']; echo "{$cms['tngpath']}$xerxxTarget";} else echo "{$cms['tngpath']}login.php"; ?> "><span class="l"></span><span class="r"></span><span class="t"><b>👤 My Family</b></a></span></a> </li> <li class="menu-item"><a href="<?php if ( $_SESSION['mypersonID'] != "" && $currentuser && $_SESSION['mygedcom'] != "") { $xerxxTarget = $cms['tngpath'] . "verticalchart.php?personID=" . $_SESSION['mypersonID'] ."&tree=" . $_SESSION['mygedcom']; echo "{$cms['tngpath']}$xerxxTarget";} else echo "{$cms['tngpath']}login.php"; ?> "><span class="l"></span><span class="r"></span><span class="t"><b>👤 My Ancestry</b></a></span></a> </li> <!–End Personalised Links for Template 15 top menu)–> if($tmp['t15_featurelinks']) echo showLinks($tmp['t15_featurelinks'],false,"menu-item"); ?> <li class="search-menu-item"> <form id="topsearchform" name="topsearchform" method="get" action="<?php echo $cms['tngpath'];?>search.php"> <?php echo getFORM( "search", "get", "", ""); ?> <input type="hidden" value="AND" name="mybool" /> <?php echo $text['firstname']; ?>: <input size="12" name="myfirstname" type="text" id="myfirstname" /> <?php echo $text['lastname']; ?>: <input size="12" name="mylastname" type="text" id="mylastname" /> <input type="submit" value="<?php echo $text['search']; ?>"/> </form> </li> </ul> </div> </nav> <header class="site-header"> <div class="wrap"> <div class="title-area"> <h1 class="site-title"><a href="<?php echo $cms['tngpath'] . $homepage; ?>"><?php echo $pagetitle; ?></a></h1> </div> <aside class="widget-area"> <section class="widget"> <div class="widget-wrap"> <aside class="widget-area"> <section class="widget"> <div class="widget-wrap"> <a href="<?php echo $cms['tngpath'] . $homepage; ?>"><img src="<?php echo $cms['tngpath'] . $templatepath . $tmp['t15_titleimg']; ?>" title="" alt=""></a> </div> </section> </aside> </div> </section> </aside> </div> </header> <div class="site-inner"> As can be seen a part of the script can be seen and this has made the dark blue area bigger. Bearing in mind I am a complete novice can anyone help me? p.sp The links 'My Page', 'My Family', 'My Ancestry' now work perfectly and will display the pages of the person that has signed in. Peter Quote Link to comment Share on other sites More sharing options...
edglimited Posted October 27, 2023 Report Share Posted October 27, 2023 11 hours ago, Guernman20 said: <!–End Personalised Links for Template 15 top menu)–> if($tmp['t15_featurelinks']) echo showLinks($tmp['t15_featurelinks'],false,"menu-item"); ?> <li class="search-menu-item"> Peter, Change the above in bold to this. <!–End Personalised Links for Template 15 top menu)–> <?php if($tmp['t15_featurelinks']) echo showLinks($tmp['t15_featurelinks'],false,"menu-item"); ?> Drew Quote Link to comment Share on other sites More sharing options...
Guernman20 Posted October 28, 2023 Author Report Share Posted October 28, 2023 Drew, Thanks very much!!! Everything Ok now Peter Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.