From 6f8caf22ba22395b0e038989bfdc2726cc4c2342 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 17 Jun 2014 11:11:44 +0000 Subject: feature 3093: search form, ability to select the list of properties on which the search terms applies. feature 3094: minor redesign on search form. git-svn-id: http://piwigo.org/svn/trunk@28709 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_search.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/functions_search.inc.php') diff --git a/include/functions_search.inc.php b/include/functions_search.inc.php index 928673b3b..bc74867a1 100644 --- a/include/functions_search.inc.php +++ b/include/functions_search.inc.php @@ -85,7 +85,13 @@ function get_sql_search_clause($search) if (isset($search['fields']['allwords'])) { - $fields = array('file', 'name', 'comment', 'author'); + $fields = array('file', 'name', 'comment'); + + if (isset($search['fields']['allwords']['fields']) and count($search['fields']['allwords']['fields']) > 0) + { + $fields = array_intersect($fields, $search['fields']['allwords']['fields']); + } + // in the OR mode, request bust be : // ((field1 LIKE '%word1%' OR field2 LIKE '%word1%') // OR (field1 LIKE '%word2%' OR field2 LIKE '%word2%')) -- cgit v1.2.3