Jump to content
TNG Community
theKiwi

Search for Connections Mod

Recommended Posts

fluffy82
49 minutes ago, tngrlkrz said:

Michal,

I don't believe those icons/symbols are from TNG.  The ones from TNG look like the ones you're using.  I think those icons (and those in Rogers earlier snapshot) are from WordPress. 

 

Yes, going through the "inspect page" function, the images seem to be .svg files loaded from a WordPress page. The big question is why it does that... 🤔

 

WP.PNG

Share this post


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

The only thing i don't undertand is why the diagram isn't as Clipboard01.jpgcompact as in my clean installation:

 

Are you referring to the height of the boxes?

Here is my site with just TNG - no WordPress

http://lisaandroger.com/tng/connections.php?altprimarypersonID=&savedpersonID=I1&secondpersonID=&maxR=99&showTxt=true&showPic=true&sortpathsby=length&maxL=33&primarypersonID=I16&tree=Roger&s=

The boxes are still "too high". They are being made 40px high, but I can't see where that is coming from.

Roger

Share this post


Link to post
Share on other sites
mjaro
Just now, fluffy82 said:

the images seem to be .svg files loaded from a WordPress

Sometimes I use Wordpress but I don't like it. Since he is so brazen that he dare to replace the html code produced by my PHP, I will even hate it. He becomes like a google or facebook which know even better than you yourself what you really want. :(

Anyway, since many use it, I'll solve that simple problem and share the solution.

Share this post


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

Are you referring to the height of the boxes?

Here is my site with just TNG - no WordPress

http://lisaandroger.com/tng/connections.php?altprimarypersonID=&savedpersonID=I1&secondpersonID=&maxR=99&showTxt=true&showPic=true&sortpathsby=length&maxL=33&primarypersonID=I16&tree=Roger&s=

The boxes are still "too high". They are being made 40px high, but I can't see where that is coming from.

Roger

When you select "Thumbs: no" they look as low as in my screen.

Share this post


Link to post
Share on other sites
theKiwi

The height of the box for William Moffat is inspected here - it's showing as 40px tall - no idea where that is coming from - it's the same for me in Safari and Chrome on Mac OS X 10.14.6

image.png

Roger

Share this post


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

When you select "Thumbs: no" they look as low as in my screen.

Yes, that is true - I hadn't realised that the thumbs were causing this - now a new problem for me then is that on the WordPress page the thumbs aren't showing even when it's set to Yes, but the box still gets the height of 40px

image.png

 

http://lisaandroger.com/genealogy/connections.php?maxR=99&showPic=true&showTxt=true&sortpathsby=length&maxL=33&primarypersonID=I16&savedpersonID=I1&tree=Roger

Roger

Share this post


Link to post
Share on other sites
fluffy82
47 minutes ago, mjaro said:

Sometimes I use Wordpress but I don't like it. Since he is so brazen that he dare to replace the html code produced by my PHP, I will even hate it. He becomes like a google or facebook which know even better than you yourself what you really want. :(

Anyway, since many use it, I'll solve that simple problem and share the solution.

Besides connections.php, is there any other place where you define the text to be displayed?

I changed it into:

function gendIcon($gender){
    if($gender=='M') return "<i class="fab fa-mars"></i>";
    if($gender=='F') return "<i class="fab fa-venus"></i>";
    return "";
}

but my webpage keeps on using your original <span style='color:blue'>&#9794;</span>... I emptied my cookies and temp folder, uninstalled, removed, redownloaded and reinstalled the mod, used 3 different browsers on two different computer, and even made the change into FontAwesome before uploading and installing the mod, but nothing helps. The original code is always used, and any changes ignored. I even tried different icons and just text, but no difference either.

Share this post


Link to post
Share on other sites
mjaro
15 minutes ago, fluffy82 said:

is there any other place where you define the text to be displayed?

The text is almost always taken from the language custtxt, apart from this particular place where it is hardcoded.

May I ask you to check if it is possible to "deceive" Wodrpress putting the gender character coded as 3-byte sequence? Please set in my original gendicon function the text   \xe2\x99\x82  as the male symbol and  \xe2\x99\x80 as the female symbol ?

P.S. forgive my teaching on reinstalling mods 😡

Share this post


Link to post
Share on other sites
mjaro
1 hour ago, theKiwi said:

Yes, that is true - I hadn't realised that the thumbs were causing this - now a new problem for me then is that on the WordPress page the thumbs aren't showing even when it's set to Yes, but the box still gets the height of 40px

image.png

 

http://lisaandroger.com/genealogy/connections.php?maxR=99&amp;showPic=true&amp;showTxt=true&amp;sortpathsby=length&amp;maxL=33&amp;primarypersonID=I16&amp;savedpersonID=I1&amp;tree=Roger

Roger

Roger, you are too fast for me.

When inspected your page I could see different states... the one similar to the screen above was because it was  <img src=""> --i.e. empty image, but still image, so it took the space as it is not empty.

Michał

Share this post


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

When inspected your page I could see different states... the one similar to the screen above was because it was  <img src=""> --i.e. empty image, but still image, so it took the space as it is not empty.

Yes, I've spent the last hour or more trying to figure out what is causing this - the images show on my WordPress testing site that was running a much newer version of WordPress, and I've now updated it to the current and it still works.

http://tngwp.lisaandroger.com/genealogy/connections.php?maxR=99&amp;showPic=true&amp;showTxt=true&amp;sortpathsby=length&amp;maxL=33&amp;primarypersonID=I16&amp;savedpersonID=I1&amp;tree=Roger

On my "main" site, the images wouldn't show and that was because $photoPath was evaluating to empty - the only difference being the WordPress version.

I'm now checking a few things out before taking the plunge and updating my main WordPress site to the current WordPress - hoping it doesn't break it all!

http://lisaandroger.com/genealogy/connections.php?maxR=99&showPic=true&showTxt=true&sortpathsby=length&maxL=33&primarypersonID=I16&savedpersonID=I1&tree=Roger

If you click that link and see images, then it's working.

Roger

Share this post


Link to post
Share on other sites
tngrlkrz
On 2/22/2021 at 12:33 PM, theKiwi said:

click that link and see images, then it's working.

Slow to load, images on the first link, but not on the second.

Share this post


Link to post
Share on other sites
fluffy82
22 minutes ago, mjaro said:

May I ask you to check if it is possible to "deceive" Wodrpress putting the gender character coded as 3-byte sequence? Please set in my original gendicon function the text   \xe2\x99\x82  as the male symbol and  \xe2\x99\x80 as the female symbol ?

No, that doesn't work either...

There is a way to disable the automatic .svg replacement from within WordPress, but that will also break all other emojis etc on the whole website...

Share this post


Link to post
Share on other sites
fluffy82
3 minutes ago, fluffy82 said:

There is a way to disable the automatic .svg replacement from within WordPress, but that will also break all other emojis etc on the whole website...

I did this, and it works. So the culprit is the WordPress function which automatically changes ":" + ")" into :)

I don't use emojis on my site, so I will leave that function disabled.

Share this post


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

Yes, I've spent the last hour or more trying to figure out what is causing this - the images show on my WordPress testing site that was running a much newer version of WordPress, and I've now updated it to the current and it still works.

http://tngwp.lisaandroger.com/genealogy/connections.php?maxR=99&amp;showPic=true&amp;showTxt=true&amp;sortpathsby=length&amp;maxL=33&amp;primarypersonID=I16&amp;savedpersonID=I1&amp;tree=Roger

On my "main" site, the images wouldn't show and that was because $photoPath was evaluating to empty - the only difference being the WordPress version.

I'm now checking a few things out before taking the plunge and updating my main WordPress site to the current WordPress - hoping it doesn't break it all!

http://lisaandroger.com/genealogy/connections.php?maxR=99&showPic=true&showTxt=true&sortpathsby=length&maxL=33&primarypersonID=I16&savedpersonID=I1&tree=Roger

If you click that link and see images, then it's working.

 

Well I'm absolutely stumped on this for now - I updated both sites to WordPress 5.6.2 (one was on 5.4.3 and the other on 4.9.16), and still on the WordPress site for lisaandroger.com I get no images, while on the testing site at tngwp.lisaandroger.com I do.

Both sites show the images when using only TNG

Both sites are on the same server so PHP etc are all the same.

I'll dig through the config files and see if I can spot a difference.

Roger

Share this post


Link to post
Share on other sites
mjaro
1 hour ago, fluffy82 said:

I did this, and it works. So the culprit is the WordPress function which automatically changes ":" + ")" into :)

I don't use emojis on my site, so I will leave that function disabled.

That's good news. I there is such a temporary fix please use it. I'll have more time to code a definite solution which was already mentioned earlier: to use TNG gifs together with the style for placing them inline with text.

Share this post


Link to post
Share on other sites
mjaro
2 hours ago, mjaro said:

to code a definite solution

OK, it seems to work perfect. I shouldn't have resisted the TNG standard function...

The changes are rather simple:

1. replacements in connections.php: 2x gendIcon calls into getGenderIcon, and 2x inserting class='thumb' 

2. in genstyle.css replace (near the end of file) 

#pathlist img {

into

#pathlist img { display:inline-block; }
#pathlist img.thumb {

For 1. I attach corrected connections.php

For 2. you have to edit the file :(  

Tom, Roger - could you please check these changes under Wordpress? 

Michał

connections.php

Share this post


Link to post
Share on other sites
fluffy82
25 minutes ago, mjaro said:

Tom, Roger - could you please check this under Wordpress?

Never mind my previous (now erased) comment, that was my fault. It seems to work now 😄

 

Share this post


Link to post
Share on other sites
mjaro
4 minutes ago, fluffy82 said:

remove the inline-block as you can't have both).

Thank you for testing and improving.

But... In the atached connections.php the small photos receive class='thumb', and the remaining images the selector is just img (gender icons are of this "plain" img class)

My suggested changes should have resulted in:

#pathlist img { display:inline-block; }
#pathlist img.thumb {
    float: left;
    height: 40px;
    max-width: 70px;
    border-radius: 4px;
}

Have you replaced connections.php with the one corrected?

Share this post


Link to post
Share on other sites
tngrlkrz

In an early post this morning, I noted that the gender symbol was dropping to the next line for the primary person. Admittedly, this was a larger thumb and a long name.  I found that removing the bolding of that person and gender was on the same line.  I thought maybe it was because of the max-width of 250, so increased that to 270, but still the issue remained for the middle of three paths for the same person.  The other two, increasing that parameter helped even with bolding employed. Is the max-width respected in all cases?

Hope this makes sense. In the snapshot below code is set to bold all names, but then still the middle diagram drops the gender and centers on the next line, but is fine in the other two.  Any idea why  only one path/container boxes have this issue when bolded?

image.png

Share this post


Link to post
Share on other sites
mjaro
On 2/20/2021 at 6:22 PM, mahesh said:

Love this mod. I have been using Cousins mod but found that it did not find half-cousins.

I have very minor issue which may be due to my WAMP set up.

Last three display lines are getting jumbled.

coneections-eror.jpg

 

I changed the margin-top in line 385: from  -.9em to .9em to clear the display.

coneections-corrected.jpg


echo "<p style='margin-top:0.9em;'>$newstr</p>\n"; # (the longest path checked was $longestSoFar)

This seems to work.

mahesh, I've changed the summary message style in a different way: I've set line-height and not margin-top (it seems to be more typical) And the message is now supressed to 2 lines.

Could you please check if it works for you? (I attach the file to be replaced)

Please also take a look if the thumb pictures and gender icons show properly.

Thanks, Michał

connections.php

Share this post


Link to post
Share on other sites
mahesh

Mical, I am getting Bad showPic parameter  error.

Share this post


Link to post
Share on other sites
mjaro
9 minutes ago, tngrlkrz said:

Any idea why

Ron, in the diagram the boxes look like graphics, but in fact they are simple table cells, and thus the browser is trying to "optimize" their width/height within the max/min defined. Browser wants to have them in general as narrow as possible, but the real agorithm isn't simple. If the boxes are high enough to contain two lines (which is the case when thumbs are in) browser moves part of text to the second line (which is then available to use) and make the box narrower.

In the previous gender solution it was possible to "glue" them to the preceding word - they both together could have sometimes go to the second line. I'll think if it is now possible...

Anyway,  playing with the min/max values is here really tricky as they have to cover multiple different cases...

Thank you fo experiments, finally we'll find the best solutions!

Michał

Share this post


Link to post
Share on other sites
mjaro
4 minutes ago, mahesh said:

Mical, I am getting Bad showPic parameter  error.

Sorry, I should have written that the file I attached fits only to the newest 13.0.3.4 mod version.

Maybe in future you have it updated, and then please make the checking... My problem is that I don't use Wordpress :( 

Michał

Share this post


Link to post
Share on other sites
tngrlkrz
32 minutes ago, mjaro said:

Anyway,  playing with the min/max values is here really tricky as they have to cover multiple different cases...

Sort of understand what you've said, but still, curious, in the example I displayed in the last post, why the second path was the only one with nearly all of gender symbols not fitting, whereas the other two, all fit.  Don't expect an answer, just an observation of results.  Thanks again for all the improvements.

Share this post


Link to post
Share on other sites
theKiwi
5 hours ago, mjaro said:

Tom, Roger - could you please check these changes under Wordpress?

Here's what I see now in WordPress

WordPress.png

 

This is what I see in TNG (with no WordPress involvement)

 

TNG.png

So the same layout now in either environment, but the text has been pushed to the bottom of the image.

I would add that I'd be happy to lose the icons in the text row where it already names the person's gender.

(This is not a solution to why the images don't show in my other WordPress site - this is the site where the images always worked.

Roger

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...

×