diff options
author | friendica <info@friendica.com> | 2012-07-10 19:28:02 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-07-10 19:28:02 -0700 |
commit | e7957e14489ce8eb3b69ebede928dfe441a4924d (patch) | |
tree | e25fde990e36171053364c71471d9b90fd5633ef /mod/search.php | |
parent | 94fabe3a2942ca93b436694f180f8eb2a72df918 (diff) | |
download | volse-hubzilla-e7957e14489ce8eb3b69ebede928dfe441a4924d.tar.gz volse-hubzilla-e7957e14489ce8eb3b69ebede928dfe441a4924d.tar.bz2 volse-hubzilla-e7957e14489ce8eb3b69ebede928dfe441a4924d.zip |
create fetch_tags function, make search work again, change logo
Diffstat (limited to 'mod/search.php')
-rw-r--r-- | mod/search.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/mod/search.php b/mod/search.php index 320ffddce..ec7e2ec3a 100644 --- a/mod/search.php +++ b/mod/search.php @@ -108,21 +108,20 @@ function search_content(&$a) { if(! $search) return $o; - if (get_config('system','use_fulltext_engine')) { - if($tag) - $sql_extra = sprintf(" AND MATCH (`item`.`tag`) AGAINST ('".'"%s"'."' in boolean mode) ", '#'.dbesc(protect_sprintf($search))); - else + if($tag) { + $sql_extra = sprintf(" AND `item`.`id` IN (select `oid` from term where otype = %d and type = %d and term = '%s') ", + intval(TERM_OBJ_POST), + intval(TERM_HASHTAG), + dbesc(protect_sprintf($search)) + ); + } + else { + if (get_config('system','use_fulltext_engine')) $sql_extra = sprintf(" AND MATCH (`item`.`body`) AGAINST ('".'"%s"'."' in boolean mode) ", dbesc(protect_sprintf($search))); - } else { - if($tag) - $sql_extra = sprintf(" AND `item`.`tag` REGEXP '%s' ", dbesc('\\]' . protect_sprintf(preg_quote($search)) . '\\[')); else $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search)))); } - - - // Here is the way permissions work in the search module... // Only public posts can be shown // OR your own posts if you are a logged in member @@ -165,6 +164,9 @@ function search_content(&$a) { ); + + + if($tag) $o .= '<h2>Items tagged with: ' . $search . '</h2>'; else |