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 | |
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.
-rw-r--r-- | include/contact_widgets.php | 1 | ||||
-rw-r--r-- | mod/directory.php | 6 | ||||
-rwxr-xr-x | view/tpl/peoplefind.tpl | 1 |
3 files changed, 6 insertions, 2 deletions
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 @@ </form> <ul class="nav nav-pills nav-stacked"> {{if $similar}}<li><a href="match" >{{$similar}}</a></li>{{/if}} + {{if $loggedin}}<li><a href="directory?suggest=1" >{{$suggest}}</a></li>{{/if}} <li><a href="randprof" >{{$random}}</a></li> {{if $loggedin}}{{if $inv}}<li><a href="invite" >{{$inv}}</a></li>{{/if}}{{/if}} </ul> |