search with leading @ performs directory search (# for tag search), nothing for text search

This commit is contained in:
friendica 2012-05-19 21:53:27 -07:00
parent c6104fb856
commit f16a119940
2 changed files with 8 additions and 1 deletions

View file

@ -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 = '';

View file

@ -80,7 +80,7 @@ function search_content(&$a) {
$o = '<div id="live-search"></div>' . "\r\n";
$o .= '<h3>' . t('Search This Site') . '</h3>';
$o .= '<h3>' . t('Search') . '</h3>';
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;