use Friendica\Core\Worker;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
-use Friendica\Model\Profile;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
use Friendica\Util\Network;
/// @TODO These 2 SELECTs are not checked on validity with DBM::is_result()
$count = q("SELECT count(*) AS `total` FROM `gcontact`
- LEFT JOIN `contact` ON `contact`.`nurl` = `gcontact`.`nurl` AND `contact`.`uid` = 0
- WHERE NOT `gcontact`.`hide` AND `gcontact`.`network` IN ('%s', '%s', '%s') AND
- ((`gcontact`.`last_contact` >= `gcontact`.`last_failure`) OR
- (`gcontact`.`updated` >= `gcontact`.`last_failure`)) AND
- (`gcontact`.`url` LIKE '%s' OR `gcontact`.`name` LIKE '%s' OR
- `gcontact`.`location` LIKE '%s' OR `gcontact`.`addr` LIKE '%s' OR
- `gcontact`.`about` LIKE '%s' OR `gcontact`.`keywords` LIKE '%s') $extra_sql",
+ WHERE NOT `hide` AND `network` IN ('%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",
dbesc(NETWORK_DFRN), dbesc($ostatus), dbesc($diaspora),
dbesc(escape_tags($search2)), dbesc(escape_tags($search2)), dbesc(escape_tags($search2)),
dbesc(escape_tags($search2)), dbesc(escape_tags($search2)), dbesc(escape_tags($search2)));
- $results = q("SELECT `gcontact`.`nurl`
+ $results = q("SELECT `nurl`
FROM `gcontact`
- LEFT JOIN `contact` ON `contact`.`nurl` = `gcontact`.`nurl` AND `contact`.`uid` = 0
- WHERE NOT `gcontact`.`hide` AND `gcontact`.`network` IN ('%s', '%s', '%s') AND
- ((`gcontact`.`last_contact` >= `gcontact`.`last_failure`) OR
- (`gcontact`.`updated` >= `gcontact`.`last_failure`)) AND
- (`gcontact`.`url` LIKE '%s' OR `gcontact`.`name` LIKE '%s' OR
- `gcontact`.`location` LIKE '%s' OR `gcontact`.`addr` LIKE '%s' OR
- `gcontact`.`about` LIKE '%s' OR `gcontact`.`keywords` LIKE '%s') $extra_sql
- GROUP BY `gcontact`.`nurl`
- ORDER BY `gcontact`.`updated` DESC LIMIT %d, %d",
+ WHERE NOT `hide` AND `network` IN ('%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",
dbesc(NETWORK_DFRN), dbesc($ostatus), dbesc($diaspora),
dbesc(escape_tags($search2)), dbesc(escape_tags($search2)), dbesc(escape_tags($search2)),
dbesc(escape_tags($search2)), dbesc(escape_tags($search2)), dbesc(escape_tags($search2)),
$a->set_pager_itemspage($j->items_page);
}
- if (count($j->results)) {
+ if (!empty($j->results)) {
$id = 0;
$connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
$conntxt = L10n::t('Connect');
$photo_menu = [
- 'profile' => [L10n::t("View Profile"), Profile::zrl($jj->url)],
+ 'profile' => [L10n::t("View Profile"), Contact::magicLink($jj->url)],
'follow' => [L10n::t("Connect/Follow"), $connlnk]
];
}
$entry = [
'alt_text' => $alt_text,
- 'url' => Profile::zrl($jj->url),
+ 'url' => Contact::magicLink($jj->url),
'itemurl' => $itemurl,
'name' => htmlentities($jj->name),
'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),