aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2014-09-26 20:15:53 +0000
committerrvelices <rv-github@modusoptimus.com>2014-09-26 20:15:53 +0000
commitb3a6125892df5989ee3c9ff8fa930a6e1d91854c (patch)
treef2b5d1e730d32673c023e4da67763e3c6b02758b /include
parentba160199ae0512f6c55c78c1e91c871834c4572e (diff)
git-svn-id: http://piwigo.org/svn/trunk@29804 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions_search.inc.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/functions_search.inc.php b/include/functions_search.inc.php
index 4f971cacb..688a043de 100644
--- a/include/functions_search.inc.php
+++ b/include/functions_search.inc.php
@@ -384,9 +384,9 @@ class QNumericRangeScope extends QSearchScope
function get_sql($field, $token)
{
$clauses = array();
- if ($token->scope_data['range'][0]!=='')
+ if ($token->scope_data['range'][0]!='')
$clauses[] = $field.' >'.($token->scope_data['strict'][0]?'':'=').$token->scope_data['range'][0].' ';
- if ($token->scope_data['range'][1]!=='')
+ if ($token->scope_data['range'][1]!='')
$clauses[] = $field.' <'.($token->scope_data['strict'][1]?'':'=').$token->scope_data['range'][1].' ';
if (empty($clauses))
@@ -458,9 +458,9 @@ class QDateRangeScope extends QSearchScope
function get_sql($field, $token)
{
$clauses = array();
- if ($token->scope_data[0]!=='')
+ if ($token->scope_data[0]!='')
$clauses[] = $field.' >= \'' . $token->scope_data[0].'\'';
- if ($token->scope_data[1]!=='')
+ if ($token->scope_data[1]!='')
$clauses[] = $field.' <= \'' . $token->scope_data[1].'\'';
if (empty($clauses))
@@ -1081,7 +1081,7 @@ function qsearch_eval(QMultiToken $expr, QResults $qsr, &$qualifies, &$ignored_t
{
$crt_ids = $qsr->iids[$crt->idx] = array_unique( array_merge($qsr->images_iids[$crt->idx], $qsr->tag_iids[$crt->idx]) );
$crt_qualifies = count($crt_ids)>0 || count($qsr->tag_ids[$crt->idx])>0;
- $crt_ignored_terms = $crt_qualifies ? array() : array($crt->term);
+ $crt_ignored_terms = $crt_qualifies ? array() : array((string)$crt);
}
else
$crt_ids = qsearch_eval($crt, $qsr, $crt_qualifies, $crt_ignored_terms);
@@ -1172,6 +1172,8 @@ function get_quick_search_results_no_cache($q, $options)
'qs' => array('q'=>$q),
);
+ $q = trigger_change('qsearch_pre', $q);
+
$scopes = array();
$scopes[] = new QSearchScope('tag', array('tags'));
$scopes[] = new QSearchScope('photo', array('photos'));
@@ -1247,6 +1249,8 @@ function get_quick_search_results_no_cache($q, $options)
$debug[] = 'before perms '.count($ids);
$search_results['qs']['matching_tags'] = $qsr->all_tags;
+ $search_results = trigger_change('qsearch_results', $search_results, $expression, $qsr);
+
global $template;
if (empty($ids))