3 require_once('include/socgraph.php');
5 function common_content(&$a) {
10 $uid = intval($a->argv[2]);
11 $cid = intval($a->argv[3]);
14 if($cmd !== 'loc' && $cmd != 'rem')
19 if($cmd === 'loc' && $cid) {
20 $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
26 $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
31 $vcard_widget .= replace_macros(get_markup_template("vcard-widget.tpl"),array(
32 '$name' => htmlentities($c[0]['name']),
33 '$photo' => $c[0]['photo'],
34 'url' => z_root() . '/contacts/' . $cid
37 if(! x($a->page,'aside'))
38 $a->page['aside'] = '';
39 $a->page['aside'] .= $vcard_widget;
46 $r = q("SELECT `id` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d LIMIT 1",
47 dbesc(normalise_link(get_my_url())),
53 $r = q("SELECT `id` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
54 dbesc(normalise_link(get_my_url()))
64 if($cid == 0 && $zcid == 0)
69 $t = count_common_friends($uid,$cid);
71 $t = count_common_friends_zcid($uid,$zcid);
74 $a->set_pager_total($t);
77 notice( t('No contacts in common.') . EOL);
83 $r = common_friends($uid,$cid);
85 $r = common_friends_zcid($uid,$zcid);
98 'itemurl' => $rr['url'],
99 'name' => htmlentities($rr['name']),
100 'thumb' => $rr['photo'],
101 'img_hover' => htmlentities($rr['name']),
108 $tpl = get_markup_template('viewcontact_template.tpl');
110 $o .= replace_macros($tpl,array(
111 '$title' => t('Common Friends'),
112 '$contacts' => $entries,
115 // $o .= paginate($a);