+ $id = 0;
+
+ foreach ($r as $rr) {
+
+ //get further details of the contact
+ $contact_details = get_contact_details_by_url($rr['url'], $uid);
+
+ // $rr['id'] is needed to use contact_photo_menu()
+ /// @TODO Adding '/" here avoids E_NOTICE on missing constants
+ $rr['id'] = $rr['cid'];
+
+ $photo_menu = '';
+ $photo_menu = contact_photo_menu($rr);
+
+ $entry = array(
+ 'url' => $rr['url'],
+ 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
+ 'name' => $contact_details['name'],
+ 'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB),
+ 'img_hover' => htmlentities($contact_details['name']),
+ 'details' => $contact_details['location'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
+ 'account_type' => account_type($contact_details),
+ 'network' => network_to_name($contact_details['network'], $contact_details['url']),
+ 'photo_menu' => $photo_menu,
+ 'id' => ++$id,
+ );
+ $entries[] = $entry;
+ }