Commit 30c8cea8 authored by Penny Leach's avatar Penny Leach
Browse files

fixed up internal search communities

parent 5fdf13c9
......@@ -247,11 +247,16 @@ class PluginSearchInternal extends PluginSearch {
id, name, description, jointype, owner, ctime, mtime
FROM
" . get_config('dbprefix') . "community
WHERE
WHERE (
name ILIKE '%' || ? || '%'
OR description ILIKE '%' || ? || '%'
) AND (
owner = ? OR id IN (
SELECT community FROM " . get_config('dbprefix') . "community_member WHERE member = ?
)
)
",
array($query_string, $query_string),
array($query_string, $query_string, $USER->get('id'), $USER->get('id')),
$offset,
$limit
);
......@@ -261,14 +266,16 @@ class PluginSearchInternal extends PluginSearch {
COUNT(*)
FROM
" . get_config('dbprefix') . "usr_group u
WHERE
owner = ?
AND (
name ILIKE '%' || ? || '%'
OR description ILIKE '%' || ? || '%'
WHERE (
name ILIKE '%' || ? || '%'
OR description ILIKE '%' || ? || '%'
) AND (
owner = ? OR id IN (
SELECT community FROM " . get_config('dbprefix') . "community_member WHERE member = ?
)
)
",
array($query_string, $query_string)
array($query_string, $query_string, $USER->get('id'), $USER->get('id'))
);
}
// TODO
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment