aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2014-11-19 09:16:58 +1100
committerRedMatrix <info@friendica.com>2014-11-19 09:16:58 +1100
commite07d83e4316f5d2e14c382e0ba6afb4c7236487c (patch)
tree9e3fc659dda7a83640087b4ca5c216190c99f012
parent39178806736de54cbb0fda20b6bb65779136b9a5 (diff)
parentbfde28f28eae1f4b00aac03b2714254d14ab7464 (diff)
downloadvolse-hubzilla-e07d83e4316f5d2e14c382e0ba6afb4c7236487c.tar.gz
volse-hubzilla-e07d83e4316f5d2e14c382e0ba6afb4c7236487c.tar.bz2
volse-hubzilla-e07d83e4316f5d2e14c382e0ba6afb4c7236487c.zip
Merge pull request #703 from friendica/revert-702-master
Revert "Directory shows channel suggestions by default"
-rw-r--r--include/contact_widgets.php1
-rw-r--r--mod/directory.php42
-rwxr-xr-xview/tpl/direntry.tpl3
-rwxr-xr-xview/tpl/peoplefind.tpl1
4 files changed, 4 insertions, 43 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 ee064e3ed..d4a4c383a 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -1,6 +1,5 @@
<?php
-require_once('include/socgraph.php');
require_once('include/dir_fns.php');
require_once('include/widgets.php');
require_once('include/bbcode.php');
@@ -8,12 +7,6 @@ require_once('include/bbcode.php');
function directory_init(&$a) {
$a->set_pager_itemspage(60);
- if(x($_GET,'ignore')) {
- q("insert into xign ( uid, xchan ) values ( %d, '%s' ) ",
- intval(local_user()),
- dbesc($_GET['ignore'])
- );
- }
}
function directory_content(&$a) {
@@ -49,33 +42,11 @@ function directory_content(&$a) {
else
$search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
-
if(strpos($search,'=') && local_user() && get_pconfig(local_user(),'feature','expert'))
$advanced = $search;
-
$keywords = (($_GET['keywords']) ? $_GET['keywords'] : '');
- // Suggest channels if no search terms or keywords are given
- $suggest = ($search == '' && $keywords == '' && local_user());
-
- if($suggest) {
- $r = suggestion_query(local_user(),get_observer_hash());
-
- // Remember in which order the suggestions were
- $addresses = array();
- foreach($r as $rr) {
- $addresses[$rr['xchan_addr']] = $index++;
- }
-
- // Build query to get info about suggested people
- $advanced = '';
- foreach(array_keys($addresses) as $address) {
- $advanced .= "address=\"$address\" ";
- }
-
- }
-
$tpl = get_markup_template('directory_header.tpl');
@@ -256,28 +227,19 @@ function directory_content(&$a) {
'online' => $online,
'kw' => (($out) ? t('Keywords: ') : ''),
'keywords' => $out,
- 'ignlink' => $suggest ? $a->get_baseurl() . '/directory?ignore=' . $rr['hash'] : '',
- 'ignore_label' => "Don't suggest",
);
$arr = array('contact' => $rr, 'entry' => $entry);
call_hooks('directory_item', $arr);
- if($sort_order == '' && $suggest) {
- $entries[$addresses[$rr['address']]] = $arr['entry']; // Use the same indexes as originally to get the best suggestion first
- }
- else {
- $entries[] = $arr['entry'];
- }
+ $entries[] = $arr['entry'];
unset($profile);
unset($location);
}
- ksort($entries); // Sort array by key so that foreach-constructs work as expected
-
if($j['keywords']) {
$a->data['directory_keywords'] = $j['keywords'];
}
@@ -306,7 +268,7 @@ function directory_content(&$a) {
'$finddsc' => t('Finding:'),
'$safetxt' => htmlspecialchars($search,ENT_QUOTES,'UTF-8'),
'$entries' => $entries,
- '$dirlbl' => $suggest ? t('Channel Suggestions') : t('Directory'),
+ '$dirlbl' => t('Directory'),
'$submit' => t('Find'),
'$next' => alt_pager($a,$j['records'], t('next page'), t('previous page'))
diff --git a/view/tpl/direntry.tpl b/view/tpl/direntry.tpl
index cdc6f1f97..2da920ab1 100755
--- a/view/tpl/direntry.tpl
+++ b/view/tpl/direntry.tpl
@@ -6,9 +6,6 @@
{{if $entry.connect}}
<div class="directory-connect btn btn-default"><a href="{{$entry.connect}}"><i class="icon-plus connect-icon"></i> {{$entry.conn_label}}</a></div>
{{/if}}
-{{if $entry.ignlink}}
-<div class="directory-ignore btn btn-default"><a href="{{$entry.ignlink}}"> {{$entry.ignore_label}}</a></div>
-{{/if}}
</div>
</div>
diff --git a/view/tpl/peoplefind.tpl b/view/tpl/peoplefind.tpl
index 16af5d8ed..2f23948c8 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="suggest" >{{$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>