diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-19 18:26:38 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-19 18:26:38 +0000 |
commit | f9271180b1e82fdf746d315b241efb3ebabd8f35 (patch) | |
tree | fc5dd554d4c47c126c5231a36fd4cff72964017d /mod/search/search_hooks.php | |
parent | 2c27964706285c91845dbc3f116e58dac32c3913 (diff) | |
download | elgg-f9271180b1e82fdf746d315b241efb3ebabd8f35.tar.gz elgg-f9271180b1e82fdf746d315b241efb3ebabd8f35.tar.bz2 |
Merged previous to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5803 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search/search_hooks.php')
-rw-r--r-- | mod/search/search_hooks.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mod/search/search_hooks.php b/mod/search/search_hooks.php index a2063dbc1..86a6b452f 100644 --- a/mod/search/search_hooks.php +++ b/mod/search/search_hooks.php @@ -324,6 +324,11 @@ function search_comments_hook($hook, $type, $value, $params) { // available on metastrings (and boolean mode doesn't need it) $search_where = search_get_where_sql('msv', $fields, $params, FALSE); + $container_and = ''; + if ($params['container_guid'] && $params['container_guid'] !== ELGG_ENTITIES_ANY_VALUE) { + $container_and = 'AND e.container_guid = ' . sanitise_string($params['container_guid']); + } + $e_access = get_access_sql_suffix('e'); $a_access = get_access_sql_suffix('a'); // @todo this can probably be done through the api.. @@ -335,6 +340,7 @@ function search_comments_hook($hook, $type, $value, $params) { AND ($search_where) AND $e_access AND $a_access + $container_and LIMIT {$params['offset']}, {$params['limit']} "; @@ -349,6 +355,7 @@ function search_comments_hook($hook, $type, $value, $params) { AND ($search_where) AND $e_access AND $a_access + $container_and "; $result = get_data($q); |