From e2988a025388c5ea023a9e3d42b7cc40fa93f780 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 27 Oct 2013 16:30:55 -0700 Subject: 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. --- include/widgets.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 include/widgets.php (limited to 'include/widgets.php') 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 @@ +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 = '

' . t('Categories') . '

'; + foreach($r as $rr) { + $o .= ''.$rr[0].' ' . "\r\n"; + } + $o .= '
'; + } + return $o; +} + -- cgit v1.2.3