- return Renderer::replaceMacros(get_markup_template('remote_friends_common.tpl'), array(
- '$desc' => L10n::tt("%d contact in common", "%d contacts in common", $t),
- '$base' => System::baseUrl(),
- '$uid' => $profile_uid,
- '$cid' => (($cid) ? $cid : '0'),
+ if (!DBA::isResult($r)) {
+ return;
+ }
+
+ $entries = [];
+ foreach ($r as $rr) {
+ $entry = [
+ 'url' => Contact::magicLink($rr['url']),
+ 'name' => $rr['name'],
+ 'photo' => ProxyUtils::proxifyUrl($rr['photo'], false, ProxyUtils::SIZE_THUMB),
+ ];
+ $entries[] = $entry;
+ }
+
+ $tpl = Renderer::getMarkupTemplate('remote_friends_common.tpl');
+ return Renderer::replaceMacros($tpl, [
+ '$desc' => L10n::tt("%d contact in common", "%d contacts in common", $t),
+ '$base' => System::baseUrl(),
+ '$uid' => $profile_uid,
+ '$cid' => (($cid) ? $cid : '0'),