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(&$a) {
12 notice( t('Permission denied.') . EOL);
17 $cid = intval($a->argv[1]);
24 $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
32 $a->page['aside'] = "";
33 profile_load($a, "", 0, get_contact_details_by_url($c[0]["url"]));
35 $total = count_all_friends(local_user(), $cid);
38 $a->set_pager_total($total);
40 $r = all_friends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
43 $o .= t('No friends to display.');
51 //get further details of the contact
52 $contact_details = get_contact_details_by_url($rr['url'], $uid);
56 // $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
57 // If the contact is not common to the user, Connect/Follow' will be added to the photo menu
60 $photo_menu = contact_photo_menu ($rr);
63 $connlnk = $a->get_baseurl() . '/follow/?url=' . $rr['url'];
64 $photo_menu = array(array(t("View Profile"), zrl($rr['url'])));
65 $photo_menu[] = array(t("Connect/Follow"), $connlnk);
70 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
71 'name' => htmlentities($rr['name']),
72 'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB),
73 'img_hover' => htmlentities($rr['name']),
74 'details' => $contact_details['location'],
75 'tags' => $contact_details['keywords'],
76 'about' => $contact_details['about'],
77 'account_type' => (($contact_details['community']) ? t('Forum') : ''),
78 'network' => network_to_name($contact_details['network'], $contact_details['url']),
79 'photo_menu' => $photo_menu,
80 'conntxt' => t('Connect'),
81 'connlnk' => $connlnk,
87 $tab_str = contacts_tab($a, $cid, 3);
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 '$tab_str' => $tab_str,
94 '$contacts' => $entries,
95 '$paginate' => paginate($a),