diff options
author | friendica <info@friendica.com> | 2014-02-27 17:07:11 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-02-27 17:07:11 -0800 |
commit | 642da17b86cce8f6455a68d2d863a288d3c125c8 (patch) | |
tree | 4c5b55da0c27aba069bbab5971139bb9ba76c9f1 /include/widgets.php | |
parent | 402d44e2f4a7db97236d1999076ef57b69cec4b9 (diff) | |
download | volse-hubzilla-642da17b86cce8f6455a68d2d863a288d3c125c8.tar.gz volse-hubzilla-642da17b86cce8f6455a68d2d863a288d3c125c8.tar.bz2 volse-hubzilla-642da17b86cce8f6455a68d2d863a288d3c125c8.zip |
chatroom suggestions
Diffstat (limited to 'include/widgets.php')
-rw-r--r-- | include/widgets.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/widgets.php b/include/widgets.php index 4a5ae9de7..eb4565641 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -589,3 +589,39 @@ function widget_chatroom_list($arr) { )); } +function widget_bookmarkedchats($arr) { + $h = get_observer_hash(); + if(! $h) + return; + $r = q("select * from xchat where xchat_xchan = '%s' group by xchat_url order by xchat_desc", + dbesc($h) + ); + + for($x = 0; $x < count($r); $x ++) + $r[$x]['xchat_url'] = zid($r[$x]['xchat_url']); + return replace_macros(get_markup_template('bookmarkedchats.tpl'),array( + '$header' => t('Bookmarked Chatrooms'), + '$rooms' => $r + )); +} + +function widget_suggestedchats($arr) { + + // probably should restrict this to your friends, but then the widget will only work + // if you are logged in locally. + + $h = get_observer_hash(); + if(! $h) + return; + $r = q("select *, count(xchat_url) as total from xchat group by xchat_url order by total desc, xchat_desc", + dbesc($h) + ); + + for($x = 0; $x < count($r); $x ++) + $r[$x]['xchat_url'] = zid($r[$x]['xchat_url']); + return replace_macros(get_markup_template('bookmarkedchats.tpl'),array( + '$header' => t('Suggested Chatrooms'), + '$rooms' => $r + )); +} + |