3 require_once('include/socgraph.php');
4 require_once('include/Contact.php');
5 require_once('include/contact_selectors.php');
7 function common_content(&$a) {
12 $uid = intval($a->argv[2]);
13 $cid = intval($a->argv[3]);
17 notice( t('Permission denied.') . EOL);
21 if($cmd !== 'loc' && $cmd != 'rem')
27 if($cmd === 'loc' && $cid) {
28 $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
34 $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
39 $vcard_widget .= replace_macros(get_markup_template("vcard-widget.tpl"),array(
40 '$name' => htmlentities($c[0]['name']),
41 '$photo' => $c[0]['photo'],
42 'url' => z_root() . '/contacts/' . $cid
45 if(! x($a->page,'aside'))
46 $a->page['aside'] = '';
47 $a->page['aside'] .= $vcard_widget;
54 $r = q("SELECT `id` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d LIMIT 1",
55 dbesc(normalise_link(get_my_url())),
61 $r = q("SELECT `id` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
62 dbesc(normalise_link(get_my_url()))
72 if($cid == 0 && $zcid == 0)
77 $t = count_common_friends($uid,$cid);
79 $t = count_common_friends_zcid($uid,$zcid);
82 $a->set_pager_total($t);
85 notice( t('No contacts in common.') . EOL);
91 $r = common_friends($uid,$cid);
93 $r = common_friends_zcid($uid,$zcid);
104 //get further details of the contact
105 $contact_details = get_contact_details_by_url($rr['url'], $uid);
107 // $rr[id] is needed to use contact_photo_menu()
111 $photo_menu = contact_photo_menu ($rr);
115 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
116 'name' => $rr['name'],
117 'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB),
118 'img_hover' => htmlentities($rr['name']),
119 'details' => $contact_details['location'],
120 'tags' => $contact_details['keywords'],
121 'about' => $contact_details['about'],
122 'account_type' => (($contact_details['community']) ? t('Forum') : ''),
123 'network' => network_to_name($contact_details['network'], $contact_details['url']),
124 'photo_menu' => $photo_menu,
130 $tpl = get_markup_template('viewcontact_template.tpl');
132 $o .= replace_macros($tpl,array(
133 '$title' => t('Common Friends'),
134 '$contacts' => $entries,
137 // $o .= paginate($a);