3 require_once('include/socgraph.php');
4 require_once('include/Contact.php');
5 require_once('include/contact_selectors.php');
6 require_once('mod/contacts.php');
8 function allfriends_content(App $a) {
12 notice( t('Permission denied.') . EOL);
17 $cid = intval($a->argv[1]);
24 $uid = $a->user['uid'];
26 $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
31 if (! dbm::is_result($c)) {
35 $a->page['aside'] = "";
36 profile_load($a, "", 0, get_contact_details_by_url($c[0]["url"]));
38 $total = count_all_friends(local_user(), $cid);
41 $a->set_pager_total($total);
44 $r = all_friends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
46 if (! dbm::is_result($r)) {
47 $o .= t('No friends to display.');
55 //get further details of the contact
56 $contact_details = get_contact_details_by_url($rr['url'], $uid, $rr);
60 // $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
61 // If the contact is not common to the user, Connect/Follow' will be added to the photo menu
64 $photo_menu = contact_photo_menu ($rr);
67 $connlnk = App::get_baseurl() . '/follow/?url=' . $rr['url'];
69 'profile' => array(t("View Profile"), zrl($rr['url'])),
70 'follow' => array(t("Connect/Follow"), $connlnk)
76 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
77 'name' => htmlentities($contact_details['name']),
78 'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB),
79 'img_hover' => htmlentities($contact_details['name']),
80 'details' => $contact_details['location'],
81 'tags' => $contact_details['keywords'],
82 'about' => $contact_details['about'],
83 'account_type' => account_type($contact_details),
84 'network' => network_to_name($contact_details['network'], $contact_details['url']),
85 'photo_menu' => $photo_menu,
86 'conntxt' => t('Connect'),
87 'connlnk' => $connlnk,
93 $tab_str = contacts_tab($a, $cid, 3);
95 $tpl = get_markup_template('viewcontact_template.tpl');
97 $o .= replace_macros($tpl,array(
98 //'$title' => sprintf( t('Friends of %s'), htmlentities($c[0]['name'])),
99 '$tab_str' => $tab_str,
100 '$contacts' => $entries,
101 '$paginate' => paginate($a),