diff options
author | Stefan Parviainen <saparvia@caterva.eu> | 2014-12-07 13:38:38 +0100 |
---|---|---|
committer | Stefan Parviainen <saparvia@caterva.eu> | 2014-12-07 13:40:21 +0100 |
commit | c8818d83498d19262ba90f7f2954828c24cf03cb (patch) | |
tree | 47df39f63d12db6cf078561a245aff2c9c425db4 /mod | |
parent | 83ea120ac96c1f565a227a670023aa3128534e45 (diff) | |
download | volse-hubzilla-c8818d83498d19262ba90f7f2954828c24cf03cb.tar.gz volse-hubzilla-c8818d83498d19262ba90f7f2954828c24cf03cb.tar.bz2 volse-hubzilla-c8818d83498d19262ba90f7f2954828c24cf03cb.zip |
Suggestions in dir redux. Suggestions are now showed in directory if suggest=1 parameter is given to directory.
Diffstat (limited to 'mod')
-rw-r--r-- | mod/directory.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mod/directory.php b/mod/directory.php index c64c3386c..79c1e99c9 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -58,13 +58,14 @@ function directory_content(&$a) { $keywords = (($_GET['keywords']) ? $_GET['keywords'] : ''); // Suggest channels if no search terms or keywords are given - $suggest = ($search == '' && $keywords == '' && local_user()); + $suggest = (local_user() && x($_REQUEST,'suggest')) ? $_REQUEST['suggest'] : ''; if($suggest) { $r = suggestion_query(local_user(),get_observer_hash()); // Remember in which order the suggestions were $addresses = array(); + $index = 0; foreach($r as $rr) { $addresses[$rr['xchan_addr']] = $index++; } @@ -74,12 +75,13 @@ function directory_content(&$a) { foreach(array_keys($addresses) as $address) { $advanced .= "address=\"$address\" "; } + // Remove last space in the advanced query + $advanced = rtrim($advanced); } $tpl = get_markup_template('directory_header.tpl'); - $dirmode = intval(get_config('system','directory_mode')); if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) { |