aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2014-06-17 11:11:44 +0000
committerplegall <plg@piwigo.org>2014-06-17 11:11:44 +0000
commit6f8caf22ba22395b0e038989bfdc2726cc4c2342 (patch)
treeeb8f98932f9707adddf23d75d06b6c7f61cc5a71 /include
parent583af81d3d23ab0e3692dd7bb4a36314deab5994 (diff)
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
Diffstat (limited to '')
-rw-r--r--include/functions_search.inc.php8
1 files changed, 7 insertions, 1 deletions
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%'))