$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'],
$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'))) {
'$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"))
));
}}
-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);
<?php
+require_once("include/bbcode.php");
+require_once('include/security.php');
+require_once('include/conversation.php');
+require_once('mod/dirfind.php');
function search_saved_searches() {
nav_set_selected('search');
- require_once("include/bbcode.php");
- require_once('include/security.php');
- require_once('include/conversation.php');
$o = '<h3>' . t('Search') . '</h3>';
$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;
<form action="{{$action_url}}" method="get" >
{{strip}}
<input type="text" name="search" id="search-text" placeholder="{{$search_label}}" value="{{$s}}" />
+ <select name="search-option">
+ <option value="fulltext">{{$searchoption.0}}</option>
+ <option value="tags">{{$searchoption.1}}</option>
+ <option value="contacts">{{$searchoption.2}}</option>
+ <option value="forums">{{$searchoption.3}}</option>
+ </select>
+
<input type="submit" name="submit" id="search-submit" value="{{$search_label}}" />
{{if $savedsearch}}
<input type="submit" name="save" id="search-save" value="{{$save_label}}" />
<li role="search" id="search-box">
<form method="get" action="{{$nav.search.0}}">
<input accesskey="s" id="search-text" class="nav-menu-search" type="text" value="" name="search">
+ <select name="search-option">
+ <option value="fulltext">{{$nav.searchoption.0}}</option>
+ <option value="tags">{{$nav.searchoption.1}}</option>
+ <option value="contacts">{{$nav.searchoption.2}}</option>
+ <option value="forums">{{$nav.searchoption.3}}</option>
+ </select>
</form>
</li>
{{/if}}