Jump to content
TNG Community

Search the Community

Showing results for tags 'code'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • TNG Specific
    • Announcements
    • Questions and Answers
    • TNG Modifications
    • Installation and Configuration
    • New Ideas and Suggestions
    • Code Discussion
    • Templates or Design Questions
    • CMS Integrations
    • TNG Wiki
    • Requests for New Mods
  • Community
    • Member Webpages
    • Genealogy
    • Chit Chat
    • Questions and Answers
    • Offers And Requests

Blogs

  • Community News
  • TNG News

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. I know I'm not a security expert but still hope it's helpfull to some of you. If anyone likes to chime in, feel free to do so. About the topic In TNG you can use the "rel" attribute with hyperlinks in order to add extra security & privacy. See the table below for an explanation of the "rel" attribute or search the internet for more detailed information. Unfortunatly the "rel" attribute can't be used with hyperlinks in citations. To mitigate this you can use the JavaScript code at the end of this topic. What does it do: Detects external links only (not your own domain) Forces them to open in a new tab (target="_blank") Automatically adds secure attributes: rel="noopener noreferrer nofollow" Works for dynamically added links (AJAX, React, etc.) Which gives you: SEO-safe: external links use nofollow Security-safe: prevents tab-nabbing with noopener noreferrer User-friendly: external links open in new tabs Robust: updates automatically as new links appear Just add the script at the bottom of the footer.php in your template folder. BTW TNG doesn't always have the closing </body> tag in footer.php but that fine as long as the script is placed at the bottom of the footer.php it works. If you remove the "nofollow" value from the script you allow search engines to to use the link as a ranking signal. Simply said: Skipping nofollow won’t break anything. It just means you’re passing SEO value to the linked page. Only use nofollow when you don’t fully trust or control that link. The script is shown below. <!-- Add this just before the closing </body> tag --> <script> (() => { const addSafeExternalAttrs = link => { const href = link.getAttribute('href'); if (!href || href.startsWith('#') || href.startsWith('mailto:') || href.startsWith('tel:')) return; const linkUrl = new URL(href, window.location.origin); if (linkUrl.origin === window.location.origin) return; link.setAttribute('target', '_blank'); const existingRel = link.getAttribute('rel') || ''; const relValues = new Set(existingRel.split(/\s+/).filter(Boolean)); ['noopener', 'noreferrer', 'nofollow'].forEach(v => relValues.add(v)); link.setAttribute('rel', Array.from(relValues).join(' ')); }; document.querySelectorAll('a[href]').forEach(addSafeExternalAttrs); const observer = new MutationObserver(mutations => { for (const mutation of mutations) { mutation.addedNodes.forEach(node => { if (node.nodeType === 1) { if (node.tagName === 'A') addSafeExternalAttrs(node); else node.querySelectorAll?.('a[href]').forEach(addSafeExternalAttrs); } }); } }); observer.observe(document.body, { childList: true, subtree: true }); })(); </script> To test if the script works you can do the following: Go to a page with an external hyperlink Rightclick the hyperlink and choose "Inspect" You should see something like this: <a href="https://example.com" target="_blank" rel="noopener noreferrer nofollow">Example</a> If those attributes were missing before but now appear automatically the script works. If they don’t appear, clear the cache or hard refresh with Ctrl+F5 or otherwise check the console for errors (red text)
  2. TNG 15.0.2 Hello, folks, let me clarify... On my previous TNG site (14.0.6), I have many pictures that have many hundreds of people linked to those pictures, spread across 8-10 categories. I do have a copy (backup) of my previous TNG 14.0.6 site, which I ran a 14.0.6-to-15.0.2 upgrade on, so I do have a database from a previous site will all my categories & photos in it, and which the database is compatible withTNG 15.0.2. I installed my TNG 15.0.2 site from scratch, and have been slowly setting up my media on the new site from scratch. It's a slow process, and I've managed to create a few categories manually so far. For you MySQL gurus, is there a way that I can somehow, from that previoussite's tng_media table, export or extract all media items with a specific mediatypeID to a file, and then import all those items into a category on my live TNG 15.0.2 site? As an example, I have a media category on my previous site with a mediatypeID called maps. I wish to import everything in that category into a new (empty) category on my current site with a mediaID that I will call photosmaps when I create it. What I wish to accomplish is to have all the maps from my previous site with all their associated (Linked to) people, imported into my new site, with all the maps & their associated (Linked to) people. And if the above is indeed possible, is it better for me to already have the new category reated on my current site to import the maps (photos) into? Or is it better to not have the maps category created yet, and have the import create it during the import process? Apologies for not explaining that very well, but I hope it makes a little sense. Thank you in advance & have a great day. Regards, John
  3. I am trying to use the Histories collection. Sometimes the content will display normally, other times only the title is displayed. So let's say I go Admin Home > Media > Add New, and try ti create an entry in collection "Histories". And for the sake of the example, I put text in the text box, fill the "Title" box, and click "Save and Continue". On the next page, I will set a media link to persons I1 and I100, and save. If I go to person I1, and click on the Histories link, the text will appear correctly. If I go to person 100, it does not display. Also, the footer is missing! Any idea? See the pictures attached. The first two show that the same text was linked to two individuals, #1 and #100. The third picture shows that for #1, the text appears, the links to all individuals are shown, and the footer is there. Not so much for individual #100, in the fourth picture; no text, no links, and no footer. Same media, two results. Why? WHY????
  4. TNG 15.0.2 Hello, folks, I have some TNG reports that were created using TNG's Report Writer, and other reports that were created using direct SQL SELECT statements. When I go into phpMyAdmin and select Reports, those reports that were created using TNG's Report Writer have info in the display, criteria & orderby fields. And those reports that were created using direct SQL SELECT statements have info in the sqlselect field. I know absolutely nothing about MySQL, so I'm wondering if there is a way that I can somehow create direct SQL SELECT statements from information in display, criteria & orderby fields. I have a need to use some SQL SELECT statements directly in some of my custom TNG pages, but I have no idea how to convert the above... or if it's even possible. Thank you in advance & have a great day. Regards, John
  5. Hello, folks, For the past couple of years, I had been using 2 specific variables on some of my custom TNG 14.x pages (and maybe earlier versions of TNG too), and they always worked & displayed perfectly (when a user is actually logged in, of course). The 2 variables were mypersonID and mygedcom: <?php echo $_SESSION['mypersonID']; ?> ...and: <?php echo $_SESSION['mygedcom']; ?> However, now with TNG 15.0.2, the above no longer work at all. Does anyone know if mypersonID and mygedcom have changed to something different in TNG 15? Thank you in advance & have yourselves a great day. Regards, John
  6. TNG version: 14.0.6 and 15.x Data source: Legacy Family Tree v10 Hello MySQL experts, Firstly, I took a look at all of the reports written by Henny Savenije, and also the reports list here in the Wiki, but unfortunately none of them are what I am looking for. Background: When I first got into Genealogy more than 25 years ago, I was very lax setting new users to either Living or Not Living. As a result, I have many (possibly thousands of) people in my tree who lived many centuries ago, but currently show in TNG as Living because there are no birth/dates associated with them. Both Legacy and TNG can set/display users as Living or Not Living, based on settings & utilities/processes, but they can only do so when dates are known. I have my TNG sites set to correctly protect (not display certain things), based on if users are logged in or not. That is not the problem, and not what I am inquiring about here. Problem: As mentioned above, I have many (possibly thousands of) people in my tree who lived many centuries ago, but currently show in TNG as Living because there are no birth/dates associated with them. An example of where this becomes sorta comical (but also annoying!) is when displaying ancestor charts. I've randomly come across some ancestor charts on my site, which has one or more individuals showing birth and/or death dates from centuries ago (example, dates in the 1700s), but above them is listed an ancestor showing as Living (because I have no dates for that ancestor). To illustrate easily what I am trying to explain, I temporarily removed all dates from one of my ancestors in order to make the below screenshot. Look at the below screenshot, and note on the 2nd generation from the top, the husband of Israel MEADEN. Even though he lived in at least the 1600s and possibly 1700s too, and therefor would've died about 300 years ago, in TNG he is still showing as Living : In the above example, the problem is NOT with TNG... TNG is correctly displaying what it is setup to display. The problem is with my Legacy program exporting that person as still living, so I need to manually change that & similar people in situations like that to Not Living in Legacy. But how can I know, which individuals who lived 125+ years ago, are set in my Legacy database as still Living? Using TNG's report-writer, I very-easily created a basic report to display all people on my TNG site who do not have a born/baptized/died/buried date. However, many of those individuals displayed using that report were born less than 125 years ago, so could quite possibly still be alive. Solution: I am hoping that a MySQL expert can help me create a report, which will display all users: with NO died/buried date; and who have a spouse and/or children who have ANY date associated with them that was more than, say, 110 years ago. By dates associated with them, the dates could be for any of the following (but at least one of those dates): born/baptized/died/buried; any alternate date; any other date, such as: census, education, marriage, residence, marriage, etc. So for criteria 2 (above), rather than the MySQL report searching for specific dates, hopefully the MySQL code can just search for ANY date associated with those spouses & children which were more than 110 years ago. Would such a report be doable? If yes, then I could run that report myself, which will tell me which specific individuals in my Legacy database that I need to individually change from Living to Not Living manually . Thank you in advance, and have a great day. Regards, John
  7. Today I noticed that my website wat targeted several hundred times by Huawei bots The picture below shows only a few of the many visited pages. I previously made changes to my robots.txt and .htaccess file to prevent bots like this from accessing my website. I have the following mods installed to prevent unauthorized access to my website. 404 Error - TNG_Wiki supported by @Steve1200 Bot-Trap - TNG_Wiki updated by @Steve1200 Restrict Access mod - TNG_Wiki Not supported atm Rip Prevention Mod - TNG_Wiki supported by @bhemph There are a few things that worry me: How is this bot able to bypass my Google Captcha/reCaptcha request? How is this bot able to bypass my Login requirement? How is this bot able to bypass the restictions set by the mods mentioned above? Hope the forum can shed a light on these questions. I did notice that the Restrict Access mod - TNG_Wiki isn't protecting the chronology.php file by default. This chronology.php file is added by Chronology - TNG_Wiki supported by @Michel KIRSCH So to make sure the Restrict Access mod - TNG_Wiki is protecting the chronology.php file I added the code below to the restrict_access_v12.0.1.7.cfg file in order to allow access to this page to logged in users only. COMMENT: Allows only logged-in users to view Chronology %target:chronology.php% %location:% include( "tng_begin.php"); %end:% %insert:after% if( ! $allow_admin ) { $showguest=0; include("$extspath/noaccess.php"); exit; } %end:%
  8. Citation Master V10 for TNG 15 is now available from the TNG Wiki. New Features: A new separator option, 'none', that basically suppresses field separators entirely--supports a form of concatenation between fields. Mod parameter values are now preserved across installations when the entire mod is not replaced. Media attached to citations are now displayed in the 'Sources' section of individual pages. This is a TNG feature that was originally adapted by Citation Master V8 for source media, but citation media were not displayed in that version. Now one or the other is displayed when enabled in mod parameters, with citation media having precedence. Bugs Fixed: Log messages left over from the introduction of the configuration caching mechanism have been removed. PHP 8.4 function deprecation warnings have been fixed. Other Changes: With this release, the administrator interface for editing format specifications has been removed. (The feature was always a security risk that needed to be addressed. Removal is simpler than adding additional security checks that would require support in the Mod Manager.) In place of the format specification editor, a simple function for reloading the current format specification has been implemented. This supports loading a specification into the mod when it has been changed outside of TNG. If you are running TNG 15.0, Citation Master V10 is optional but recommended. If you are running TNG 15.0.1, V10 is required. Finally, I will be back-porting this version of Citation Master to TNG 14. That release should be ready in about a week. Bill Herndon Lindell-Herndon Genealogy
  9. Kirsti

    Cookies

    Hi. WIthin EU law it is not enough to tell visitors that the site uses cookies. "The EU cookie law, or simply cookie law is the commonly used term to refer to the ePrivacy Directive (ePD). It is a piece of legislation that requires websites to obtain consent from users before storing, using, or retrieving cookies from their devices, except for strictly necessary cookies." (from an online source). I have activated in Setup a function that tells visitors about cookies. Is it possible to extend TNG to include EU law? Or is this a C-panel topic? As for now, site is illegal in Europa when it comes to cookies. In principle, I could be fined, even if it's not very likely that anybody would go after a small geneology site
  10. Simple SEO V8 for TNG 15 is now available from on the TNG Wiki. It's been a long time since the last major release, and the accumulated TNG code changes forced me to rethink and refactor a lot of the code. New Features: A new option for date formats called "minimal" that strictly adheres to how TNG calculates and displays it's 'year only' dates like "(1914 - 1992)". (This feature resulted from a discussion with a TNG user who noted that sometimes TNG "rounds up" and "rounds down" years in response to imprecise dates.) New processing for the "short" and "long" date formats that adhere to the most current TNG calculation and display algorithms. (One thing to note here is that the "short" format remains the default but now includes the imprecise date markings such as "abt", "bef", and "aft". If these are not your preference, you may prefer the new "minimal" format.) Individual and Family IDs, when requested through the mod parameters, are now displayed on almost all tabs related to individuals and families, but remain absent in HTML headers in page titles. Bugs Fixed: The infamous "suggest.php" bug that was causing a blank page when executed from familychart.php Two bugs related to warnings generated by familygroup.php. Testing: With this release, I implemented a new set of testing procedures to ensure that all privacy options were covered--making sure that installations with Simple SEO function exactly the same as unmodified TNG installations. This release of Simple SEO has less code and should be more resistant to TNG changes from release to release, but...the expanded ID feature results in more files being touched by the mod, and this may result in mod conflicts. I would appreciate any reports of mod conflicts so that I can address them quickly. There is some testing that has been done here, but it's frankly never enough. Finally, I will be back-porting this version of Simple SEO to TNG 14, but please be patient with me. TNG 14 required 4 separate releases of Simple SEO. So the work may take a bit of time. Bill Herndon Lindell-Herndon Genealogy
  11. Good day, I have TNG 14.0.2, Template 14, with modified colors and fonts. There is a multi-function box on the left side, below the heading, to log in or search names. What I'm trying to do is place a second box right below it to place links to pages and stories. I've been trying to find the exact insert point in the index.php file, with no success. Can anybody help? Thanks.
  12. ton van steenoven

    Custom Field

    In our earlier site we had the opportunity to code a default web link in the individual person page and add personal items to it as a search in another website we manage. I wonder if it is possible to do so in TNG. If, than please give a hint. Regards Ton van Steenoven
  13. Rob Severijns

    Adding additional maps to the OSM mod

    Currently OSM is supporting the following maps: OSM (default), OSMFR, SURF, EWSM, EWTM, SAT, HYDDA, WIKI, MTB and TOPO. 89 people have registered as using the mod. Looking at who's using which map I notice the following: 69 out of 89 use the OSM map, 8 use the EWSM map, 2 use the EWTM map, at least one uses OSMFR (Hi @Katryne 😁) and 16 didn't mention which map option they use. That said the most commenly used map is OSM which has one big downside. The map shows names in the langauge of the region which makes reading them very difficult. Since the creation (2018) of the OSM mod by the late Erik Hoppe many other OSM maps have become available. Some of those maps can be found here: osMap - OpenStreetMap Wiki There are ten online worldmaps available in the following languages: English, Czech, Danish, Dutch, French, German, Italian, Polish, Portuguese, and Spanish. That covers the majority of the languages spoken in the world. I don't know if it much work to add those maps to the OSM mod but I'm sure it would benefit a lot of OSM users. We could even consider dropping some of the existing map options currently in OSM but that's up for debate. Let me know how you feel and hopefully someone is able/willing to try and update the OSM mod. If you feel up to it or wish to participate let us know here so we can start a workgroup. I for one am willing to participate as a tester and give input for possible options in the OSM mod. Of course any other ideas are welcome too. Kind regards, Rob
  14. Since we can't change and save the colors by doing an Inspect function in Google, how can we change the colors now efficiently in version 14?
  15. Hi everyone, I've searched the forum and although there are questions about the surname cloud, none seem to address my problem. I have had the surname page on the home/index page of my website, but having changed server recently, and since I am upgrading to tng 14, I decided to organise my site with tng in a subfolder to make everything more streamlined. I don't use templates, I code my own bootstrap 5 pages. I would like however to display the surnames on the new index/home page in the main directory which obviously means the link to get the info from the tng directory. I can't for the life of me figure out how to add the code snippet at the top of the page coding nor the snippet where I want the cloud to be displayed... as per these snippets include("surname_cloud.class.php"); <!--- surname cloud php goes here ---> <?php $nc = new surname_cloud(); $nc->display(100); ?> I'm assuming that the first bit would simply require the change to the link for instance "tng/surname_cloud.class.php" but any ideas as to the code to put into the space I want it to display please? Hoping someone will know how to help me Thank you in advance
  16. The Heat Map does not show when using the built-in Heat Map link. The first image shows what is rendered when clicking on Find > Places > Heat Map. The second image shows the Info > Place Maps (Place Map mod v.place_map_v13.0.0.0.cfg), which works perfectly. The third image is the Event Map under my individual record, which also works perfectly. I have Google and OSM installed and configured, and I have tried both to render the built-in Heat Map (no mod is required, I think). I do not see any errors in the logs. I am missing something somewhere. I have scoured the TNG Community, Wki, and the Internet and have seen a few items, such as ensuring all places have Lat/Lon (they do) and changing templates (I did), Google map key locked in (it is), OpenStreetMaps initiates and works (it does), but I have hit a wall. Do you have any ideas about what I should look at to solve this mystery? Thank you to all. Regards,
  17. Hello everyone, Many years ago I added three fields with "today's" birthdays, marriages and deaths to my main page. I would like to add it again, but to be honest, I no longer know how I did it or/and which file I edited. (I use template 12) Can anyone help me with this?
  18. I have read TNG's Wiki entry: User Pages - Getting Started: http://tng.lythgoes.net/wiki/index.php/User_Pages_-_Getting_Started I have downloaded Dave Freeman's, Creating Extra Pages for Use in TNG, from 2007: Extra_Page_Template_Procedure.doc I have Notepad++ on my desktop ready to use. I have searched the forums using several keywords and cannot find specific instructions for a very novice coder. All that and I STILL don't know where to begin because I cannot find: historytemplate.php in my public_html folder. "Histories" are there but I cannot find any php file. I am using TNG V 11.0.1 and template 12. I am using Simply Hosting and can see my directory through cpanel access. At the moment, I am feeling newer than a newbie and feel I must be missing something simple. Usually I can follow directions well but adding a new page is defying me. I would appreciate help pointing me in the right direction . . . Thanks much, Margie B.
  19. John Paul

    infomenulinks issue [Solved]

    Good morning all. I seem to have an issue moving a couple of menu items from the More menu to the Info menu using customconfig.php. It looks like I have all the syntax correct in customconfig, and both cust_text.php files. But as seen in the attachment, I'm getting duplicate labels for Data Protection...it should be Data Protection and FAQs and Help. Maybe a second pair of eyes would help? Just wanted to add that the links to them are correct. go to my site in the signature and you'll see what I mean. Also the screenshot for cust_text.php applies to both English and English UTF8.
  20. When a user enters the site for the first time, I want to have a popup notice, similar to the GDPR that would be viewed and clicked to close. It would need to be one that may be changed according to circumstances. For instance, maybe for the month of January, I have a Happy New Year popup and then in February I have a popup making a plea for users to add their family information, or even a popup to fundraise. Preferably it would only pop up once each time the site is entered, be centered at the top of the screen and be small enough (max 375px wide) to fit mobile device screens. The container would need to hold text and an image. Has this been discussed before? I have not seen it and apologize if it has. Short of a popup box, I'd be happy to with adding a custom button to link to an outside page at the bottom of the home page above the footer. I'll take the easy way out, probably a button, but a pop up, as aggravating as they are, would be most desired. If anybody has suggestions OR if there's a mod to do this please help. Thanks
  21. Adri1

    Adjust addressID

    I want to insert items from tng_addressescopy into tng_addresses but with specific addressID's. So I'm trying to adjust from tng_addressesCopy the addressID so I can give them specific ID's. Now it starts for the first at 6522 and go to 7222. I'd like to adjust them my own ID's (start with 2100 to .....) Is there a way to do that?
  22. Hello again, folks, In my blurb at the top of my Cemeteries page, I have a hyperlink to suggest.php for users to submit any discrepancies that they find. The code that I currently have for that hyperlink is: <a href='suggest.php' class='sidelink' target='_blank'><span style='color:blue;'><b>HERE</b></span></a> I have seen where mod developers have a special form, where when a user is taken to those forms, the subject field is pre-populated with the name of the mod that the form is for. Is there a way that I can include, in my above hyperlink, some additional code that would pre-populate the subject field on the suggest.php form with some text? For example, I would like, when the user clicks on the hyperlink, for the suggest.php form to open with the Subject field pre-filled with something like Cemetery error/discrepancy/suggestion. Is that possible, and if so, how? Thanks in advanced. Regards, John
  23. As per Darrin's request, I have posted a mod, Fix_Branch_Select only for those with TNG 14.0.4 installed and having issues selecting or finding branches in the Advanced Search form. It reverts TNG 14.0.4 changes to searchform.php. As such it will be obsoleted by Darrin's next upgrade or update to TNG which will resolve the issue. It is an optional mod for a minor TNG 14.0.4 issue. Ron
  24. TNG 14.x Hello, folks, When we display browsemedia.php (by selecting All Media, Documents, Photos, etc.), over in the Linked to column, by default TNG displays perhaps a maximum of about a dozen or so individuals for each media item. If more than that number of individuals are linked to a media item, TNG displays ['More Links'] after the last person, which when clicked on takes the user to the actual media item (showmedia.php), with more individuals listed in the details near the bottom in that page's Linked to section. Sometime earlier this year or last year, someone told me how to increase the number of individuals in the Linked to column for each media item. An example of the increased number of individuals linked can be see here on THIS page. If you look at the 4th media item (Paget) on that page, notice that I have 81 individuals listed. However, I need to drastically increase the number of individuals linked, but my problem is that I can't remember where to make that change, nor who was the person in the forums that told me how to do that . I've searched the forums here, my PMs, and my personal email, but I am unable to find where I was told what to change. And I don't think that it is a Mod on my site that has increased that number. So my 1st question is: what file do I modify, and exactly what in that file do I modify, in order for browsemedia.php to display more individuals in the Linked to column? Now, I just noticed for that same 4th media item on that page, that although browsemedia shows the first 81 individuals before the ['More Links'] is displayed, the showmedia.php page for that same 4th media item shows the next 54 individuals linked to that 4th media item, and the users needs to keep pressing ['More Links'] to see the next group of individuals, etc. So my 2nd question is: where is it defined to only show on the showmedia.php page 54 individuals at a time, as I would like to be able to change it so that showmedia.php shows all of the remaining individual linked to each media item... if possible. Thank you in advance, and have yourselves a great day. Regards, John
  25. TNG 14.0.4 MySQL 8.0.35-cll-lve Hello, folks, This question is for the SQL experts in the forums here. I will first descibe why I am asking the question in this post, before anyone replies to me asking why I wish to do this . When I look in phpMyAdmin, for my TNG database, I see a table called tng_eventtypes In that table, I see a key (if key is the right name) called ordernum All of items (tags) have an ordernum of 0 (except for a few that I have already started to rebumber). I have recently installed Bob Carver's Sort Events ByOrder Mod, and I am in the process of renumbering the Display Order of my Events in TNG, so that I can sort them. The problem is, all the existing events (about 130 of them) all have that ordernum of 0, so until I get them all renumbered, all events that are 0 will be listed in TNG at the top of the Events section. So my question is: Is there an SQL command that I can run in phpMyAdmin, that will renumber the ordernum of all events in the tng_eventtype table that currently have an ordernum of 0 to something like 999 ? I hope that makes sense. Thank you in advance. Regards, John
×
×
  • Create New...