aboutsummaryrefslogtreecommitdiffstats
path: root/include/contact_widgets.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-12-06 21:40:01 -0800
committerfriendica <info@friendica.com>2013-12-06 21:40:01 -0800
commitf45b06ffa004c6e6920214b64efe18e3cfe2d667 (patch)
tree83f0e15dedc9381448d95b02ee5968def3969085 /include/contact_widgets.php
parent9354c33839359821111b57a2a3aea916819d9c4f (diff)
downloadvolse-hubzilla-f45b06ffa004c6e6920214b64efe18e3cfe2d667.tar.gz
volse-hubzilla-f45b06ffa004c6e6920214b64efe18e3cfe2d667.tar.bz2
volse-hubzilla-f45b06ffa004c6e6920214b64efe18e3cfe2d667.zip
suggestion widget
Diffstat (limited to 'include/contact_widgets.php')
-rw-r--r--include/contact_widgets.php43
1 files changed, 42 insertions, 1 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index af05f8c9f..a6e66eb17 100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -1,5 +1,6 @@
<?php /** @file */
+
function follow_widget() {
$a = get_app();
$uid =$a->channel['channel_id'];
@@ -149,4 +150,44 @@ function common_friends_visitor_widget($profile_uid) {
'$items' => $r
));
-}; \ No newline at end of file
+};
+
+
+function suggest_widget() {
+
+ require_once('include/socgraph.php');
+
+ $r = suggestion_query(local_user(),get_observer_hash(),0,2);
+
+ if(! $r) {
+ return;
+ }
+
+ $arr = array();
+
+ foreach($r as $rr) {
+
+ $connlnk = z_root() . '/follow/?url=' . $rr['xchan_addr'];
+
+ $arr[] = array(
+ 'url' => chanlink_url($rr['xchan_url']),
+ 'name' => $rr['xchan_name'],
+ 'photo' => $rr['xchan_photo_m'],
+ 'ignlnk' => z_root() . '/suggest?ignore=' . $rr['xchan_hash'],
+ 'conntxt' => t('Connect'),
+ 'connlnk' => $connlnk,
+ 'ignore' => t('Ignore/Hide')
+ );
+ }
+
+
+ $o = replace_macros(get_markup_template('suggest_widget.tpl'),array(
+ '$title' => t('Suggestions'),
+ '$more' => t('See more...'),
+ '$entries' => $arr
+ ));
+
+ return $o;
+
+}
+