Jump to content
TNG Community
theKiwi

Search for Connections Mod

Recommended Posts

theKiwi
40 minutes ago, ton van lil said:

Hello,

I am trying to install the Search_for_connections mod but get an error. See below.

image.png

What is wrong?

Greetings

Ton



 

You've probably got some other Mod installed that changes genlib.php - if you have the Fixed Family Tabs mod, uninstall that, install this one and then reinstall the Fixed Family Tab mod.

If it's not that one, use the Analyse Mods tab in Mod Manager to find out what Mod is changing genlib.php.

Roger

Share this post


Link to post
Share on other sites
mjaro

Hi Ton,

Do you have Fixed Family Tab mod installed?

If so please uninstal it, then install my mod, and then reinstall FFT. 

Give me a message if it was the case.

Michał

Share this post


Link to post
Share on other sites
mjaro
On 2/11/2021 at 2:18 PM, mjaro said:

For displaying persons' thumbnails I use the standard TNG functions. 

Ken,

I see I do use non-standard function. I'll try to return back to the TNG standard getSmallPhoto(). I assume that it works also with the old naming standard, am I right?

I see also my hard-coded use of gender thumbs 😡. The time I coded these I couldn't cope with the use of standard function, but I should be able to do it now.

Michał

 

Share this post


Link to post
Share on other sites
ton van lil

Thanks. It works now.

It was FGWTabs that prevented me from installing Search fpr Connections Mod.

Greetings

Ton

 

 

Share this post


Link to post
Share on other sites
ton van lil

Thanks for this wonderful mod.

Greetings

Ton

 

Share this post


Link to post
Share on other sites
Ken Roy

Michal,

Publishing personal mods is always a learning process on the first one. 

Use of TNG css classes might also be beneficial.  I have not had a chance to look at it closely since I am still trying to resolve some issues with the MediaWiki upgrade

Very impressive mod that shows connections I might not have followed

Share this post


Link to post
Share on other sites
Ken Roy

Sorry, I did not answer your question. 

I would have to look at what function is used in the TNG charts, but I think that the  getSmallPhoto function is the correct one. 

Share this post


Link to post
Share on other sites
theKiwi
On 2/12/2021 at 9:34 AM, mjaro said:

Ironically, both kinds of the problems are because - as a novice programmer learning PHP 7 - I coded very carefully according to the patterns I read... (the problematic ": string" was return type declaration, another was parameter scalar type declaration - both introduced in PHP 7; the part containing global is a recommended comment explaining function definitions). 

 

@mjaro I've found a different solution now for this problem...

Change lines 11 and 44 by putting a ; (semi-colon) after $visited - so

 $visited; - list of visited nodes (distance, prev node, relation to the prev)

So now when the TNG-WordPress plugin scans all the files looking for global variables, it finds a variable called 

 $visited

instead of finding a variable called

$visited - list of visited nodes (distance, prev node, relation to the prev)

Roger

Share this post


Link to post
Share on other sites
mjaro

Good!

my solution was to write (in comments) g1obal with inentional misspelling ;)

But yours is better!

Share this post


Link to post
Share on other sites
theKiwi
27 minutes ago, mjaro said:

Good!

my solution was to write (in comments) g1obal with inentional misspelling ;)

But yours is better!

I thought about that too, but figured that was a bit clumsy...

I have a couple of other comments about the next update...

1 - Name the folder of files that comes with the Mod to

search_for_connections

that way it will be in the Mods folder listed next to the .cfg file which should be of the form

search_for_connections_V13.0.2.x

2 - the zipped download should also have the same name

3 - put nextpaths.css into the site's main css folder rather than the tng folder to keep it with all the other css files

4 - put comments in nextpaths.css in those first few lines that are defining the colour variables to explain what each variable controls (i.e. table background, box background, etc)
By the way - nice to see the use of variables in the css - I wish TNG did that as there are so many places that use the same colour that are all defined, and all have to be over-ridden to change colours in a site - using the variables means that you only have to make the change once!!

5 - the use of "search for connections" and "nextpaths" - if everything was searchforconnections, or perhaps even just "connections", it would be easier to see what files belong to different mods, so the Mod would be "connections_v_13.0.2.x", the folder of files that comes with the Mod would be connections, the css would be connections.css and the working files connections.php and connections2.php.

But I have to say this is a brilliant Mod, and one that hopefully Darrin might like enough to incorporate into TNG. Well Done!!

Roger

Share this post


Link to post
Share on other sites
Ken Roy

Michal,

I agree with Roger on the use of Connections for the mod name, folder and zip file, and possible also for the tab you add.  To put the nextpaths.css or renamed connections.css in the TNG css folder you would use the $copyfile2 directive to put it in another folder

If you decide to rename the mod, let me know what your TNG username is and I will make sure you have rename (Move) authority on the TNG Wiki.

Share this post


Link to post
Share on other sites
mjaro

Roger,, and Ken

I'll follow your advice! (I'd explain myself that from the very beginning my work was called NextPaths which was close to the key algorithm name; this was the reason of the further mess in naming...)

I'm finishing also other improvements:

 - mod options for presetting search parameters

 - just received Norwegian translation from User:Kare

 - use TNG standard getSmallPhoto() in place my own function (at my beginnings I had problems understanding names visibility) - Ken's pointing out

 - multiple smaller code improvements and cleaning unnecessary debug commented lines.

I'm pleased to read the praise as this is my first program in my 73y life!  It's fantastic that I have such experienced and patient advisers. Thank you!

Michał

Share this post


Link to post
Share on other sites
Ken Roy

Michal,

I am impressed if this is your first program.   

Share this post


Link to post
Share on other sites
Michel KIRSCH
38 minutes ago, Ken Roy said:

I am impressed if this is your first program.

I'm too. Really.

Michel

 

Share this post


Link to post
Share on other sites
tngrlkrz
1 hour ago, Ken Roy said:

I am impressed if this is your first program.   

When I volunteered to test his first version of this mod and  asked if he should publish, I told Michal, 'Yes', and 'Wow, Amazing!'.  If he first learned programming one year ago,  he is a 'natural' for it.

Share this post


Link to post
Share on other sites
theKiwi

A question on what to expect with this Mod - If I make myself the Person 1, and my great great grandfather the Person 2 as here

image.png

I get this - shows a single path between us

http://tngwp.lisaandroger.com/tng_13.0/nextpaths.php?altprimarypersonID=I1&savedpersonID=I16&secondpersonID=I16&maxL=33&maxR=99&sortpathsby=true&primarypersonID=I32&tree=Roger

But if I reverse that, and make my great great grandfather Person 1 and myself Person 2, then I get 4 possible paths

http://tngwp.lisaandroger.com/tng_13.0/nextpaths.php?altprimarypersonID=I16&savedpersonID=I16&secondpersonID=I1&maxL=33&maxR=99&sortpathsby=true&primarypersonID=I1&tree=Roger

I guess I was expecting that starting at either end would result in the same number of paths?

Roger

Share this post


Link to post
Share on other sites
tngrlkrz

Yes,  I have noticed that also.  It is consistent.  Up the tree to my g-g-grandfather, from myself as primary, I have 1 path, but the reverse results in 7 paths, but in both cases, the first path is the same and the shortest. It seems that the logic results in less paths if the primary (@) must go up the tree, versus down the tree.

Share this post


Link to post
Share on other sites
Michel KIRSCH

Ron, if you remember, we have found the same problem when testing the add_cousins_button_to_user Mod.

We must invert the 1st and 2nd person to obtain a satisfactory result.

I know : it was in jan 2020, a loooong year ago :-)

Michel

Share this post


Link to post
Share on other sites
mjaro

You are all right!

BTW in the shortest paths  Relate mod of Chriss Moss there is a (commented) message "Sometimes..."

The algorithm itself is asymmetric but mathematicians consider it correct.

One thing can increase the assymetry, and here can be a point to see possible correction: when a next path is found it is checked that the path is not a "trivial" variation of the previous paths, and if it is, the path is eliminated. Most of the "next paths" are filtered this way: maxR parameter decides how many paths are to be found, and only few of them pass the check and are displayed. The filter is my own invention and I haven't yet possibility to discuss if it is correct.

In the graph of all persons there are two kinds of connection between them: coitions (between spouses) and filiations (between each child and its parents).

1. If a (sub)path goes from a person to one parent, then 1-step longer path going from this person to the parent via second parent is filtered.

2. If a (sub)path goes between siblings via one of the parent, then another path going via the second parent is filtered.

3. If a (sub)path goes directly between spouses, then 1-step longer path going via their child is filtered. 

There is one more such filter. They are all the 4 implemented in the small function skipPath at the end of the Yen-BFS.php.

Michał

Share this post


Link to post
Share on other sites
Brett

On local host, both with WampServer and Laragon. I receive multiple lines of the same  error. The Mod script does return the correct results.

Warning: Invalid argument supplied for foreach() in C:\laragon\www\tng13\db2graph.php on line 79

PHP is 7.2.19 on Windows10

 

 

Share this post


Link to post
Share on other sites
mjaro
20 hours ago, Ken Roy said:

If you decide to rename the mod, let me know what your TNG username is and I will make sure you have rename (Move) authority on the TNG Wiki.

Ken, I've renamed the mod, mod directory, css, and tab title (but remaining php files haven't been renamed yet; I would be afraid to get completely lost...)

The new version works for me.

Ken, Roger, Ron, Michel,

There are many changes in the mod itself as well as in the program files. Thus, it could be good if somebody checks if my internal tests are enough before publishing. May I ask you? 

Michał

Connections_v13.0.2.2.zip

Share this post


Link to post
Share on other sites
mjaro

Brett, could you please uninstall the mod and then install the new version (renamed! to Connections) from the file I attached to the mail above?

Share this post


Link to post
Share on other sites
Ken Roy

Michal,

I would recommend that you change the folder name to connections_v13.0.2.2 instead of simply connections because I suspect that as you make changes or improvements to the mod, several of the changes will be in the modules you include from the mod subfolder

Share this post


Link to post
Share on other sites
manofmull
On 2/12/2021 at 10:29 PM, ton van lil said:

Thanks. It works now.

It was FGWTabs that prevented me from installing Search fpr Connections Mod.

Greetings

Ton

 

 

Ton or anyone

I uninstalled the FGW/Tabs mods too but I still cannot instal the Connections mod.

Cannot install  
tng_small_icon_sprites.gif should be replaced by hand in the main img folder
(if not - the defaulf sprite will be displayed

Author: Michal Jarocinski
Adds a new tab to the Person page, containing a form that allows for searching for multiple connections between selected persons - even if they are not related (i.e., every paths in the people graph are checked). The search is implemented in PHP as a variation of the Yen's K-Shortest Path algorithm augumented with the algorithm filtering the paths irrelevant from the genealogical point of view.

flags:
@  optional
^  (provisional) must be available
~  protected

line 32: %copyfile: nextpathsform.php  not copied

Source: mods/Connections/nextpathsform.php

line 33: %copyfile: nextpaths.php  not copied

Source: mods/Connections/nextpaths.php

line 34: %copyfile2: css/Connections.css  not copied

Source: mods/Connections/Connections.css

line 35: %copyfile: nextpaths2.php  not copied

Source: mods/Connections/nextpaths2.php

line 36: %copyfile: db2graph.php  not copied

Source: mods/Connections/db2graph.php

line 37: %copyfile: Yen-BFS.php  not copied

Source: mods/Connections/Yen-BFS.php

line 40: %target:@nextpathsform.php% file missing (optional) will ignore

line 54: %target:css/genstyle.css% verified

line 55: %location:% #1 not installed

line 64: %target:genlib.php% verified

line 65: %location:% #1 not installed
line 71: %location:% #2 Bad target

line 86: %target:meta.php% verified

line 87: %location:% #1 not installed

line 96: %target:@languages/Polish-UTF8/cust_text.php% verified

line 98: %location:% #1 not installed

line 104: %target:languages/English/cust_text.php% verified

line 105: %location:% #1 not installed

line 111: %target:@languages/English-UTF8/cust_text.php% verified

line 113: %location:% #1 not installed

line 119: %target:@languages/Norwegian-UTF8/cust_text.php% verified

line 121: %location:% #1 not installed

Share this post


Link to post
Share on other sites
tngrlkrz

Michal,

Preliminary testing with new version is good.  Thank you for giving option of removing textual description and removing inactive  'show spouses' option .  I do not use the FGW mod., but do have the FFT mod installed.

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×