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'] .= '<div class="vcard">'
32 . '<div class="fn label">' . $c[0]['name'] . '</div>'
33 . '<div id="profile-photo-wrapper">'
34 . '<img class="photo" width="175" height="175"
35 src="' . $c[0]['photo'] . '" alt="' . $c[0]['name'] . '" /></div>'
42 $o .= '<h2>' . t('Common Friends') . '</h2>';
47 $r = q("select id from contact where nurl = '%s' and uid = %d limit 1",
48 dbesc(normalise_link(get_my_url())),
54 $r = q("select id from gcontact where nurl = '%s' limit 1",
55 dbesc(normalise_link(get_my_url()))
65 if($cid == 0 && $zcid == 0)
70 $t = count_common_friends($uid,$cid);
72 $t = count_common_friends_zcid($uid,$zcid);
75 $a->set_pager_total($t);
78 notice( t('No contacts in common.') . EOL);
84 $r = common_friends($uid,$cid);
86 $r = common_friends_zcid($uid,$zcid);
93 $tpl = get_markup_template('common_friends.tpl');
97 $o .= replace_macros($tpl,array(
99 '$name' => $rr['name'],
100 '$photo' => $rr['photo'],
106 // $o .= paginate($a);