category tagblock

This commit is contained in:
friendica
2014-11-06 01:24:04 -08:00
parent 1237957dd5
commit 4057e82bb4
3 changed files with 34 additions and 1 deletions

View File

@@ -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;