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 $a->page['aside'] .= replace_macros(get_markup_template("vcard-widget.tpl"),array(
32 '$name' => $c[0]['name'],
33 '$photo' => $c[0]['photo'],
34 'url' => $a->get_baseurl() . '/contacts/' . $cid
41 $o .= '<h2>' . t('Common Friends') . '</h2>';
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);
92 $tpl = get_markup_template('common_friends.tpl');
96 $o .= replace_macros($tpl,array(
98 '$name' => $rr['name'],
99 '$photo' => $rr['photo'],
105 // $o .= paginate($a);