From e0fdecc9061febee5d102975a79c436704fa0519 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Thu, 12 Feb 2015 16:02:22 +0000 Subject: Unused code --- app/Controller/SearchController.php | 34 ++++----- find.php | 8 +-- includes/functions/functions_db.php | 81 ++++------------------ .../GEDFact_assistant/_CENS/census_3_find.php | 2 +- modules_v3/GEDFact_assistant/module.php | 2 +- 5 files changed, 34 insertions(+), 93 deletions(-) diff --git a/app/Controller/SearchController.php b/app/Controller/SearchController.php index ccdc05bbe4..1ae89e0f80 100644 --- a/app/Controller/SearchController.php +++ b/app/Controller/SearchController.php @@ -304,40 +304,32 @@ class SearchController extends PageController { $logstring = "Type: General\nQuery: " . $this->query; Log::AddSearchlog($logstring, $this->search_trees); + $this->myindilist = array(); // Search the individuals - if (isset ($this->srindi)) { - $this->myindilist = search_indis($query_terms, array_keys($this->search_trees), 'AND'); - } else { - $this->myindilist = array(); + if (isset ($this->srindi) && $query_terms) { + $this->myindilist = search_indis($query_terms, array_keys($this->search_trees)); } // Search the fams - if (isset ($this->srfams)) { + $this->myfamlist = array(); + if (isset ($this->srfams) && $query_terms) { $this->myfamlist = array_merge( - search_fams($query_terms, array_keys($this->search_trees), 'AND'), - search_fams_names($query_terms, array_keys($this->search_trees), 'AND') + search_fams($query_terms, array_keys($this->search_trees)), + search_fams_names($query_terms, array_keys($this->search_trees)) ); $this->myfamlist = array_unique($this->myfamlist); - } else { - $this->myfamlist = array(); } // Search the sources - if (isset ($this->srsour)) { - if (!empty ($this->query)) { - $this->mysourcelist = search_sources($query_terms, array_keys($this->search_trees), 'AND'); - } - } else { - $this->mysourcelist = array(); + $this->mysourcelist = array(); + if (isset ($this->srsour) && $query_terms) { + $this->mysourcelist = search_sources($query_terms, array_keys($this->search_trees)); } // Search the notes - if (isset ($this->srnote)) { - if (!empty ($this->query)) { - $this->mynotelist = search_notes($query_terms, array_keys($this->search_trees), 'AND'); - } - } else { - $this->mynotelist = array(); + $this->mynotelist = array(); + if (isset ($this->srnote) && $query_terms) { + $this->mynotelist = search_notes($query_terms, array_keys($this->search_trees)); } // If only 1 item is returned, automatically forward to that item diff --git a/find.php b/find.php index 807c411cd4..6ce7abff2d 100644 --- a/find.php +++ b/find.php @@ -484,7 +484,7 @@ if ($action == "filter") { // Output Individual if ($type == "indi") { echo '
'; - $myindilist = search_indis_names($filter_array, array(WT_GED_ID), 'AND'); + $myindilist = search_indis_names($filter_array, array(WT_GED_ID)); if ($myindilist) { echo '