aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-11-06 01:24:04 -0800
committerfriendica <info@friendica.com>2014-11-06 01:24:04 -0800
commit4057e82bb46e7f30e8bccfb076be85ac9f91f256 (patch)
tree8b289d50dcb1e9e42d18443c1aa97505a375a604 /include
parent1237957dd54b47685269300ca128455463e0787c (diff)
downloadvolse-hubzilla-4057e82bb46e7f30e8bccfb076be85ac9f91f256.tar.gz
volse-hubzilla-4057e82bb46e7f30e8bccfb076be85ac9f91f256.tar.bz2
volse-hubzilla-4057e82bb46e7f30e8bccfb076be85ac9f91f256.zip
category tagblock
Diffstat (limited to 'include')
-rw-r--r--include/taxonomy.php22
-rw-r--r--include/widgets.php11
2 files changed, 33 insertions, 0 deletions
diff --git a/include/taxonomy.php b/include/taxonomy.php
index 35605da22..d683b24a6 100644
--- a/include/taxonomy.php
+++ b/include/taxonomy.php
@@ -216,6 +216,28 @@ function tagblock($link,$uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$
return $o;
}
+function catblock($uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$type = TERM_CATEGORY) {
+ $o = '';
+ $tab = 0;
+
+ $r = tagadelic($uid,$count,$authors,$flags,$restrict,$type);
+
+ if($r) {
+ $c = q("select channel_address from channel where channel_id = %d limit 1",
+ intval($uid)
+ );
+
+ $o = '<div class="tagblock widget"><h3>' . t('Categories') . '</h3><div class="tags" align="center">';
+ foreach($r as $rr) {
+ $o .= '<a href="channel/' . $c[0]['channel_address']. '?f=&cat=' . urlencode($rr[0]).'" class="tag'.$rr[2].'">'.$rr[0].'</a> ' . "\r\n";
+ }
+ $o .= '</div></div>';
+ }
+ return $o;
+}
+
+
+
function dir_tagblock($link,$r) {
$o = '';
$tab = 0;
diff --git a/include/widgets.php b/include/widgets.php
index f678e40dd..dcad3eff6 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -400,6 +400,17 @@ function widget_tagcloud_wall($arr) {
return tagblock('search',$a->profile['profile_uid'],$limit,$a->profile['channel_hash'],ITEM_WALL);
return '';
}
+function widget_catcloud_wall($arr) {
+ $a = get_app();
+ if((! $a->profile['profile_uid']) || (! $a->profile['channel_hash']))
+ return '';
+ if(! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_stream'))
+ return '';
+
+ $limit = ((array_key_exists('limit',$arr)) ? intval($arr['limit']) : 50);
+ return catblock($a->profile['profile_uid'],$limit,$a->profile['channel_hash'],ITEM_WALL);
+ return '';
+}
function widget_affinity($arr) {