diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/functions_search.inc.php | 14 |
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)) |