diff options
-rw-r--r-- | include/functions_search.inc.php | 9 | ||||
-rw-r--r-- | language/en_UK/help/quick_search.html | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/functions_search.inc.php b/include/functions_search.inc.php index 688a043de..2f42473b3 100644 --- a/include/functions_search.inc.php +++ b/include/functions_search.inc.php @@ -938,6 +938,14 @@ function qsearch_get_images(QExpression $expr, QResults $qsr) case 'file': $clauses[] = $file_like; break; + case 'author': + if ( strlen($token->term) ) + $clauses = array_merge($clauses, qsearch_get_text_token_search_sql($token, array('author'))); + elseif ($token->modifier & QST_WILDCARD) + $clauses[] = 'author IS NOT NULL'; + else + $clauses[] = 'author IS NULL'; + break; case 'width': case 'height': $clauses[] = $token->scope->get_sql($scope_id, $token); @@ -1178,6 +1186,7 @@ function get_quick_search_results_no_cache($q, $options) $scopes[] = new QSearchScope('tag', array('tags')); $scopes[] = new QSearchScope('photo', array('photos')); $scopes[] = new QSearchScope('file', array('filename')); + $scopes[] = new QSearchScope('author', array(), true); $scopes[] = new QNumericRangeScope('width', array()); $scopes[] = new QNumericRangeScope('height', array()); $scopes[] = new QNumericRangeScope('ratio', array(), false, 0.001); diff --git a/language/en_UK/help/quick_search.html b/language/en_UK/help/quick_search.html index 717c09ae9..d78652a2d 100644 --- a/language/en_UK/help/quick_search.html +++ b/language/en_UK/help/quick_search.html @@ -68,6 +68,13 @@ </tr> <tr> +<td><q>author:</q> +</td> +<td>Searches by author.<br> +<q>author:John</q></td> +</tr> + +<tr> <td><q>created:</q><br> <q>taken:</q> <q>shot:</q> |