aboutsummaryrefslogtreecommitdiffstats
path: root/include/contact_widgets.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-09-19 17:35:57 -0700
committerzotlabs <mike@macgirvin.com>2017-09-19 17:35:57 -0700
commit72a19a14aff7a13a8c1fb10e773784643f68d234 (patch)
tree9423be2e752b9692a42235e87c0a83c47c69cada /include/contact_widgets.php
parentbced63e8237329ddaa6a5271589cbba50bd31448 (diff)
downloadvolse-hubzilla-72a19a14aff7a13a8c1fb10e773784643f68d234.tar.gz
volse-hubzilla-72a19a14aff7a13a8c1fb10e773784643f68d234.tar.bz2
volse-hubzilla-72a19a14aff7a13a8c1fb10e773784643f68d234.zip
turn common friends into a widget
Diffstat (limited to 'include/contact_widgets.php')
-rw-r--r--include/contact_widgets.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index aac756a46..e5bb696f8 100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -143,7 +143,7 @@ function cardcategories_widget($baseurl,$selected = '') {
-function common_friends_visitor_widget($profile_uid) {
+function common_friends_visitor_widget($profile_uid,$cnt = 10) {
if(local_channel() == $profile_uid)
return;
@@ -156,19 +156,20 @@ function common_friends_visitor_widget($profile_uid) {
require_once('include/socgraph.php');
$t = count_common_friends($profile_uid,$observer_hash);
+
if(! $t)
return;
- $r = common_friends($profile_uid,$observer_hash,0,5,true);
+ $r = common_friends($profile_uid,$observer_hash,0,$cnt,true);
return replace_macros(get_markup_template('remote_friends_common.tpl'), array(
- '$desc' => sprintf( tt("%d connection in common", "%d connections in common", $t), $t),
- '$base' => z_root(),
- '$uid' => $profile_uid,
- '$cid' => $observer,
- '$linkmore' => (($t > 5) ? 'true' : ''),
- '$more' => t('show more'),
- '$items' => $r
+ '$desc' => sprintf( t('Common connections: %d'), $t),
+ '$base' => z_root(),
+ '$uid' => $profile_uid,
+ '$cid' => $observer,
+ '$linkmore' => (($t > $cnt) ? 'true' : ''),
+ '$more' => t('show more'),
+ '$items' => $r
));
};