aboutsummaryrefslogtreecommitdiffstats
path: root/include/widgets.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-10-27 16:30:55 -0700
committerfriendica <info@friendica.com>2013-10-27 16:30:55 -0700
commite2988a025388c5ea023a9e3d42b7cc40fa93f780 (patch)
tree1397b253a8ae9e15c4c5d3743183e6b494635bef /include/widgets.php
parent91d99213bd74e19d867e99d3dfe82a1a572d49f3 (diff)
downloadvolse-hubzilla-e2988a025388c5ea023a9e3d42b7cc40fa93f780.tar.gz
volse-hubzilla-e2988a025388c5ea023a9e3d42b7cc40fa93f780.tar.bz2
volse-hubzilla-e2988a025388c5ea023a9e3d42b7cc40fa93f780.zip
put comanche widgets in their own file. Added a category tagcloud widget - but the entries aren't going to link to anything until we have a webpage search ability. But this will be a way to exercise and test widget arguments.
Diffstat (limited to 'include/widgets.php')
-rw-r--r--include/widgets.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/widgets.php b/include/widgets.php
new file mode 100644
index 000000000..87941f40f
--- /dev/null
+++ b/include/widgets.php
@@ -0,0 +1,34 @@
+<?php /** @file */
+
+
+function widget_profile($args) {
+ $a = get_app();
+ $block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
+ return profile_sidebar($a->profile, $block, true);
+}
+
+// FIXME The problem with the next widget is that we don't have a search function for webpages that we can send the links to.
+// Then we should also provide an option to search webpages and conversations.
+
+function widget_tagcloud($args) {
+
+ $o = '';
+ $tab = 0;
+ $a = get_app();
+ $uid = $a->profile_uid;
+ $count = ((x($args,'count')) ? intval($args['count']) : 24);
+ $flags = 0;
+ $type = TERM_CATEGORY;
+
+ $r = tagadelic($uid,$count,$authors,$flags,ITEM_WEBPAGE,$type);
+
+ if($r) {
+ $o = '<div class="tagblock widget"><h3>' . t('Categories') . '</h3><div class="tags" align="center">';
+ foreach($r as $rr) {
+ $o .= '<span class="tag'.$rr[2].'">'.$rr[0].'</span> ' . "\r\n";
+ }
+ $o .= '</div></div>';
+ }
+ return $o;
+}
+