advanced search front-end
This commit is contained in:
parent
20ef3aee72
commit
bef416a2d1
@ -16,6 +16,8 @@ function findpeople_widget() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$advanced_search = ((local_user() && get_pconfig(local_user(),'feature','expert')) ? true : false);
|
||||||
|
|
||||||
return replace_macros(get_markup_template('peoplefind.tpl'),array(
|
return replace_macros(get_markup_template('peoplefind.tpl'),array(
|
||||||
'$findpeople' => t('Find Channels'),
|
'$findpeople' => t('Find Channels'),
|
||||||
'$desc' => t('Enter name or interest'),
|
'$desc' => t('Enter name or interest'),
|
||||||
@ -26,6 +28,9 @@ function findpeople_widget() {
|
|||||||
'$similar' => '', // FIXME and uncomment when mod/match working // t('Similar Interests'),
|
'$similar' => '', // FIXME and uncomment when mod/match working // t('Similar Interests'),
|
||||||
'$random' => t('Random Profile'),
|
'$random' => t('Random Profile'),
|
||||||
'$inv' => t('Invite Friends'),
|
'$inv' => t('Invite Friends'),
|
||||||
|
'$advanced_search' => $advanced_search,
|
||||||
|
'$advanced_hint' => t('Exammple: name=fred and country=iceland'),
|
||||||
|
'$find_advanced' => t('Advanced Find'),
|
||||||
'$loggedin' => local_user()
|
'$loggedin' => local_user()
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -42,12 +42,13 @@ function directory_content(&$a) {
|
|||||||
else
|
else
|
||||||
$search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
|
$search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
|
||||||
|
|
||||||
|
$advanced = ((x($_REQUEST,'query')) ? notags(trim($_REQUEST['query'])) : '');
|
||||||
|
|
||||||
$keywords = (($_GET['keywords']) ? $_GET['keywords'] : '');
|
$keywords = (($_GET['keywords']) ? $_GET['keywords'] : '');
|
||||||
|
|
||||||
$tpl = get_markup_template('directory_header.tpl');
|
$tpl = get_markup_template('directory_header.tpl');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$dirmode = intval(get_config('system','directory_mode'));
|
$dirmode = intval(get_config('system','directory_mode'));
|
||||||
|
|
||||||
if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
|
if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
|
||||||
@ -81,6 +82,7 @@ function directory_content(&$a) {
|
|||||||
|
|
||||||
if($url) {
|
if($url) {
|
||||||
// We might want to make the tagadelic count (&kw=) configurable or turn it off completely.
|
// We might want to make the tagadelic count (&kw=) configurable or turn it off completely.
|
||||||
|
|
||||||
$numtags = get_config('system','directorytags');
|
$numtags = get_config('system','directorytags');
|
||||||
|
|
||||||
$kw = ((intval($numtags)) ? $numtags : 24);
|
$kw = ((intval($numtags)) ? $numtags : 24);
|
||||||
@ -92,6 +94,8 @@ function directory_content(&$a) {
|
|||||||
$query .= '&address=' . urlencode($search);
|
$query .= '&address=' . urlencode($search);
|
||||||
if($keywords)
|
if($keywords)
|
||||||
$query .= '&keywords=' . urlencode($keywords);
|
$query .= '&keywords=' . urlencode($keywords);
|
||||||
|
if($advanced)
|
||||||
|
$query .= '&query=' . urlencode($advanced);
|
||||||
|
|
||||||
$sort_order = ((x($_REQUEST,'order')) ? $_REQUEST['order'] : '');
|
$sort_order = ((x($_REQUEST,'order')) ? $_REQUEST['order'] : '');
|
||||||
if($sort_order)
|
if($sort_order)
|
||||||
|
@ -283,6 +283,10 @@ function dir_parse_query($s) {
|
|||||||
$curr['logic'] = 'or';
|
$curr['logic'] = 'or';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if($q === 'not') {
|
||||||
|
$curr['logic'] .= ' not';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if(strpos($q,'=')) {
|
if(strpos($q,'=')) {
|
||||||
if(! isset($curr['logic']))
|
if(! isset($curr['logic']))
|
||||||
$curr['logic'] = 'or';
|
$curr['logic'] = 'or';
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
<form action="directory" method="post" />
|
<form action="directory" method="post" />
|
||||||
<input class="icon-search" id="side-peoplefind-url" type="text" name="search" size="24" title="{{$hint}}" placeholder=""/>
|
<input class="icon-search" id="side-peoplefind-url" type="text" name="search" size="24" title="{{$hint}}" placeholder=""/>
|
||||||
<input id="side-peoplefind-submit" type="submit" name="submit" value="{{$findthem}}" />
|
<input id="side-peoplefind-submit" type="submit" name="submit" value="{{$findthem}}" />
|
||||||
|
{{if $advanced_search}}
|
||||||
|
<input class="icon-search" id="side-peoplefind-url" type="text" name="query" size="24" title="{{$advanced_hint}}" placeholder=""/>
|
||||||
|
<input id="side-peoplefind-submit" type="submit" name="submit" value="{{$find_advanced}}" />
|
||||||
|
{{/if}}
|
||||||
</form>
|
</form>
|
||||||
<br />
|
<br />
|
||||||
{{if $similar}}<a href="match" >{{$similar}}</a><br />{{/if}}
|
{{if $similar}}<a href="match" >{{$similar}}</a><br />{{/if}}
|
||||||
|
Reference in New Issue
Block a user