Merge pull request #6121 from annando/hide
Don't suggest hidden contacts / Added AP to the suggestions
This commit is contained in:
commit
320c986e05
3 changed files with 11 additions and 11 deletions
|
@ -121,23 +121,23 @@ function dirfind_content(App $a, $prefix = "") {
|
|||
|
||||
/// @TODO These 2 SELECTs are not checked on validity with DBA::isResult()
|
||||
$count = q("SELECT count(*) AS `total` FROM `gcontact`
|
||||
WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s') AND
|
||||
WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s', '%s') AND
|
||||
((`last_contact` >= `last_failure`) OR (`updated` >= `last_failure`)) AND
|
||||
(`url` LIKE '%s' OR `name` LIKE '%s' OR `location` LIKE '%s' OR
|
||||
`addr` LIKE '%s' OR `about` LIKE '%s' OR `keywords` LIKE '%s') $extra_sql",
|
||||
DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
|
||||
DBA::escape(Protocol::ACTIVITYPUB), DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
|
||||
DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)),
|
||||
DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)));
|
||||
|
||||
$results = q("SELECT `nurl`
|
||||
FROM `gcontact`
|
||||
WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s') AND
|
||||
WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s', '%s') AND
|
||||
((`last_contact` >= `last_failure`) OR (`updated` >= `last_failure`)) AND
|
||||
(`url` LIKE '%s' OR `name` LIKE '%s' OR `location` LIKE '%s' OR
|
||||
`addr` LIKE '%s' OR `about` LIKE '%s' OR `keywords` LIKE '%s') $extra_sql
|
||||
GROUP BY `nurl`
|
||||
ORDER BY `updated` DESC LIMIT %d, %d",
|
||||
DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
|
||||
DBA::escape(Protocol::ACTIVITYPUB), DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
|
||||
DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)),
|
||||
DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)),
|
||||
$pager->getStart(), $pager->getItemsPerPage());
|
||||
|
|
|
@ -36,6 +36,11 @@ function noscrape_init(App $a)
|
|||
'account-type' => $a->profile['account-type'],
|
||||
];
|
||||
|
||||
$dfrn_pages = ['request', 'confirm', 'notify', 'poll'];
|
||||
foreach ($dfrn_pages as $dfrn) {
|
||||
$json_info["dfrn-{$dfrn}"] = System::baseUrl()."/dfrn_{$dfrn}/{$which}";
|
||||
}
|
||||
|
||||
if (!$a->profile['net-publish'] || $a->profile['hidewall']) {
|
||||
header('Content-type: application/json; charset=utf-8');
|
||||
$json_info["hide"] = true;
|
||||
|
@ -99,11 +104,6 @@ function noscrape_init(App $a)
|
|||
}
|
||||
}
|
||||
|
||||
$dfrn_pages = ['request', 'confirm', 'notify', 'poll'];
|
||||
foreach ($dfrn_pages as $dfrn) {
|
||||
$json_info["dfrn-{$dfrn}"] = System::baseUrl()."/dfrn_{$dfrn}/{$which}";
|
||||
}
|
||||
|
||||
//Output all the JSON!
|
||||
header('Content-type: application/json; charset=utf-8');
|
||||
echo json_encode($json_info);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue