3 require_once('include/socgraph.php');
4 require_once('include/Contact.php');
5 require_once('include/contact_selectors.php');
7 function allfriends_content(&$a) {
11 notice( t('Permission denied.') . EOL);
16 $cid = intval($a->argv[1]);
23 $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
28 $vcard_widget .= replace_macros(get_markup_template("vcard-widget.tpl"),array(
29 '$name' => htmlentities($c[0]['name']),
30 '$photo' => $c[0]['photo'],
31 'url' => z_root() . '/contacts/' . $cid
34 if(! x($a->page,'aside'))
35 $a->page['aside'] = '';
36 $a->page['aside'] .= $vcard_widget;
42 $r = all_friends(local_user(),$cid);
45 $o .= t('No friends to display.');
53 //get further details of the contact
54 $contact_details = get_contact_details_by_url($rr['url'], $uid);
58 // $rr[cid] is only available for common contacts. So if the contact is a common one, use contact_photo_menu to generate the photo_menu
59 // If the contact is not common to the user, Connect/Follow' will be added to the photo menu
62 $photo_menu = contact_photo_menu ($rr);
65 $connlnk = $a->get_baseurl() . '/follow/?url=' . $rr['url'];
66 $photo_menu = array(array(t("View Profile"), zrl($rr['url'])));
67 $photo_menu[] = array(t("Connect/Follow"), $connlnk);
72 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
73 'name' => htmlentities($rr['name']),
74 'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB),
75 'img_hover' => htmlentities($rr['name']),
76 'details' => $contact_details['location'],
77 'tags' => $contact_details['keywords'],
78 'about' => $contact_details['about'],
79 'account_type' => (($contact_details['community']) ? t('Forum') : ''),
80 'network' => network_to_name($contact_details['network'], $contact_details['url']),
81 'photo_menu' => $photo_menu,
82 'conntxt' => t('Connect'),
83 'connlnk' => $connlnk,
89 $tpl = get_markup_template('viewcontact_template.tpl');
91 $o .= replace_macros($tpl,array(
92 '$title' => sprintf( t('Friends of %s'), htmlentities($c[0]['name'])),
93 '$contacts' => $entries,
96 // $o .= paginate($a);