aboutsummaryrefslogtreecommitdiffstats
path: root/include/contact_widgets.php
diff options
context:
space:
mode:
authorzottel <github@zottel.net>2012-05-03 10:21:38 +0200
committerzottel <github@zottel.net>2012-05-03 10:21:38 +0200
commit35771a778df18afb231969c242680a6353e5ef8e (patch)
tree2f1d6384b3f68c360861715e12dcf59a48145411 /include/contact_widgets.php
parent6000e7f30d1193dada903eaf0e6f44149a3dde33 (diff)
parentd72db2e1aa68833cbebc1c24ab4e1c6c9c966679 (diff)
downloadvolse-hubzilla-35771a778df18afb231969c242680a6353e5ef8e.tar.gz
volse-hubzilla-35771a778df18afb231969c242680a6353e5ef8e.tar.bz2
volse-hubzilla-35771a778df18afb231969c242680a6353e5ef8e.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/contact_widgets.php')
-rw-r--r--include/contact_widgets.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index cfe27c5c9..bf3a86958 100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -146,11 +146,19 @@ function common_friends_visitor_widget($profile_uid) {
$cid = local_user();
else {
if(get_my_url()) {
- $r = q("select id from gcontact where nurl = '%s' limit 1",
- dbesc(normalise_link(get_my_url()))
+ $r = q("select id from contact where nurl = '%s' and uid = %d limit 1",
+ dbesc(normalise_link(get_my_url())),
+ intval($profile_uid)
);
if(count($r))
- $zcid = $r[0]['id'];
+ $cid = $r[0]['id'];
+ else {
+ $r = q("select id from gcontact where nurl = '%s' limit 1",
+ dbesc(normalise_link(get_my_url()))
+ );
+ if(count($r))
+ $zcid = $r[0]['id'];
+ }
}
}
@@ -162,14 +170,14 @@ function common_friends_visitor_widget($profile_uid) {
if($cid)
$t = count_common_friends($profile_uid,$cid);
else
- $t = count_common_friends($profile_uid,$cid);
+ $t = count_common_friends_zcid($profile_uid,$zcid);
if(! $t)
return;
if($cid)
- $r = common_friends($profile_uid,$cid,5);
+ $r = common_friends($profile_uid,$cid,5,true);
else
- $r = common_friends_zcid($profile_uid,$zcid);
+ $r = common_friends_zcid($profile_uid,$zcid,5,true);
return replace_macros(get_markup_template('remote_friends_common.tpl'), array(
'$desc' => sprintf( tt("%d friend in common", "%d friends in common", $t), $t),