From: friendica Date: Sun, 20 May 2012 04:53:27 +0000 (-0700) Subject: search with leading @ performs directory search (# for tag search), nothing for text... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f16a1199408d167bbc7c52dc408ef02b36808317;p=friendica.git search with leading @ performs directory search (# for tag search), nothing for text search --- diff --git a/mod/dirfind.php b/mod/dirfind.php index 34c54dd918..5c5d0e933a 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -17,6 +17,9 @@ function dirfind_init(&$a) { function dirfind_content(&$a) { $search = notags(trim($_REQUEST['search'])); + + if(strpos($search,'@') === 0) + $search = substr($search,1); $o = ''; diff --git a/mod/search.php b/mod/search.php index 635c87b705..3e6bf68aa6 100644 --- a/mod/search.php +++ b/mod/search.php @@ -80,7 +80,7 @@ function search_content(&$a) { $o = '' . "\r\n"; - $o .= '

' . t('Search This Site') . '

'; + $o .= '

' . t('Search') . '

'; if(x($a->data,'search')) $search = notags(trim($a->data['search'])); @@ -101,6 +101,10 @@ function search_content(&$a) { $tag = true; $search = substr($search,1); } + if(strpos($search,'@') === 0) { + require_once('mod/dirfind.php'); + return dirfind_content($a); + } if(! $search) return $o;