- $tpl = get_markup_template('suggest_friends.tpl');
-
- foreach($r as $rr) {
-
- $o .= replace_macros($tpl,array(
- '$url' => $rr['url'],
- '$name' => $rr['name'],
- '$photo' => $rr['photo'],
- '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'],
- '$ignore' => t('Ignore/Hide')
- ));
+ $id = 0;
+
+ foreach ($r as $rr) {
+
+ $connlnk = System::baseUrl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
+ $ignlnk = System::baseUrl() . '/suggest?ignore=' . $rr['id'];
+ $photo_menu = [
+ 'profile' => [L10n::t("View Profile"), Contact::magicLink($rr["url"])],
+ 'follow' => [L10n::t("Connect/Follow"), $connlnk],
+ 'hide' => [L10n::t('Ignore/Hide'), $ignlnk]
+ ];
+
+ $contact_details = Contact::getDetailsByURL($rr["url"], local_user(), $rr);
+
+ $entry = [
+ 'url' => Contact::magicLink($rr['url']),
+ 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
+ 'img_hover' => $rr['url'],
+ 'name' => $contact_details['name'],
+ 'thumb' => ProxyUtils::proxifyUrl($contact_details['thumb'], false, ProxyUtils::SIZE_THUMB),
+ 'details' => $contact_details['location'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
+ 'account_type' => Contact::getAccountType($contact_details),
+ 'ignlnk' => $ignlnk,
+ 'ignid' => $rr['id'],
+ 'conntxt' => L10n::t('Connect'),
+ 'connlnk' => $connlnk,
+ 'photo_menu' => $photo_menu,
+ 'ignore' => L10n::t('Ignore/Hide'),
+ 'network' => ContactSelector::networkToName($rr['network'], $rr['url']),
+ 'id' => ++$id,
+ ];
+ $entries[] = $entry;