diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 4e8adab62..ee9394e95 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -24,6 +24,7 @@ function findpeople_widget() { '$label' => t('Connect/Follow'), '$hint' => t('Examples: Robert Morgenstein, Fishing'), '$findthem' => t('Find'), + '$suggest' => t('Channel Suggestions'), '$similar' => '', // FIXME and uncomment when mod/match working // t('Similar Interests'), '$random' => t('Random Profile'), '$inv' => t('Invite Friends'), 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)) { diff --git a/view/tpl/peoplefind.tpl b/view/tpl/peoplefind.tpl index 16af5d8ed..ba71c1e80 100755 --- a/view/tpl/peoplefind.tpl +++ b/view/tpl/peoplefind.tpl @@ -12,6 +12,7 @@