This is a TNG mod directive file %name:Expand Search-$51% %version:v13.0.0.7% %description:Adds a residence search that combines birth, baptism, death and burial places. Expands search criteria allowing searches on CAPITAL letters and does not contain. Provides for search of end of line individuals and people with no sources. Gives registered users a search page that adds citations, media and notes and the ability to filter for branches, sosa, citations, media and notes. % %author:A DuPree:https://tng.lythgoes.net/wiki/index.php?title=User:Mkoche% %wikipage:Expand_Search% ======================== Add new file ========================== %copyfile:expandsearch/tng_expandsearchinstalled% ********* SEARCH.PHP ********* //$51 switch media number link to getperson_media (all media tab) for all search results %target:search.php% %location:% $getperson_url = getURL( "getperson", 1 ); %end:% %insert:after% /*$51*/ $getperson_media_url = getURL( "getperson_media", 1 ); %end:% //$51 just to ensure branch logic not skipped, even if no branches %location:% } if($numtrees > 1 || $numbranches) { %end:% %replace:% } /*$51*/ if($numtrees > 0 || $numbranches) { %end:% //$51 just to ensure branch logic not skipped, even if no branches %location:% echo "{$row['personID']} "; if($numtrees > 1 || $numbranches) { %end:% %replace:% echo "{$row['personID']} "; /*$51*/ if($numtrees > 0 || $numbranches) { %end:% -------------Stuff for residence search %location:% $_SESSION['tng_search_lnqualify'] = $lnqualify; %end:% %insert:after% /*** Start - Added for expand search mod to set variables ***/ $myresidence = trim(stripslashes($myresidence)); $_SESSION['tng_search_myresidence'] = cleanIt($myresidence); $_SESSION['tng_search_resqualify'] = $resqualify; $_SESSION['tng_search_noparents'] = $noparents; $_SESSION['tng_search_nosources'] = $nosources; /*** End - Added for expand search mod to set variables ***/ %end:% %location:% $querystring = ""; $allwhere = ""; %end:% %insert:after% /*** Start - Added for expand search mod to set query variable for residence search ***/ $uslist = "('Alabama', 'Alaska', 'American Samoa', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'District of Columbia', 'Florida', 'Georgia', 'Guam', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Northern Mariana Islands', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Puerto Rico', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virgin Islands', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming', 'USA', 'United States of America', 'AK', 'AL', 'AR', 'AS', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'GA', 'GU', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MP', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UM', 'UT', 'VA', 'VI', 'VT', 'WA', 'WI', 'WV', 'WY' )"; if( $myresidence ) { $myres = urldecode(trim($myresidence)); if (get_magic_quotes_gpc() == 0) $myres = addslashes( $myres ); $justbirth = "birthplace = '" . $myres . "' OR birthplace LIKE '%, " . $myres . "' OR birthplace LIKE '" . $myres . ",%' OR birthplace LIKE '%, " . $myres . ",%'"; $justaltbirth = "altbirthplace = '" . $myres . "' OR altbirthplace LIKE '%, " . $myres . "' OR altbirthplace LIKE '" . $myres . ",%' OR altbirthplace LIKE '%, " . $myres . ",%'"; $birthplace = $justbirth . " OR " . $justaltbirth; $deathplace = " OR deathplace = '" . $myres . "' OR deathplace LIKE '" . $myres . ",%' OR deathplace LIKE '%, " . $myres . "' OR deathplace LIKE '%, " . $myres . ",%' OR burialplace = '" . $myres . "' OR burialplace LIKE '%, " . $myres . "' OR burialplace LIKE '%, " . $myres . ",%'"; $allplace = '(' . $birthplace . $deathplace . ')'; if ($_GET['b-o'] == 'yes') $allplace = '(' . $birthplace . ')'; $marrplace = " marrplace = '" . $myres . "' OR marrplace LIKE '" . $myres . ",%' OR marrplace LIKE '%, " . $myres . "' OR marrplace LIKE '%, " . $myres . ",%'"; $divplace = " divplace = '" . $myres . "' OR divplace LIKE '" . $myres . ",%' OR divplace LIKE '%, " . $myres . "' OR divplace LIKE '%, " . $myres . ",%'"; $eventplace = " eventplace = '" . $myres . "' OR eventplace LIKE '" . $myres . ",%' OR eventplace LIKE '%, " . $myres . "' OR eventplace LIKE '%, " . $myres . ",%'"; if ($resqualify == 'contains') $addtowherestring = $allplace; if ($resqualify == 'equals') $addtowherestring = "(birthplace ='" . $myres . "' OR altbirthplace = '" . $myres . "' OR deathplace = '" . $myres . "' OR burialplace = '" . $myres . "' )"; if ($resqualify == 'startswith') $addtowherestring = "(birthplace LIKE '" . $myres . "%' OR altbirthplace LIKE '" . $myres . "%' OR deathplace LIKE '" . $myres . "%' OR burialplace LIKE '" . $myres . "%' )"; if ($resqualify == 'endswith') $addtowherestring = "(birthplace LIKE '%" . $myres . "' OR altbirthplace LIKE '%" . $myres . "' OR deathplace LIKE '%" . $myres . "' OR burialplace LIKE '%" . $myres . "' )"; if ($resqualify == 'allres') { $addtowherestring = $allplace; $addtowherestring .= " OR p.personID IN (SELECT husband FROM $families_table WHERE $marrplace OR $divplace) OR p.personID IN (SELECT wife FROM $families_table WHERE $marrplace OR $divplace ) "; $addtowherestring .= " OR p.personID IN (SELECT persfamID FROM $events_table WHERE $eventplace) "; } if ($myresidence == 'All-USA') { $justbirth = "birthplace IN $uslist OR SUBSTRING_INDEX(birthplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(birthplace, ', ', -2) IN $uslist "; $justaltbirth = "altbirthplace IN $uslist OR SUBSTRING_INDEX(altbirthplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(altbirthplace, ', ', -2) IN $uslist "; $birthplace = $justbirth . " OR " . $justaltbirth; $deathplace = "OR deathplace IN $uslist OR SUBSTRING_INDEX(deathplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(deathplace, ', ', -2) IN $uslist OR burialplace IN $uslist OR SUBSTRING_INDEX(burialplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(burialplace, ', ', -2) IN $uslist "; $justdeath = "deathplace IN $uslist OR SUBSTRING_INDEX(deathplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(deathplace, ', ', -2) IN $uslist OR burialplace IN $uslist OR SUBSTRING_INDEX(burialplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(burialplace, ', ', -2) IN $uslist "; $justburial = $justdeath; $allplace = $birthplace . $deathplace; $marrplace = "marrplace IN $uslist OR SUBSTRING_INDEX(marrplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(marrplace, ', ', -2) IN $uslist "; // $birthplace = "birthplace IN $uslist OR altbirthplace IN $uslist OR SUBSTRING_INDEX(birthplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(altbirthplace, ', ', -1) IN $uslist "; // $deathplace = " OR deathplace IN $uslist OR burialplace IN $uslist OR SUBSTRING_INDEX(deathplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(burialplace, ', ', -1) IN $uslist "; // $marrplace = "marrplace IN $uslist OR SUBSTRING_INDEX(marrplace, ', ', -1) IN $uslist "; $addtowherestring = "(" . $birthplace . $deathplace; $addtowherestring .= " OR p.personID IN (SELECT husband FROM $families_table WHERE $marrplace) OR p.personID IN (SELECT wife FROM $families_table WHERE $marrplace ) "; $addtowherestring .= " OR p.personID IN (SELECT persfamID FROM $events_table WHERE eventplace IN $uslist) )"; } } /*** End - Added for expand search mod to set query variable for residence search ***/ %end:% %location:% FROM ($people_table as p, $families_table, $people_table as spouse, $trees_table) %end:% %triminsert:after% $noparentjoin $nosourcesjoin %end:% %location:% $query2 ="SELECT count(p.ID) as pcount FROM ($people_table as p, $families_table, $people_table as spouse) %end:% %triminsert:after% $noparentjoin $nosourcesjoin %end:% %location:% LEFT JOIN $trees_table on p.gedcom = $trees_table.gedcom %end:% %triminsert:before% $noparentjoin $nosourcesjoin %end:% %location:% $query2 = "SELECT count(p.ID) as pcount FROM $people_table AS p $families_join %end:% %triminsert:after% $noparentjoin $nosourcesjoin %end:% %location:% %end:% %insert:after% %end:% ----------------- modify the search strings to include new variables %location:% $treequery = "SELECT count(gedcom) as treecount FROM $trees_table"; %end:% %insert:before% /*** Start - Added for expand search mod to modify search strings ***/ // ** this modifies search strings for sosa /*$51*/ global $gsosa; /*$51*/ if(isset($_GET['sosa']))$gsosa = $_GET['sosa']; $sosafile = $cms['tngpath'] . "tng_sosa.php"; if (file_exists($sosafile)) { $sosajoin = "LEFT JOIN tng_sosa as sosa ON p.personID = sosa.PersonID AND p.gedcom = sosa.tree"; $qreturn = '(SELECT MIN(sosa) FROM tng_sosa WHERE p.personID = PersonID) as sosa' . ', '; if($gsosa == 'nsosa') { $urlstring .= "&sosa=$gsosa"; $querystring .= " {$text['cap_and']} Sosa {$text['dnexist']}"; if ($allwhere) $allwhere .= " AND p.personID NOT IN (SELECT PersonID FROM tng_sosa)"; else $allwhere .= " p.personID NOT IN (SELECT PersonID FROM tng_sosa)"; } if($gsosa == 'ysosa') { $urlstring .= "&sosa=$gsosa"; $querystring .= " {$text['cap_and']} Sosa {$text['exists']}"; if ($allwhere) $allwhere .= " AND p.personID IN (SELECT PersonID FROM tng_sosa)"; else $allwhere .= " p.personID IN (SELECT PersonID FROM tng_sosa)"; } } // ** this modifies search strings for myresidence if ($myresidence) { $urlstring .= "&myresidence=$myresidence&resqualify=$resqualify"; $querystring .= " {$text['cap_and']} {$text['residenceisin']} $myresidence"; if ($allwhere) $allwhere .= " AND " . $addtowherestring; else $allwhere .= $addtowherestring; } // ** this modifies search strings for noparents and nosources if($noparents) { $urlstring .= "&noparents=$noparents"; $querystring .= " {$text['cap_and']} {$text['withoutparents']}"; $noparentjoin = "LEFT JOIN $children_table as noparents ON p.personID = noparents.personID AND p.gedcom = noparents.gedcom"; if ($allwhere) $allwhere .= " AND noparents.familyID is NULL"; else $allwhere .= " noparents.familyID is NULL"; } else $noparentjoin = ""; if($nosources) { $urlstring .= "&nosources=$nosources"; $querystring .= " {$text['cap_and']} {$text['noattachedsources']} "; $nosourcesjoin = "RIGHT JOIN tng_families ff ON ff.husband = p.personID OR ff.wife = p.personID LEFT JOIN tng_citations ON persfamID = p.personID OR persfamID = ff.familyID "; $allwhere .= " AND citationID is null "; } else $nosourcesjoin = ""; /*** End - Added for expand search mod to modify search strings ***/ // This adds in an id list search /*$51*/ IF (isset($_GET['ilist'])){ $ilist = $_GET['ilist']; $ilist = "'" . $ilist . "'"; $ilist = str_replace(",","','", $ilist ); $ilist = '(' . $ilist . ')'; $urlstring .= "&ilist=$ilist"; // $querystring .= " {$text['cap_and']} {$text['residenceisin']} $myresidence"; if ($allwhere) $allwhere .= " AND personID IN " . $ilist ; else $allwhere .= "personID IN " . $ilist ; } %end:% %location:% p.ID, spouse.personID as spersonID, %end:% %triminsert:after% $qreturn %end:% %location:% p.ID, p.personID, lastname, %end:% %triminsert:after% $qreturn %end:% %location:% $_SESSION['tng_search_tree'] = $tree; %end:% %insert:before% include($cms['tngpath'] . "checklogin.php"); global $currentuser, $currentuserdesc, $allow_edit, $assignedtree, $nosources, $nosource, $noparents, $resqualify, $myresidence; $_SESSION['tng_search_nosource'] = $nosource; $searchpage_option_1 = 1; $suplinks = 1; if ($currentuser) $sp1 = $searchpage_option_1; else $sp1 = 1; //$51 "'" in personid is flag to skip expand search routines /*$51*/ if ($mypersonid == "'") {$_SESSION['tng_nr'] = 999; $nr = 999;$mypersonid = "";} /*$51*/ if (!$allow_admin){$_SESSION['tng_nr'] = 999; $nr = 999;} /*$51*/ if (isset($broadsearch) AND $broadsearch =='Y') {$_SESSION['tng_nr'] = "";$nr="";} /*$51*/ if (($currentuser) && ($_SESSION['tng_nr'] != 999)) $sp1 = $searchpage_option_1; else $sp1 = 1; %end:% %parameter:$searchpage_option_1:0% %desc:How search deals with one record found. Defaults to (1)
0 = One search shows on search page;
1 = One search goes to individual's page;
% %parameter:$suplinks% %desc:Show links on search page to sources, notes and media pages for individuals. Defaults to (1)
0 = Do not show links;
1 = Show links;
% %location:% if($order == "birth") { $orderstr = "IF(p.birthdatetr, p.birthdatetr, p.altbirthdatetr), p.lastname, p.firstname"; %end:% %insert:before% $recsort = "recup"; $reclabel = $text['date']; if($order == "oldest") { $orderstr = "p.changedate, p.lastname, p.firstname, IF(p.birthdatetr, p.birthdatetr, p.altbirthdatetr)"; $recsort = $tngprint ? $reclabel : "$reclabel \"\""; } else { $recsort = $tngprint ? $reclabel : "$reclabel \"\""; if($order == "latest") $orderstr = "p.changedate DESC, p.lastname, p.firstname, IF(p.birthdatetr, p.birthdatetr, p.altbirthdatetr)"; } %end:% //$51 remove change date //$51 %location:% //$51 p.lnprefix, p.firstname, p.nickname, //$51 %end:% //$51 %triminsert:after% //$51 p.changedate, //$51 %end:% //$51 //$51 %location:% //$51 firstname, p.living, p.private, p.branch, //$51 %end:% //$51 %triminsert:after% //$51 p.changedate, //$51 %end:% //$51 //$51 %location:% //$51    //$51 %end:% //$51 %insert:before% //$51  ' . $recsort . ' '; ?> //$51 %end:% //$51 //$51 %location:% //$51 echo "$i\n"; //$51 %end:% //$51 %insert:after% //$51 $date = date_create($row['changedate']); //$51 $dfed = date_format($date, 'Y-m-d'); //$51 if ($currentuser) echo "$dfed\n"; //$51 %end:% %location:% elseif($numrows == 1 && !$offset) { %end:% %replace:% elseif($numrows == 1 && !$offset && $sp1 != 0 ) { %end:% %location:% echo $header; %end:% %insert:before% // **** Start Expand Search $header = str_replace('{$text['matches']} $offsetplus {$text['to']} $numrowsplus {$text['of']} " . number_format($totrows) . " $querystring

"; %end:% %trimreplace:% echo "

{$text['matches']} $offsetplus {$text['to']} $numrowsplus {$text['of']} " . number_format($totrows) . " $querystring

"; if (($currentuser) && ($_SESSION['tng_nr'] != 999)) { if (file_exists($sosafile)) $addtofilter = " " . $admtext['no'] . " Sosa Sosa ||"; echo "
" . $admtext['no'] . " " . $text['branches'] . " " . $text['branches'] . " ||" . $addtofilter ." " . $admtext['no'] . " " . $text['sources'] . " " . $text['sources'] . " || " . $admtext['no'] . " " . $text['notes'] . " " . $text['notes'] . " || " . $admtext['no'] . " " . $text['media'] . " " . $text['media'] . "
"; } %end:% %location:% %end:% %replace:%  ' . $text['sources'] . ' '; ?>  ' . $text['notes'] . ' '; ?>  ' . $text['media'] . ' '; ?> %end:% %location:% echo ""; %end:% %replace:% /*$51*/ if (isset($allhere["thenumber"]) AND $allhere["thenumber"] > 0) $trclass = "source"; else $trclass = "nosource"; if($row['branch']) $trclass .= " branch "; else $trclass .= " nobranch"; /*$51*/ if(isset($notesnum["thenumber"]) AND $notesnum["thenumber"] > 0 ) $trclass .= " notes "; else $trclass .= " nonotes"; /*$51*/ if(isset($medianum["thenumber"]) AND $medianum["thenumber"] > 0 ) $trclass .= " media "; else $trclass .= " nomedia"; %end:% %location:% echo "\n"; %end:% %insert:before% if (file_exists($sosafile)) { if ($row['sosa'] != '') $trclass .= " sosa"; else $trclass .= " nososa"; echo ''; } %end:% %location:% echo "$chartlink "; %end:% %insert:before% $imagestr = "\"{$text['edit']}\"/"; $editstr = "" . $imagestr; /*$51 if( $allow_edit ) echo $editstr; */ %end:% %location:% $spousestr = $spouse ? "$spouse " : ""; %end:% %insert:before% /*$51*/ if(($currentuser) && ($_SESSION['tng_nr'] != 999)) { $smdater = ''; $querysm = "SELECT marrdatetr, familyID FROM $families_table WHERE ( (husband = \"$spouseID\" AND wife = \"{$row['personID']}\") OR (wife = \"$spouseID\" AND husband = \"{$row['personID']}\") ) AND gedcom = \"{$row['gedcom']}\""; $resultsm = tng_query($querysm); $smdate = tng_fetch_assoc($resultsm); /*$51*/ if (isset($smdate['marrdatetr']) AND $smdate['marrdatetr'] != '0000-00-00') $smdater ="".$text['marrabbr']."". substr($smdate['marrdatetr'], 0, 4); /*$51*/ if (isset($smdate['familyID'])) $feditstr = "" . $imagestr; /*$51*/ $spousestr = $spouse ? "$spouse  $smdater" : ""; } else %end:% %location:% echo $branchstr; } echo ""; %end:% %insert:after% } /*$51*/ if(($currentuser) && ($_SESSION['tng_nr'] != 999)) { echo ""; echo ""; /*$51*/ echo ""; %end:% ********** SEARCHFORM.PHP *********** %target:searchform.php% ----------------------------- Stuff for residence search --------------------------------- %parameter:$sfopac:1% %desc:Adjust lightness of residence field name
Must be a number from 0 to 1 ex.. 0.1, 0.7
"1" = Original
"0" = So light it would be invisible
Defaults to (0.5)% %location:% if(!empty($msg)) echo "" . stripslashes(strip_tags($msg)) . ""; %end:% %insert:after% /*$51*/ if ($allow_admin) echo " use ' to skip"; %end:% %location:% %end:% %insert:before% %end:% %location:% document.search.idqualify.selectedIndex = 0; %end:% %insert:after% /*** Start - Added for expand search mod adds residence search ***/ document.search.resqualify.selectedIndex = 0; /*** End - Added for expand search mod adds residence search ***/ %end:% %location:% document.search.mypersonid.value = ""; %end:% %insert:after% /*** Start - Added for expand search mod adds residence search ***/ document.search.myresidence.value = ''; document.search.noparents.checked = false; /*** End - Added for expand search mod adds residence search ***/ %end:% %location:% "ln","fn","id" %end:% %trimreplace:% "ln","fn","id", "res" %end:% %location:% "lastname","firstname","personid" %end:% %trimreplace:% "lastname","firstname","personid", "residence" %end:% %location:% %end:% %insert:after% %end:% -------------------------------------------- stuff for noparents nosources residence---------------------- %location:% $showspouse = isset($_SESSION['tng_search_showspouse']) ? $_SESSION['tng_search_showspouse'] : ""; %end:% %insert:after% /*** Start - Added for expand search mod adds noparents, nosources and residence session variables ***/ $noparents = $_SESSION['tng_search_noparents']; if ($currentuser) $nosources = $_SESSION['tng_search_nosources']; $myresidence = $_SESSION['tng_search_myresidence']; $resqualify = $_SESSION['tng_search_resqualify']; /*** End - Added for expand search mod adds noparents, nosources and residence session variables ***/ %end:% %location:% if( thisform.showdeath.checked ) URL = URL + "&showdeath=yes"; if( thisform.showspouse.checked ) URL = URL + "&showspouse=yes"; %end:% %replace:% //$51 if( thisform.showdeath.checked ) //$51 URL = URL + "&showdeath=yes"; //$51 if( thisform.showspouse.checked ) //$51 URL = URL + "&showspouse=yes"; /*** Start - Added for expand search mod adds noparents and nosources into urlstring ***/ if( thisform.noparents.checked ) URL = URL + "&noparents=yes"; if( thisform.nosources.checked ) URL = URL + "&nosources=yes"; /*** End - Added for expand search mod adds noparents and nosources into urlstring ***/ %end:% %location:% />
%end:% %replace:% %end:% %location:% />
%end:% %replace:% />
'; echo $text['srcmsg']; echo '
'; } ?> %end:% %location:% %end:% %insert:after% %end:% %location:% URL = URL + "&branch=" + thisform.branch[thisform.branch.selectedIndex].value; %end:% %insert:after% /*** Start - Added for expand search mod adds sosa to url ***/ URL = URL + "&sosa=" + thisform.sosa[thisform.sosa.selectedIndex].value; /*** End - Added for expand search mod adds sosa search on form ***/ %end:% ****************** Searchlib ********************* %target:searchlib.php% %location:% case "gt": %end:% %insert:before% case "pm50": $criteria = "($yearstr1 < $numvalue + 50 AND $yearstr2 > $numvalue - 50)"; $qualifystr = $text['plusminus50']; break; %end:% %location:% $query = "SELECT eventtypeID, tag, display FROM $eventtypes_table WHERE keep=\"1\" AND type=\"$type\" ORDER BY display"; %end:% %replace:% $query = "SELECT eventtypeID, tag, display FROM $eventtypes_table WHERE type=\"$type\" ORDER BY display"; %end:% %location:% default: $criteria .= "$column LIKE \"%$usevalue%\""; $qualifystr = $text['contains']; break; } %end:% %insert:before% case "caps": $criteria .= "BINARY($column) LIKE BINARY(UPPER(\"%$usevalue%\"))"; $qualifystr = $text['allcaps']; break; case "notcontain": $criteria .= "$column NOT LIKE \"%$usevalue%\""; $qualifystr = $text['dncontain']; break; %end:% %location:% ?> %end:% %insert:before% // ******** Added by Expand Search - check for installation function check_es_install() { $checkES = 1; return $checkES; } %end:% ======================== famsearch.php ========================== %target:famsearch.php% %location:% echo "

" . $text['matches'] . " $offsetplus " . $text['to'] . " $numrowsplus " . $text['of'] . " " . number_format($totrows) . " $querystring

"; %end:% %trimreplace:% // changed by expand search global $addmtext; if (isset($_GET['specsearch'])) $addmtext = $text['and'] . " familyID in list"; echo "

" . $text['matches'] . " $offsetplus " . $text['to'] . " $numrowsplus " . $text['of'] . " " . number_format($totrows) . " $querystring $addmtext

"; // changed by expand statistics %end:% %location:% //left join to people table twice, once for husband and for wife %end:% %insert:before% // changed by expand search $uslist = "('Alabama', 'Alaska', 'American Samoa', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'District of Columbia', 'Florida', 'Georgia', 'Guam', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Northern Mariana Islands', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Puerto Rico', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virgin Islands', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming', 'USA', 'United States of America', 'AK', 'AL', 'AR', 'AS', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'GA', 'GU', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MP', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UM', 'UT', 'VA', 'VI', 'VT', 'WA', 'WI', 'WV', 'WY' )"; if (isset($_GET['specsearch'])) { $sptree = $_GET['tree']; IF ($_GET['sosa'] =='ysosa') {$spsosa = " AND personID IN (SELECT personID from tng_sosa )"; $usosa = "&sosa=ysosa"; } IF ($_GET['myresidence'] ) {$myr = $_GET['myresidence']; $uplace = "&myresidence=".$myr; } IF ($myr AND $myr == "All-USA") { $justbirth = "birthplace IN $uslist OR SUBSTRING_INDEX(birthplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(birthplace, ', ', -2) IN $uslist "; $justaltbirth = "altbirthplace IN $uslist OR SUBSTRING_INDEX(altbirthplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(altbirthplace, ', ', -2) IN $uslist "; $birthplace = $justbirth . " OR " . $justaltbirth; $deathplace = "OR deathplace IN $uslist OR SUBSTRING_INDEX(deathplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(deathplace, ', ', -2) IN $uslist OR burialplace IN $uslist OR SUBSTRING_INDEX(burialplace, ', ', -1) IN $uslist OR SUBSTRING_INDEX(burialplace, ', ', -2) IN $uslist "; $spplace = " AND (" . $birthplace . $deathplace . ") "; } ELSEIF ($myr) $spplace = " AND (birthplace = '$myr' OR birthplace LIKE '%, $myr' OR birthplace LIKE '$myr,%' OR birthplace LIKE '%, $myr,%' OR altbirthplace = '$myr' OR altbirthplace LIKE '%, $myr' OR altbirthplace LIKE '$myr,%' OR altbirthplace LIKE '%, $myr,%' OR deathplace = '$myr' OR deathplace LIKE '$myr,%' OR deathplace LIKE '%, $myr' OR deathplace LIKE '%, $myr,%' OR burialplace = '$myr' OR burialplace LIKE '%, $myr' OR burialplace LIKE '%, $myr,%')"; IF ($_GET['myfamlastname']) { $ulast = '&myfamlastname='.$_GET['myfamlastname'].'&lnqualify='.$_GET['lnqualify']; if ($_GET['lnqualify'] == 'contains') $spln = " AND lastname LIKE '%{$_GET['myfamlastname']}%' "; else $spln = " AND lastname = '{$_GET['myfamlastname']}' "; } IF ($_GET['nomother'] == 'yes') {$snopar = " AND wife = '' "; $unomom = "&nomother=yes"; } IF ($_GET['nofather'] == 'yes') {$snopar = " AND husband = '' "; $unodad = "&nofather=yes"; } IF ($_GET['divorced'] == 'yes') {$snopar = " AND divdate != '' "; $udivo = "&divorced=yes"; } $nwherestr = " WHERE gedcom = '$sptree' $spplace $spsosa $spln "; $allwhere .= " familyID IN (SELECT DISTINCT familyID FROM $families_table WHERE husband IN (SELECT personID FROM $people_table $nwherestr) OR wife IN (SELECT personID FROM $people_table $nwherestr) ) $snopar AND "; $urlstring .= '&specsearch=yes' . $usosa . $uplace . $ulast . $unomom . $unodad . $udiv; } // changed by expand search %end:% *************** GETPERSON.PHP ****************** %target:getperson.php% %location:% $indmedia = getMedia($row,"I"); %end:% %insert:before% /*** Start - Added for expand search mod to change display***/ if (isset($_GET['cites']) == 'citations' ) {echo '';} if (isset($_GET['media']) == 'media' ) {echo '';} if (isset($_GET['notes']) == 'notes' ) {echo '';} /*** End - Added for expand search mod to change display***/ %end:% **************** Custom Texts *********************** %target: languages/English-UTF8/cust_text.php% %location:% //Mods should put their changes before this line, local changes should come after it. %end:% %insert:before% // Expand Search $text['displaying'] = "Displaying"; $text['recordsfrom'] = "records from"; $text['srcmsg'] = "No citations - person and one family (slow)"; $text['eolmsg'] = "Search end of lines (children but no parents)"; $text['allcaps'] = "All CAPS for"; $text['dncontain'] = "does not contain"; $text['residence'] = "Residence"; $text['residenceisin'] = "residence is in"; $text['withoutparents'] = "without parents"; $text['noattachedsources'] = "no attached sources"; $text['allresidences'] = "all residences"; $text['pm50'] = "+/- 50 years from"; $text['mhelptext'] = "individual:family"; // Expand Search %end:% %target: languages/English/cust_text.php% %location:% //Mods should put their changes before this line, local changes should come after it. %end:% %insert:before% // Expand Search $text['displaying'] = "Displaying"; $text['recordsfrom'] = "records from"; $text['srcmsg'] = "No citations - person and one family (slow)"; $text['eolmsg'] = "Search end of lines (children but no parents)"; $text['allcaps'] = "All CAPS for"; $text['dncontain'] = "does not contain"; $text['residence'] = "Residence"; $text['residenceisin'] = "residence is in"; $text['withoutparents'] = "without parents"; $text['noattachedsources'] = "no attached sources"; $text['allresidences'] = "all residences"; $text['pm50'] = "+/- 50 years from"; $text['mhelptext'] = "individual:family"; // Expand Search %end:% %target:languages/English-UTF8/cust_text.php% %location:% ?> %end:% %insert:before% /*$51d*/ $text['topofline'] = "No parents (top of a direct branch)"; %end:% %target:languages/Czech-UTF8/cust_text.php% %location:% ?> %end:% %insert:before% /*$51d*/ $text['topofline'] = "Žádní rodice (zacátek prímé pobocky)"; %end:% %target:languages/German-UTF8/cust_text.php% %location:% ?> %end:% %insert:before% /*$51d*/ $text['topofline'] = "Keine Eltern (spitze der direkten niederlassung)"; %end:%
      {$row['treename']}"; if($row['branch']) { $branches = explode(",",$row['branch']); echo " | "; %end:% %replace:% /*$51*/ echo ""; /*$51*/ if($row['branch']) { /*$51*/ $branches = explode(",",$row['branch']); /*$51*/ echo ""; %end:% %location:% $rights = determineLivingPrivateRights($row); $row['allow_living'] = $rights['living']; $row['allow_private'] = $rights['private']; %end:% %insert:before% /*$51*/ if(($currentuser) && ($_SESSION['tng_nr'] != 999)) { $wherestring = " persfamID='" . $row['personID'] . "' "; $marriages = getSpouseFamilyFullUnion($row['gedcom'], $row['personID']); while ( $marriagerow = tng_fetch_assoc( $marriages ) ) { $wherestring .= " OR persfamID='" . $marriagerow['familyID'] . "' "; } $queryc ="select count(citationID) as thenumber FROM $citations_table WHERE $wherestring "; $resultc = tng_query($queryc); $allhere = tng_fetch_assoc($resultc); if ($allhere['thenumber'] > 0 AND $suplinks == 1 ) $sourcenum = "" . $allhere['thenumber'] . ""; else $sourcenum = $allhere["thenumber"]; $queryn ="select count(ID) as thenumber FROM $notelinks_table WHERE $wherestring "; $resultn = tng_query($queryn); $notesnum = tng_fetch_assoc($resultn); if ($notesnum['thenumber'] > 0 && $notestogether == 0 AND $suplinks == 1) $notesamt = '' . $notesnum["thenumber"] . ''; else $notesamt = $notesnum["thenumber"]; $wherestring2 = str_replace("persfamID","personID",$wherestring); $querym ="select count(medialinkID) as thenumber FROM $medialinks_table WHERE $wherestring2 "; $resultm = tng_query($querym); $medianum = tng_fetch_assoc($resultm); $wherestring3 = " personID='" . $row['personID'] . "' "; $querymi ="select count(medialinkID) as thenumber FROM $medialinks_table WHERE $wherestring3 "; $resultmi = tng_query($querymi); $medianumi = tng_fetch_assoc($resultmi); $mediareport = $medianumi['thenumber'] . ":" . $medianum['thenumber']; // $mediareport = $medianum['thenumber']; //$51 if ($medianumi['thenumber'] > 0 AND $suplinks == 1) $mediaamt = '' . $mediareport . ''; //$51 else $mediaamt = $mediareport; //$51 switch to getperson_media (all media tab) /*$51*/ $mediaamt = '' . $mediareport . ''; } %end:% %location:% echo "
$i
" . $sourcenum; echo "" . $notesamt; echo "" . $mediaamt.":"; echo "
 
:
: