Michel KIRSCH Posted March 13, 2021 Report Share Posted March 13, 2021 (edited) 1 hour ago, mjaro said: Is there another place where these topics are discussed in the context of TNG? Not to my knowledge... It is difficult to give advice because each programmer has his own habits. But giving tips... Why not? I would see this rather in wiki pages: Coding tips or something else Michel EDIT : old tip : Edited March 13, 2021 by Michel KIRSCH Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted March 14, 2021 Report Share Posted March 14, 2021 3 hours ago, mjaro said: Ken, do you mean that the default TNG login checking is not working or is not enough?!? At the beginning of connections.php and connection-form.php I include tng_begin.php Michal, As far as I know the checklogin.php only sets up the variables for what the user is allowed to do if logged in and the $nologin flag is used to bypass the login check for sites that require login but want to make certain pages available to all visitors. To restrict a function to logged in users, one must check the $currentuser variable. In my private mod, I added the following %target:genlib.php% %location:% #### Connections mod - inserting new tab #### $choices .= doMenuItem( $nexttab++, $connectionsform_url . "primaryID=$entityID&tree=$tree" , "next", $text['connections'], $currpage, "connections" ); # mja %end:% %insert:before% if ($currentuser) { // restrict to logged in users %end:% %location:% #### Connections mod - inserting new tab #### $choices .= doMenuItem( $nexttab++, $connectionsform_url . "primaryID=$entityID&tree=$tree" , "next", $text['connections'], $currpage, "connections" ); # mja %end:% %insert:after% } // restrict Connections to logged in users %end:% If no one else wants to restrict your Connections mod to logged in user, I have not problem including the above in my private mod that changes the colors and eliminates the background to the charts. The TNG Wiki has some articles in the How to Code and Programmer categories. While some of the article might be old, they might still apply. Quote Link to comment Share on other sites More sharing options...
theKiwi Posted March 14, 2021 Author Report Share Posted March 14, 2021 I've installed version 13.0.0.5 on my main site, and there is something not working with the rights calculations... When I'm signed into my site as Admin, I see this but since I'm the site's only Admin, I expect to see my Dad's name and my name in those last two "Living" boxes? Roger Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted March 14, 2021 Report Share Posted March 14, 2021 Roger, That is exactly the issue that Ron and I both reported. I have not had a chance to look at the code, but suspect that it is not using the TNG functions to determine what a user is allowed to do or view. If you reverse the connection search to look for yourself as the starting point you will see your default photo but the word Living instead of your name. Quote Link to comment Share on other sites More sharing options...
mjaro Posted March 14, 2021 Report Share Posted March 14, 2021 10 hours ago, Ken Roy said: In my private mod, I added the following OK, let me tell in my words: The site is public. The goal to not display the tab (even if you allow non-logged to see other tabs and getperson itself). Without this restriction bots can call connections-form (and maybe could even reach connections.php setting a person2 and doing server consuming calculations). Is this the scenario you want to be protected? If so, it make sense to include your changes as the standard behavior of the mod. Alternative could be to not to hide the tab but rather protect connection.php against non-logged. Thus the visible tab could attract users(?). Any of the two (or both?) I can introduce to the code to not require additional mod. Michał NB. Of course, I have read many (most) articles and guides from Wiki, but I may not understand all of them well. My intention was to use default TNG functions for access control, also when reading person's data. In v5, I rewrote the code to follow the TNG standard more precisely. Unfortunately, I introduced even more errors I should correct... Quote Link to comment Share on other sites More sharing options...
mjaro Posted March 14, 2021 Report Share Posted March 14, 2021 17 hours ago, Michel KIRSCH said: EDIT : old tip I have studied multiple of your tips (or script samples, or just mods) and used to use them (without mentioning the copyright ) Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted March 14, 2021 Report Share Posted March 14, 2021 1 hour ago, mjaro said: OK, let me tell in my words: The site is public. The goal to not display the tab (even if you allow non-logged to see other tabs and getperson itself). Without this restriction bots can call connections-form (and maybe could even reach connections.php setting a person2 and doing server consuming calculations). Is this the scenario you want to be protected? Michal, That is exactly the scenario, but then not everyone might have a family where they have 9 different connection paths between themselves and their spouse One of the reasons I cannot use the Relationship to Site Owner Mod nor the Relationship Display Mod. My site has been open with only living and private being restricted for the last 15 years I have used TNG. I am not likely to attract any new user although I have found a lot of my default photos in other peoples trees on Ancestry. As I indicated, you can just leave your code as is, unless other users request that you add that as an Edit Option. The only reason for locking that down is that I am continually exceeding my hosting service's MySQL execution time but am not receiving any emails from them on that issue. Quote Link to comment Share on other sites More sharing options...
mahesh Posted March 14, 2021 Report Share Posted March 14, 2021 20 minutes ago, Ken Roy said: That is exactly the scenario, but then not everyone might have a family where they have 9 different connection paths between themselves and their spouse Only 5 for me. I am not really funderstanding all the inputs in this thread here, but I am extremely happy with the privacy rules set in 13.03.4a which, I think, respects TNG privacy settings. Just to say that I am really enjoying following this thread. Thank you. Quote Link to comment Share on other sites More sharing options...
tngrlkrz Posted March 15, 2021 Report Share Posted March 15, 2021 19 hours ago, mjaro said: Alternative could be to not to hide the tab but rather protect connection.php against non-logged. Thus the visible tab could attract users(?). Michal, That is the approach I take; display the tab to attract users with a feature that doesn't work unless the user registers. For my site, using the Restrict_Access_mod which, with small code added in a php script disables it to visitors. For example, in connections-form.php, at top of file: include($cms['tngpath'] . "checklogin.php"); include($cms['tngpath'] . "$mylanguage/text.php"); if( ! $currentuser ) { $showguest=0; include("extensions/noaccess.php"); exit; } Then the 'connections' tab will appear in the menu, but clicking it tells the visitor the tab is available only if they register. Quote Link to comment Share on other sites More sharing options...
theKiwi Posted March 15, 2021 Author Report Share Posted March 15, 2021 On 3/14/2021 at 12:11 PM, mjaro said: If so, it make sense to include your changes as the standard behavior of the mod. Alternative could be to not to hide the tab but rather protect connection.php against non-logged. Thus the visible tab could attract users(?). Any of the two (or both?) I can introduce to the code to not require additional mod. If this is implemented, it needs to be an option - I'm happy with people finding it and playing with it. I have user registrations (apart from my Admin account) on any of my TNG sites, and so telling someone they have to log in, or create an account to log in is not helpful to me. Roger Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted March 15, 2021 Report Share Posted March 15, 2021 Michal, I agree with Roger that implementing my private mod or Ron's private mod to your Connections mod would need to be an option. However it might be better to leave your current mod as is and then publish my private mod in your wiki mod article, for those who want to restrict access. Note that I only require login for cousins who want to see their living relatives, so new requests have to provide a parent or grand-parent connection to a person already in my database. We all have different situations and not everyone will have families that migrated together like my French-Canadian and Acadian family where spouse might be distant cousins from the late 1600 - early 1700. Quote Link to comment Share on other sites More sharing options...
tngrlkrz Posted March 15, 2021 Report Share Posted March 15, 2021 I think that any restriction to the connection mod be left externally with either a public or a private mod. That's more or less what I was suggesting by referring to the Restrict Access mod. However, there are several mods with have Edit Option restrictions to 'admin' only, but this case is a bit broader to disallow only visitors. Ken you mention 'publish your private mod' in the wiki mod article, which seems contradictory. Which mod are you referring to, something posted earlier? Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted March 15, 2021 Report Share Posted March 15, 2021 1 hour ago, tngrlkrz said: Which mod are you referring to, something posted earlier? Ron, My private mod that I posted in this thread Quote Link to comment Share on other sites More sharing options...
tngrlkrz Posted March 15, 2021 Report Share Posted March 15, 2021 Thanks Ken, My personal preference is showing the connections tab, but disabling it and encouraging the visitor to register with a message. Your change eliminates the tab. Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted March 15, 2021 Report Share Posted March 15, 2021 Ron, As I said we all have different needs. My site is wide open and not restricted to requiring a login to get to certain pages. The only restriction I impose is requiring a login to View Living and View Private (deceased within the last 10 years) I am sure if I had time, I could create a different mod. I am still working of fixing mods from TNG 13 which was beta tested last summer. Never mind still fighting the problem with MediaWiki language templates, so I took the quick way out to stop the bots from chewing up my MySQL time before my hosting service kicks me out. User 80 MySQL execution minutes out of 30 allowed yesterday. So we all have different needs. what works for you may not work for me since I do not use any of the mods that restrict access Quote Link to comment Share on other sites More sharing options...
tngrlkrz Posted March 16, 2021 Report Share Posted March 16, 2021 1 hour ago, Ken Roy said: So we all have different needs. Of course, Ken, that's what I implied when I said 'personal preference'. But you were suggesting a wiki reference to your approach, so perhaps reference to other approaches becomes valid as well then...😉..my last word. Quote Link to comment Share on other sites More sharing options...
klooster Posted March 17, 2021 Report Share Posted March 17, 2021 Is version 13.0.3.4a that is listed on the Wiki mod page, the definite version of the Search Connections mod ? Quote Link to comment Share on other sites More sharing options...
mjaro Posted March 17, 2021 Report Share Posted March 17, 2021 51 minutes ago, klooster said: Is version 13.0.3.4a that is listed on the Wiki mod page, the definite version of the Search Connections mod ? For sure not! (I had to take a break from programming But v5 is on its way) Quote Link to comment Share on other sites More sharing options...
klooster Posted March 17, 2021 Report Share Posted March 17, 2021 Happy to test it out. Quote Link to comment Share on other sites More sharing options...
mjaro Posted March 19, 2021 Report Share Posted March 19, 2021 Hi all, I was finally able to get back to programming 😁 and prepared another version of the mod. The version is named 4d as v5 was turned out to be shared prematurely... Maybe the shy number will be more successful 😏 Michał Connections_v13.0.3.4d.zip Quote Link to comment Share on other sites More sharing options...
klooster Posted March 20, 2021 Report Share Posted March 20, 2021 I installed Connections V13.0.3.4d and it works just fine! Quote Link to comment Share on other sites More sharing options...
mjaro Posted March 20, 2021 Report Share Posted March 20, 2021 Looks great 👍 Thank you for testing! Michał Quote Link to comment Share on other sites More sharing options...
tngrlkrz Posted March 20, 2021 Report Share Posted March 20, 2021 Michal, No bugs seen in my testing so far. Looks very good, especially registered user vs. visitor and user rights. Box sizing management much improved, like the variable width boxes with fixed height. Of course, also like the compact version too. On my custom site, some private changes: diagrams/containers are invisible on non compacted boxes, displaying birth/death year instead of tooltip, since space available. living color for living individuals (none in examples) chose a 'red' arrow pointing right for start person, since paths are shown left to right. Quote Link to comment Share on other sites More sharing options...
mjaro Posted March 20, 2021 Report Share Posted March 20, 2021 24 minutes ago, tngrlkrz said: No bugs seen in my testing so far. Good news 😁 24 minutes ago, tngrlkrz said: on non compacted boxes, displaying birth/death year instead of tooltip, since space available. Right change - I like it and will include into code 👌 (I only wonder whether to remove or leave tooltip even if it becomes mostly redundant...) How do you change living color? Do you insert an inline style? Thanks for testing! Michał Quote Link to comment Share on other sites More sharing options...
tngrlkrz Posted March 20, 2021 Report Share Posted March 20, 2021 On 3/20/2021 at 12:50 PM, mjaro said: How do you change living color? Do you insert an inline style? It's derived from or based on the Living_Color_Mod. It's a one line code to set a 'living color' flag (lc_flag), which is then checked within in TNG functions for getting the names. Here is an example (name header colored as well) in non compact mode, and compact mode: On 3/20/2021 at 12:50 PM, mjaro said: I only wonder whether to remove or leave tooltip even if it becomes mostly redundant. Either way is OK I think, but I disabled the tooltip except for the compact chart. One last thing, a 'luxury item'. What if instead of having the entire box a person profile link, there was added a 'showmedia' link to the thumbnail, similar to a few other pedigree and descendant charts with thumbs. But again...just an unnecessary 'bonus'. That said, the mod is very good to leave as is as well. 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.