diff --git a/include/nav.php b/include/nav.php index 3d27be13b..e1661644d 100644 --- a/include/nav.php +++ b/include/nav.php @@ -26,7 +26,7 @@ function nav(&$a) { $tpl = get_markup_template('nav.tpl'); $a->page['nav'] .= replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(), + '$baseurl' => $a->get_baseurl(), '$langselector' => lang_selector(), '$sitelocation' => $nav_info['sitelocation'], '$nav' => $nav_info['nav'], @@ -118,6 +118,12 @@ function nav_info(&$a) { $nav['search'] = array('search', t('Search'), "", t('Search site content')); + $nav['searchoption'] = array( + t("Full Text"), + t("Tags"), + t("Contacts"), + t("Forums")); + $gdirpath = 'directory'; if(strlen(get_config('system','singleuser'))) { diff --git a/include/text.php b/include/text.php index 4747a376f..f3e44b3eb 100644 --- a/include/text.php +++ b/include/text.php @@ -995,6 +995,11 @@ function search($s,$id='search-box',$url='/search',$save = false) { '$search_label' => t('Search'), '$save_label' => t('Save'), '$savedsearch' => feature_enabled(local_user(),'savedsearch'), + '$searchoption' => array( + t("Full Text"), + t("Tags"), + t("Contacts"), + t("Forums")) )); }} diff --git a/mod/dirfind.php b/mod/dirfind.php index e70dfe968..3cee6c133 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -14,13 +14,13 @@ function dirfind_init(&$a) { -function dirfind_content(&$a) { +function dirfind_content(&$a, $prefix = "") { $community = false; $local = get_config('system','poco_local_search'); - $search = notags(trim($_REQUEST['search'])); + $search = $prefix.notags(trim($_REQUEST['search'])); if(strpos($search,'@') === 0) $search = substr($search,1); diff --git a/mod/search.php b/mod/search.php index a01984d24..d5e0dfb20 100644 --- a/mod/search.php +++ b/mod/search.php @@ -1,4 +1,8 @@ ' . t('Search') . ''; @@ -117,14 +118,27 @@ function search_content(&$a) { $search = substr($search,1); } if(strpos($search,'@') === 0) { - require_once('mod/dirfind.php'); return dirfind_content($a); } if(strpos($search,'!') === 0) { - require_once('mod/dirfind.php'); return dirfind_content($a); } + if(x($_GET,'search-option')) + switch($_GET['search-option']) { + case 'fulltext': + break; + case 'tags': + $tag = true; + break; + case 'contacts': + return dirfind_content($a, "@"); + break; + case 'forums': + return dirfind_content($a, "!"); + break; + } + if(! $search) return $o; diff --git a/view/templates/searchbox.tpl b/view/templates/searchbox.tpl index c3b875294..b9a01752c 100644 --- a/view/templates/searchbox.tpl +++ b/view/templates/searchbox.tpl @@ -2,6 +2,13 @@
{{strip}} + + {{if $savedsearch}} diff --git a/view/theme/vier/templates/nav.tpl b/view/theme/vier/templates/nav.tpl index 8a40d6dd7..5483113f3 100644 --- a/view/theme/vier/templates/nav.tpl +++ b/view/theme/vier/templates/nav.tpl @@ -72,6 +72,12 @@
{{/if}}