X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fcontact_widgets.php;h=ea71b3b707b35b5a2fe3c3d5c976eb6be15ace63;hb=2940f25df94afb0c75a8181f15878417fa5cdc21;hp=42d3afdee7cd375e6f9e546a0349595d9533dd13;hpb=5830c32dceb2429656ee4957690dd78c24641f02;p=friendica.git diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 42d3afdee7..ea71b3b707 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -142,9 +142,16 @@ function common_friends_visitor_widget($profile_uid) { $cid = $zcid = 0; - if(can_write_wall($a,$profile_uid)) - $cid = remote_user(); - else { + if(is_array($_SESSION['remote'])) { + foreach($_SESSION['remote'] as $visitor) { + if($visitor['uid'] == $profile_uid) { + $cid = $visitor['cid']; + break; + } + } + } + + if(! $cid) { if(get_my_url()) { $r = q("select id from contact where nurl = '%s' and uid = %d limit 1", dbesc(normalise_link(get_my_url())), @@ -183,7 +190,8 @@ function common_friends_visitor_widget($profile_uid) { '$desc' => sprintf( tt("%d contact in common", "%d contacts in common", $t), $t), '$base' => $a->get_baseurl(), '$uid' => $profile_uid, - '$cid' => $cid, + '$cid' => (($cid) ? $cid : '0'), + '$linkmore' => (($t > 5) ? 'true' : ''), '$more' => t('show more'), '$items' => $r ));