aboutsummaryrefslogtreecommitdiffstats
path: root/include/contact_widgets.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-05-02 00:44:37 -0700
committerfriendica <info@friendica.com>2012-05-02 00:44:37 -0700
commita42a475e100af70a9a7b95edc061f1a13e216dcf (patch)
tree398b30120a3d8f2836b2a175b954c7cb25812f1b /include/contact_widgets.php
parent1b1f56f55625f26d7bc2a5079d385d1c319e2d9a (diff)
downloadvolse-hubzilla-a42a475e100af70a9a7b95edc061f1a13e216dcf.tar.gz
volse-hubzilla-a42a475e100af70a9a7b95edc061f1a13e216dcf.tar.bz2
volse-hubzilla-a42a475e100af70a9a7b95edc061f1a13e216dcf.zip
shuffle results of remote_common_friends widget
Diffstat (limited to 'include/contact_widgets.php')
-rw-r--r--include/contact_widgets.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index cfe27c5c9..e0fe4271a 100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -146,11 +146,18 @@ 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",
+ $r = q("select id from contact where nurl = '%s' and uid = %d limit 1",
dbesc(normalise_link(get_my_url()))
);
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'];
+ }
}
}
@@ -167,9 +174,9 @@ function common_friends_visitor_widget($profile_uid) {
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),