Jump to content
TNG Community
mkoche

Should I share these Mods?

Recommended Posts

mkoche    0
mkoche

Not sure if these are of interest to anyone.  I am not a coding expert but I have designed a few mods that I like.  What is the appropriate way to share them???

My Mods

Search My Line

I use the bold ancestor child links mod and really like it because it shows me quickly where I am when I am working on my family.  [The mod requires the creation of a branch for direct line ancestors].  Building off of this, I wanted to be able to search only direct ancestors when I needed to.  This is super handy for seeing whole portions of a family.  I created a little mod that adds in a check box in the search form to narrow the search to direct ancestors [already identified by branch]. 

Search No Parents

This is another check box that limits search results to people with no parents.  Combined with the first mod, I am able to see only my Treetops ancestors with little effort - and work on lines at the very end. 

Example: Look at the two fields under the "Show Death/Burial Information" line.

My Capital Search

This Mod adds two criteria to the search form for the firstname and lastname fields.  One is ALL CAPS.  I use all CAPS in the first or last name fields to identify "troubled spots" in my family research and to alert anyone looking at my data that it should be viewed with suspicion.  The trouble is I need to be able to find these trouble spots when I am researching.  The ALL CAPS search returns only names that are in All capitals helping me to navigate easily.  While I was at it, I added one that is probably of little utility to anybody else -- does not contain.  I want to be able to exclude some records that contain the word "family" or 'generations" from searches and this allows me to easily do that.

Example: Look at the last two pull down fields on the first and last name menus

My Perhaps Mod

Guessed dates and uncertain links (parent to child or spouse to spouse), which many of us identify with the words "about," "before," or "after" in the first case, and which, I at least, identify with capitalized names in the second case are like codes that say "hey, this is a guess or maybe a little better than guess."  But there is no reason why everyone who visits our websites should know that.  So.... I created this mod to add the word "perhaps" next to the title fields on the getperson page.  I know that this follows my own system but I think it would be easy to modify for other approaches.

Example:  Look down at the "Name" and "Born" fields.

Given my status as a super novice, there is surely much to be improved in these.  And I made them to serve my needs.  However, I would be happy to share them, just need some advice on how.  Each follows the mod format, identifying TNG 11.0.2 as the latest version they work with (because I do not know how to determine if they will work with earlier versions.

Advice?

Cheers,

Scott

 

* * *

UPDATE 26 May 2017

The Search my Line Only mod and the Search no Parents have been combined in a single package and shared as Direct Line Search mod.  I think I found most of the problems - one can only hope.  The Capital Search and My Perhaps Mod don't seem to resonate with folks -- different approaches!

The wiki page for the Direct Line Search Mod is http://tng.lythgoes.net/wiki/index.php/Direct_Line_Search

 

 

 

 

 

Share this post


Link to post
Share on other sites
tngrlkrz    0
tngrlkrz

Though I've use both  private and published Mods which impact the Search, I would be interested in adapting your incorporation of the bold ancestor  tick box to my Search as you have done.  I too find the bold ancestor child links Mod extremely helpful.   Would you be willing to share the code as is for private use?

Share this post


Link to post
Share on other sites
Chris Lloyd    0
Chris Lloyd

Very interesting - if you do wish to share I would suggest that you put them on the mods section of the wiki.

I would certainly be interested in using some of them.

Share this post


Link to post
Share on other sites
mkoche    0
mkoche

Hiya Chris - that is why I asked!  I could find nowhere to share them and wasn't sure if I should. I did share them with tngrlkrz

and he has had a bear of a time.  Apparently while search.php has branch search functions built in -- and it is working fine for me -- something is affecting it for him and maybe for everyone.  I would be happy to share them with you if you are interested in testing them out.  They are pretty simple really.

Share this post


Link to post
Share on other sites
Chris Lloyd    0
Chris Lloyd

Hey Scott I'd be happy to test them - sounds as though there may be a conflict somewhere with 1 or more other mods.I guess to could send them to me - I have sent you a PM.

Cheers

Chris

 

Share this post


Link to post
Share on other sites
tngrlkrz    0
tngrlkrz

As Scott noted, for some reason yet identified, the $tree variable (see my separate post) just won't seem to find my branch created for the bold ancestor children links Mod. Neither through the Mod, or directly in a search.php URL variable.  I am anxious to see if another user is able to duplicate Scott's success.  I tried it on a (apparently) clean TNG 11.1 test system to no avail.  So, Chris, if you have branches, let me know how it works out for you (and what version of TNG you test on).

I'm left thinking there is some admin setup anomaly or difference between his and my system (actually systems - tried this on Live, Test, and Wamp enviroments).

Update: It was the $tree variable that was blank in search.php which caused the issue.

Ron

Share this post


Link to post
Share on other sites
Ken Roy    0
Ken Roy

You could also attached the mods here for beta test on other sites, but like Chris indicated if you are going to share mods, they should be added to the TNG WIki Mods section for the specific TNG release, currently  Mods for TNG v11

Share this post


Link to post
Share on other sites
mkoche    0
mkoche

Whew -

Chris - sent them to you by email. 

Ken - I am missing something about the Mod wiki, I could not find anywhere to submit or load them.  At any rate if they will not work for others, then there is no reason to put them up!  I am no coder, just a problem solver and I was delighted when I finally had a way to isolate my direct ancestors and tree tops and expand the search functionality to work with the way my data is organized.  It would be cool if all the time i have invested in figuring it all out was useful to someone else.  I have tried to follow the right protocol to share them.  How the heck does one know what the first version is something will work with?  So I am happy to submit them to tng 11 mods but I might need more direction than that (I have an account on the wiki but perhaps it has no sharing privileges?)

Ron - We will see if Chris has the same issue with the branch search not working.  If so there must be some way in which I have enabled something that allows it to work with no hitch on my site.  Aren't I the lucky one.

Cheers

Share this post


Link to post
Share on other sites
Ken Roy    0
Ken Roy

Your account on the TNG Wiki should allow you to create new wiki pages as well as Upload files to the wiki. 

the line on the TNG Wiki Main Page reads as follows and includes a link to the New TNG Wiki Users article

New TNG Wiki users should read the New TNG Wiki Users article to learn how the TNG Wiki is organized using categories and how to create / update wiki articles

This information should also have been included in the email sent when you received your TNG Wiki Username / password and should also be linked in your User: profile talk page.

Share this post


Link to post
Share on other sites
tngrlkrz    0
tngrlkrz

OK, Scott, that sound great.  I forgot to mention (to the others) that SQL queries of my single TNG branch works fine, while the URL search does not.  IMO, I think posting your mods here for others to test is a good strategy before attempting to create a Mod wiki page.  Posting that first Mod is a bit daunting, considering the version protocol that needs be followed, though it can be posted in 'Beta' state.

Share this post


Link to post
Share on other sites
mkoche    0
mkoche

Terrific!  The information was probably included - user error.  Appreciated.

Share this post


Link to post
Share on other sites
mkoche    0
mkoche

Ron - that's what I will do. Just want to see if Chris has any luck first.

Share this post


Link to post
Share on other sites
tngrlkrz    0
tngrlkrz

I found my branch search with Scott's Mod runs correctly if I set $tree to my tree ID early in search.php (a temporary fix).  Don't know if this is because I only have one tree, but the variable does not seem to get set in search.php before the tng query.  Also if the variable $tree= is set directly in a search URL, it works correctly also.

(See Ken's followup on the variable later.)

I also had an Mod Mgr conflict with Scott's Search No Parents Mod and the Broad Search Mod.  Both are attempting to modify the same line. I tried a fix on that, and with the $tree loaded, the search with that Mod seems to work properly.

In search.php

%location:%
$_SESSION['tng_search_tree'] = $tree;
%end:%

%insert:after%
$tree = "kmtrees";
%end:%

In search_no_parents.cfg:

before:

%location:%
$pagenav = get_browseitems_nav( $totrows, "$search_url" . "$urlstring&mybool=$mybool&nr=$maxsearchresults&showspouse=$showspouse&showdeath=$showdeath&
%end:%
%triminsert:after%       
branch=$branch&noparents=$noparents&
%end:%

After:

%location:%
mybool=$mybool
%end:%

%triminsert:after%       
&branch=$branch&noparents=$noparents&
%end:%

In my testing so far, both Broad Search and Search No Parents work OK.

Ron

Share this post


Link to post
Share on other sites
Ken Roy    0
Ken Roy
50 minutes ago, tngrlkrz said:

Will do more testing, but this may be an easy item  for Darrin to fix, if my assumption is correct.

I also had an Mod Mgr conflict with Scott's Search No Parents Mod and the Broad Search Mod.  Both are attempting to modify the same line. I tried a fix on that, and with the $tree loaded, the search with that Mod seems to work properly.

Well since a Branch assignment is restricted to a specific tree, I would expect the mod to set both the tree and branch parameter.

TNG supports seaching across multiple trees, so I would not consider this a TNG problem that Darrin needs to fix.

Share this post


Link to post
Share on other sites
tngrlkrz    0
tngrlkrz
12 minutes ago, Ken Roy said:

Well since a Branch assignment is restricted to a specific tree, I would expect the mod to set both the tree and branch parameter.

TNG supports seaching across multiple trees, so I would not consider this a TNG problem that Darrin needs to fix.

Ken, thanks for clarifying and helping me understand these variables.  So then Scott's Mod  should set the $tree (and $branch) parameter and the variable will be OK in search.php?  I wonder why the Mod worked on his system then?

However, Scott's Search No Parents mod only modifies search.php, adding the $noparents variable among other things.  I don't see how he would set the $tree any differently.

Share this post


Link to post
Share on other sites
Ken Roy    0
Ken Roy

Scott should probably set the tree parameter for the search from the branch record.  Of course, I am just guessing since I have not seen the mod.

Share this post


Link to post
Share on other sites
mkoche    0
mkoche

Many thanks for all of this!  I will address the tree issue and then post the files on this thread in case anyone else wants to try them out. 

Cheers,

Scott

Share this post


Link to post
Share on other sites
Chris Lloyd    0
Chris Lloyd
On 12/05/2017 at 0:35 PM, mkoche said:

Ron - that's what I will do. Just want to see if Chris has any luck first.

I intend to have a go at it over the w/e time permitting.

Share this post


Link to post
Share on other sites
mkoche    0
mkoche

Given Ken's and Ron's comments, it seemed to me that I had created a branch searching that was very tied to the way my system is currently set up and that was inflexibly tied to the "Ancestors" condition of the branch highlighting mod.  So I tweaked it to be a full branch search addition.  Instead of a checkbox, the mod now adds a drop down menu at the top of the Search Form for branch.  Thinking of all the conditions that could pertain (more than one tree, privacy set to not show content, many branches), I am not sure that I sussed the search for every contingency.  It works for me both when I have one tree or many. I don't know how it will work under conditions where privacy is set.

Here it is, if someone would like to test it out.  It still works neatly with the no parents mod to show Ancestors at the treetops (and be able to search within them).

 

 

branch_search.cfg

Share this post


Link to post
Share on other sites
jayat1familytree    0
jayat1familytree

Scott,

 

I am getting an error why I try to test your "branch Search"

Request-URI Too Long

The requested URL's length exceeds the capacity limit for this server.

 

And the URL is like

 

http://1familytree.com/genealogy/search.php?branch=JayW&lnqualify=contains&mylastname=&fnqualify=contains&myfirstname=&idqualify=equals&mypersonid=&gequalify=equals&mygender=&bpqualify=contains&mybirthplace=Wisconsin&byqualify=&mybirthyear=&cpqualify=contains&myaltbirthplace=&cyqualify=&myaltbirthyear=&dpqualify=contains&mydeathplace=&dyqualify=&mydeathyear=&brpqualify=contains&myburialplace=&bryqualify=&myburialyear=&spqualify=contains&mysplname=&offset=0&nnqualify=contains&mynickname=&tqualify=contains&mytitle=&pfqualify=contains&myprefix=&sfqualify=contains&mysuffix=&cfq11=contains&cef11=&cpq11=contains&cep11=&cyq11=&cey11=&cfq12=contains&cef12=&cpq12=contains&cep12=&cyq12=&cey12=&cfq13=contains&cef13=&cpq13=contains&cep13=&cyq13=&cey13=&cfq14=contains&cef14=&cpq14=contains&cep14=&cyq14=&cey14=&cfq15=contains&cef15=&cpq15=contains&cep15=&cyq15=&cey15=&cfq16=contains&cef16=&cpq16=contains&cep16=&cyq16=&cey16=&cfq17=contains&cef17=&cpq17=contains&cep17=&cyq17=&cey17=&cfq18=contains&cef18=&cpq18=contains&cep18=&cyq18=&cey18=&cfq19=contains&cef19=&cpq19=contains&cep19=&cyq19=&cey19=&cfq20=contains&cef20=&cpq20=contains&cep20=&cyq20=&cey20=&cfq21=contains&cef21=&cpq21=contains&cep21=&cyq21=&cey21=&cfq22=contains&cef22=&cpq22=contains&cep22=&cyq22=&cey22=&cfq23=contains&cef23=&cpq23=contains&cep23=&cyq23=&cey23=&cfq24=contains&cef24=&cpq24=contains&cep24=&cyq24=&cey24=&cfq25=contains&cef25=&cpq25=contains&cep25=&cyq25=&cey25=&cfq26=contains&cef26=&cpq26=contains&cep26=&cyq26=&cey26=&cfq27=contains&cef27=&cpq27=contains&cep27=&cyq27=&cey27=&cfq28=contains&cef28=&cpq28=contains&cep28=&cyq28=&cey28=&cfq29=contains&cef29=&cpq29=contains&cep29=&cyq29=&cey29=&cfq30=contains&cef30=&cpq30=contains&cep30=&cyq30=&cey30=&cfq31=contains&cef31=&cpq31=contai

..........  on until it has 8,307 charaters when completed.

Tried on both my live sytsem and my WAMP localhost test system with same problem.

Jay

 

 

Share this post


Link to post
Share on other sites
Ken Roy    0
Ken Roy

I would have expected that if I selected a branch / tree and entered a search for First Name and Last Name that only entries for those name that matched would be further filtered by the branch assigned but that does not appear to be the case, since it returns a list of names that is identical to a search done for First Name and Last Name only on a site where the mod is not installed.

Share this post


Link to post
Share on other sites
tngrlkrz    0
tngrlkrz

Scott,

I loaded this on my clean (no other mods, except Bold Ancestor Child links) TNG 11.1 site.  When I choose the 'Ancestors' branch from the pulldown, my experience is like Ken's; i.e. it returns all individuals if no fields input, or if fields entered, the same results as without the Mod.  The branch filter isn't working as expected.  I only have one branch, and one tree.

Ron

Share this post


Link to post
Share on other sites
tngrlkrz    0
tngrlkrz

Scott,

Sort of good news.  Similar to your earlier 'My_Search_Branch mod, I found that the mod works fine only if I force the variable $tree = the name of my only tree in search.php:

%location:%
$_SESSION['tng_search_tree'] = $tree;
%end:%

%insert:after%
$tree = "kmtrees";
%end:%

Then, all works as expected, either with blank or partial field searchs, with or without the 'search_no_parents' mod.  

So again, a variable is not being delivered that search.php needs in order to do its search, apparently.  This is strange, because your dropdown does contain both the branch AND the tree, so perhaps merely need to set $tree from the pulldown selected?

Update:

I added a second branch and it works properly as well.  So, with one tree, and a forced $tree variable, the mod works fine with multiple branches.

I've considered of adding a 2nd tree to test that.  

 

Ron

Share this post


Link to post
Share on other sites
mkoche    0
mkoche

Hmmm, Jayat's issue is very discouraging not sure what is happening there!  Ken's issue I think is still related to the tree.  My problem with setting it is sending it twice in some cases.  Ah well, back to the drawing board.

Share this post


Link to post
Share on other sites
jayat1familytree    0
jayat1familytree

OK, if I add

&tree=1FamilyTree

into the search string after the branch, I get results!!!  

http://localhost/genealogy/search.php?branch=JayW&tree=1FamilyTree&fnqualify=contains&myfirstname=&lnqualify=contains&mylastname=&idqualify=equals&mypersonid=&gequalify=equals&mygender=&bpqualify=contains&mybirthplace=Wisconsin

(Only tried this on my localhost test database)

And I cut off all the rest of the search string after the birth place qualifier which I had used 'Wisconsin'

 

 

branch_search_test.jpg

 

Now, if you guys can figure how to create the URL with just the needed variables and the Tree, it should work.

Hope that helps

Jay

(I had asked for this capability way back ..

 

then maybe we can reduce all the "EXTRA " events to be drop down selections like you did for branches

 

 

Thanks!!

 

Jay

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×