Browse Source

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

pull/303/merge
friendica 10 years ago
parent
commit
f16a119940
  1. 3
      mod/dirfind.php
  2. 6
      mod/search.php

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

6
mod/search.php

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

Loading…
Cancel
Save