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' => $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;
44 $o .= replace_macros(get_markup_template("section_title.tpl"),array(
45 '$title' => t('Common Friends')
51 $r = q("select id from contact where nurl = '%s' and uid = %d limit 1",
52 dbesc(normalise_link(get_my_url())),
58 $r = q("select id from gcontact where nurl = '%s' limit 1",
59 dbesc(normalise_link(get_my_url()))
69 if($cid == 0 && $zcid == 0)
74 $t = count_common_friends($uid,$cid);
76 $t = count_common_friends_zcid($uid,$zcid);
79 $a->set_pager_total($t);
82 notice( t('No contacts in common.') . EOL);
88 $r = common_friends($uid,$cid);
90 $r = common_friends_zcid($uid,$zcid);
97 $tpl = get_markup_template('common_friends.tpl');
101 $o .= replace_macros($tpl,array(
102 '$url' => $rr['url'],
103 '$name' => $rr['name'],
104 '$photo' => $rr['photo'],
110 // $o .= paginate($a);