aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2023-05-07 09:52:27 +0200
committerMario Vavti <mario@mariovavti.com>2023-05-07 09:52:27 +0200
commit383d0e17f2c596e991156b773cf0bc115269e941 (patch)
tree41cdd4c796ed49f74cf5090bd8d4a1b1fc4ab6a5
parentf3f861234db069868d38bb231817966507da5274 (diff)
downloadvolse-hubzilla-383d0e17f2c596e991156b773cf0bc115269e941.tar.gz
volse-hubzilla-383d0e17f2c596e991156b773cf0bc115269e941.tar.bz2
volse-hubzilla-383d0e17f2c596e991156b773cf0bc115269e941.zip
fix directory search
-rw-r--r--Zotlabs/Module/Dirsearch.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/Zotlabs/Module/Dirsearch.php b/Zotlabs/Module/Dirsearch.php
index 7380a551e..c31d5f0ee 100644
--- a/Zotlabs/Module/Dirsearch.php
+++ b/Zotlabs/Module/Dirsearch.php
@@ -15,8 +15,7 @@ class Dirsearch extends Controller {
$ret = array('success' => false);
- // logger('request: ' . print_r($_REQUEST,true));
-
+ // logger('request: ' . print_r($_REQUEST,true));
$dirmode = intval(get_config('system','directory_mode'));
@@ -129,8 +128,12 @@ class Dirsearch extends Controller {
$sql_extra .= $this->dir_query_build($joiner,'xprof_marital',$marital);
if($sexual)
$sql_extra .= $this->dir_query_build($joiner,'xprof_sexual',$sexual);
-
- if($keywords) {
+ if($keywords && $name) {
+ // this is a general search
+ $sql_extra .= $this->dir_query_build($joiner,'xprof_keywords',$keywords);
+ }
+ if($keywords && !$name) {
+ // this is a search for keywords only
$keywords_arr = explode(',', $keywords);
stringify_array_elms($keywords_arr, true);
$keywords_query = " AND xchan_hash IN (SELECT xtag_hash FROM xtag WHERE xtag_term IN (" . protect_sprintf(implode(',', $keywords_arr)) . ")) ";