WlaKom Posted April 25, 2025 Report Share Posted April 25, 2025 This is the information I received from Gemini AI. It's too complicated for me. Maybe you know someone who would change it to 'mod'. **************************************** 1. CalculateMarriageDuration() function (to be added in personlib.php or at the beginning of familygroup.php): <?php function calculateMarriageDuration($startDate, $endDate = null) { if (!$startDate) { return ''; } try { $start = new DateTime($startDate); $end = $endDate ? new DateTime($endDate) : new DateTime(); // Use current date if no end date exists $interval = $start->diff($end); $years = $interval->y; $months = $interval->m; $days = $interval->d; $durationString = ''; if ($years > 0) { $durationString .= $years . ' rok' . ($years == 1 ? '' : ($years >= 2 && $years <= 4 ? 'i' : 'ów')); } if ($months > 0) { if ($durationString != '') $durationString .= ', '; $durationString .= $months . ' miesiąc' . ($months == 1 ? '' : ($months >= 2 && $months <= 4 ? 'e' : 'y')); } if ($days > 0 || $durationString == '') { // Show days if years/months are missing or if days are present if ($durationString != '') $durationString .= ', '; $durationString .= $days . ' dzień' . ($days == 1 ? '' : ' dni'); } return trim($durationString, ', '); } catch (Exception $e) { // Handling errors, e.g. invalid date format return ''; } } ?> 2. Modification of displayIndividual() function (optional, in familygroup.php): Find the code block for displaying information about the marriage in the displayIndividual() function (starting with if( $showmarriage ) {). Add the code to calculate and display the marriage duration inside that block: PHP <?php // ... inside the block if( $showmarriage ) ... if( $famrights['both'] && $rights['both'] ) { $event['date'] = $fam['marrdate']; $event['place'] = $fam['marrplace']; $eventc['date'] = $fam['marcdate']; $eventc['place'] = $fam['marcplace']; // Calculate the length of marriage $endDate = $fam['divdate']; if (!$endDate && isset($ind['personID']) && $ind['personID'] == $famrow['husband'] && $wiferow['living'] != '1' && $wiferow['private'] != '1') { $endDate = $wiferow['deathdate']; } elseif (!$endDate && isset($ind['personID']) && $ind['personID'] == $famrow['wife'] && $husbrow['living'] != '1' && $husbrow['private'] != '1') { $endDate = $husbrow['deathdate']; } $marriageDuration = calculateMarriageDuration($fam['marrdate'], $endDate); if ($marriageDuration) { $event['date'] .= " ($marriageDuration)"; } // ... the rest of the code displaying information about marriage ... ?> 3. Modification of the main part of familygroup.php: Find the place in the main body of the familygroup.php file after you've downloaded the $famrow, $husbrow, and $wiferow data. Add the code to calculate and display the marriage duration as a separate fact: PHP <?php // ... after downloading $famrow, $husbrow i $wiferow ... $famtext = ""; $personID = $famrow['husband'] ? $famrow['husband'] : $famrow['wife']; $fammedia = getMedia( $famrow, "F", true ); $famalbums = getAlbums( $famrow, "F" ); $famtext .= "<ul class=\"nopad\">\n"; $famtext .= beginSection("info"); //$famtext .= "<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" width=\"100%\">\n"; // Calculate the length of marriage $endDate = $famrow['divdate']; if (!$endDate && $husbrow['living'] != '1' && $husbrow['private'] != '1') { $endDate = $husbrow['deathdate']; } elseif (!$endDate && $wiferow['living'] != '1' && $wiferow['private'] != '1') { $endDate = $wiferow['deathdate']; } $marriageDuration = calculateMarriageDuration($famrow['marrdate'], $endDate); if ($marriageDuration && $rights['both']) { $famtext .= showFact($text['marriage_duration'], $marriageDuration); // Make sure you have this entry in your language file } //get husband & spouses if( $famrow['husband'] ) { $query = "SELECT * FROM $people_table WHERE personID = \"{$famrow['husband']}\" AND gedcom = \"$tree\""; $result = tng_query($query); $husbrow = tng_fetch_assoc($result); $label = $husbrow['sex'] != "F" ? $text['husband'] : $text['wife']; $famtext .= displayIndividual($husbrow, $label, $familyID, 1); tng_free_result($result); } //get wife & spouses if( $famrow['wife'] ) { $query = "SELECT * FROM $people_table WHERE personID = \"{$famrow['wife']}\" AND gedcom = \"$tree\""; $result = tng_query($query); $wiferow = tng_fetch_assoc($result); $label = $wiferow['sex'] != "M" ? $text['wife'] : $text['husband']; if( $famrow['marrdate'] || $famrow['marcdate'] || $famrow['divdate']) $label = $husbrow['sex'] != "M" ? $text['wife'] : $text['husband']; else $label = $husbrow['sex'] != "M" ? $text['partner'] : $text['partner']; $famtext .= displayIndividual($wiferow, $label, $familyID, 0); tng_free_result($result); } // ... the rest of the code familygroup.php ... ?> 4. Adding a language entry (jeśli używasz showFact()): In the language file (e.g. languages/Polish/text.php): PHP <?php // ... other language entries ... $text['marriage_duration'] = "Length of marriage"; // ... ?> Summary of changes you need to make: 1. Add the calculateMarriageDuration() function to personlib.php or at the beginning of familygroup.php. 2. Optional: Modify the marriage display block in the displayIndividual() function in familygroup.php to display the duration next to the date. 3. Modify the main body of familygroup.php to calculate the marriage duration and display it using showFact(). 4. Optional: Add a language entry for "Marriage Duration" in the appropriate language file. ************************************************************************ Quote Link to comment Share on other sites More sharing options...
Katryne Posted April 25, 2025 Report Share Posted April 25, 2025 Hello The TNG mod "Age at marriage" can display the lengh of marriage too. Give it a try. Quote Link to comment Share on other sites More sharing options...
tngrlkrz Posted April 25, 2025 Report Share Posted April 25, 2025 You don't need a new mod. Definitely try Michel Kirsch's Age at Marriage, and even Age at Event. Both are excellent mods with Edit Options as well. Ron Quote Link to comment Share on other sites More sharing options...
theKiwi Posted April 25, 2025 Report Share Posted April 25, 2025 My question is "How does Gemini AI know what the code behind TNG is?" Roger Quote Link to comment Share on other sites More sharing options...
Michel KIRSCH Posted April 26, 2025 Report Share Posted April 26, 2025 21 hours ago, theKiwi said: My question is "How does Gemini AI know what the code behind TNG is? I guess WlaKom gave the code as a "fact" before he ask the AI... Michel Quote Link to comment Share on other sites More sharing options...
WlaKom Posted April 27, 2025 Author Report Share Posted April 27, 2025 13 hours ago, Michel KIRSCH said: I guess WlaKom gave the code as a "fact" before he ask the AI... Michel Quote Link to comment Share on other sites More sharing options...
WlaKom Posted April 27, 2025 Author Report Share Posted April 27, 2025 <> Quote Link to comment Share on other sites More sharing options...
WlaKom Posted April 27, 2025 Author Report Share Posted April 27, 2025 On 4/26/2025 at 1:28 AM, theKiwi said: My question is "How does Gemini AI know what the code behind TNG is?" Roger I don't know how Gemini found the TNG files. I just asked a question and sent getperson.php. Quote Link to comment Share on other sites More sharing options...
Katryne Posted April 27, 2025 Report Share Posted April 27, 2025 I am not sure the TNG license allows even partial redistribution of the code, especially to an IA which will save it somewhere in its bowels for further use. Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted April 27, 2025 Report Share Posted April 27, 2025 31 minutes ago, WlaKom said: don't know how Gemini found the TNG files. I just asked a question and sent getperson.php. You just admitted that you sent them the getperson.php file which as Katryne indicates violates the TNG software License Quote Link to comment Share on other sites More sharing options...
WlaKom Posted April 27, 2025 Author Report Share Posted April 27, 2025 8 minutes ago, Ken Roy said: You just admitted that you sent them the getperson.php file which as Katryne indicates violates the TNG software License I think that in the future, TNG must state its clear attitude towards AI. Currently, we are starting to ask AI about almost everything. In programming, it is necessary to give AI some of the code that we want to change or create new. Quote Link to comment Share on other sites More sharing options...
theKiwi Posted April 27, 2025 Report Share Posted April 27, 2025 12 minutes ago, WlaKom said: I think that in the future, TNG must state its clear attitude towards AI. Currently, we are starting to ask AI about almost everything. In programming, it is necessary to give AI some of the code that we want to change or create new. Ask yourself if Microsoft or Adobe would give their code to "AI" so that users of those products might make changes to them. I don't see why TNG would/should be any different. Roger Quote Link to comment Share on other sites More sharing options...
Katryne Posted April 27, 2025 Report Share Posted April 27, 2025 I just quoted the license terms that are included in any TNG pack : they forbid any redistributing of any part of code. I am not the police, but personnally I think it's both wrong and risky to give away any code to an AI whose mission is precisely to steal as much information as possible without respecting any copyright. Quote Link to comment Share on other sites More sharing options...
WlaKom Posted April 27, 2025 Author Report Share Posted April 27, 2025 22 minutes ago, Katryne said: I just quoted the license terms that are included in any TNG pack : they forbid any redistributing of any part of code. I am not the police, but personnally I think it's both wrong and risky to give away any code to an AI whose mission is precisely to steal as much information as possible without respecting any copyright. I don't understand how AI works. When I wrote my own application and asked a question to look into another application, I got information that it may be private data or proprietary. That's why I don't understand how AI found the remaining TNG files. There should be an alert that these are private and it can't access them. That's why I think there should be something in the TNG codes telling AI that this is private data. Quote Link to comment Share on other sites More sharing options...
Darrin Lythgoe Posted April 28, 2025 Report Share Posted April 28, 2025 Thanks to all who have commented on this so far. I think I have to say that I agree with Katryne and theKiwi, that feeding any distinguishable part of the TNG code into an AI program (like Gemini AI or ChatGPT) violates the license agreement. It might seem harmless because you're not sharing it anywhere public, or with any other person, but the AI programs incorporate the code you give it into their core knowledge, and then they may share it again with others, either in part or as a whole. So...please don't do that. I will amend the license and/or make public statements soon to make sure as many TNG users as possible are aware of this application of the policy. Quote Link to comment Share on other sites More sharing options...
Philip Roy Posted April 28, 2025 Report Share Posted April 28, 2025 I'll put my hand up and confess that I used Chat GPT to help someone with formatting issues here on the site, by pasting what rendered onto their main site page into Chat GPT. @Darrin Lythgoe I made sure that I had turned data controls to not share with the Chat GPT model, as you can read here... https://help.openai.com/en/articles/7730893-data-controls-faq https://help.openai.com/en/articles/5722486-how-your-data-is-used-to-improve-model-performance I'd suggest your public statement will need to explain where the license agreement stands on this. I confess I felt comfortable doing what I did as (a) all the code that I pasted into Chat GPT was already publicly visible and no doubt trawled by numerous systems and (b) because I had activated the data protection settings in the app. So I would suggest you would need to be very explicit about what is and isn't acceptable. Hope that helps. Quote Link to comment Share on other sites More sharing options...
WlaKom Posted April 28, 2025 Author Report Share Posted April 28, 2025 (edited) <> Edited May 2, 2025 by WlaKom Not related to topic Quote Link to comment Share on other sites More sharing options...
theKiwi Posted April 28, 2025 Report Share Posted April 28, 2025 19 hours ago, Philip Roy said: I'd suggest your public statement will need to explain where the license agreement stands on this. I confess I felt comfortable doing what I did as (a) all the code that I pasted into Chat GPT was already publicly visible and no doubt trawled by numerous systems and (b) because I had activated the data protection settings in the app. There is quite a difference between feeding and AI machine the HTML code that is rendered by a browser, and feeding the PHP code from TNG files that queries the database and then presents the HTML output to a browser to display. Roger Quote Link to comment Share on other sites More sharing options...
Philip Roy Posted April 28, 2025 Report Share Posted April 28, 2025 I know....which is why I said... Quote I would suggest you would need to be very explicit about what is and isn't acceptable. Quote Link to comment Share on other sites More sharing options...
Edge-IX Posted April 28, 2025 Report Share Posted April 28, 2025 11 minutes ago, theKiwi said: There is quite a difference between feeding and AI machine the HTML code that is rendered by a browser, and feeding the PHP code from TNG files that queries the database and then presents the HTML output to a browser to display. Roger Roger, As an FYI, ChatGpt already has a full working edition of TNG 14.0.2 in it's database. I cant speak for other versions of TNG, on other AI sites. But I can say the horse has already bolted. So any rewording of anything is pointless. I will let Darrin know by email. OpenAI for example, if used from a browser on your home computer, will read all the files and programs on your system, (installed or not) including all browser bookmarks, history and open tabs. This was tested on our servers and confirmed. So anyone using Open AI, BE WARNED.!!! Your computer will slow down, to the point, where you have to shut down and reboot, if your lucky. Cheers Drew (edglimited) Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted April 29, 2025 Report Share Posted April 29, 2025 14 hours ago, Edge-IX said: As an FYI, ChatGpt already has a full working edition of TNG 14.0.2 in it's database. I cant speak for other versions of TNG, on other AI sites. But I can say the horse has already bolted. So any rewording of anything is pointless. I will let Darrin know by email. Drew, So how do we keep AI out of our sites, whether it is ChatGPT or OpenAI. Quote Link to comment Share on other sites More sharing options...
theKiwi Posted April 30, 2025 Report Share Posted April 30, 2025 On 4/28/2025 at 7:45 PM, Edge-IX said: OpenAI for example, if used from a browser on your home computer, will read all the files and programs on your system, (installed or not) including all browser bookmarks, history and open tabs. This was tested on our servers and confirmed. So anyone using Open AI, BE WARNED.!!! Your computer will slow down, to the point, where you have to shut down and reboot, if your lucky. I find that surprising particularly as I'm a macOS user. This Google search https://www.google.com/search?client=safari&rls=en&q=can+openai+read+all+the+files+on+my+computer&ie=UTF-8&oe=UTF-8 doesn't seem to give any answers that confirm you assertion. Roger Quote Link to comment Share on other sites More sharing options...
Philip Roy Posted April 30, 2025 Report Share Posted April 30, 2025 Fellow Mac user and simply don't believe that either. Oh...and Chat GPT also said it's not true...sorry, just did that for laughs and to see what it said. Now I would have been REALLY impressed if it had said "Have you been talking to Drew?" 😆🤣 Quote Link to comment Share on other sites More sharing options...
WlaKom Posted May 2, 2025 Author Report Share Posted May 2, 2025 To the Moderator: Please change the topic name to AI and TNG, because I would like to use the current name to solve my problem with the age of marriage on the family page. Quote Link to comment Share on other sites More sharing options...
Katryne Posted May 2, 2025 Report Share Posted May 2, 2025 Your are the one who started the thread, so you are the one that can edit the first message, including the title. Click on the 3 dots on top right of 1st message. 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.