diff options
author | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-11-12 02:09:32 -0800 |
---|---|---|
committer | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-11-12 02:09:32 -0800 |
commit | 67a101452b82782114143dc0b5bdba15adc0ba99 (patch) | |
tree | 9daee3807b370d02ee4c28e6df7db08731fbb9f1 /include/taxonomy.php | |
parent | b23f3fc03b6bc751aab67fe2258a21f7c65bab8e (diff) | |
parent | 7cb4c2f8ad813336aafdec05e40f3a8eb1808d00 (diff) | |
download | volse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.tar.gz volse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.tar.bz2 volse-hubzilla-67a101452b82782114143dc0b5bdba15adc0ba99.zip |
Merge pull request #4 from friendica/master
Fork aligned to red master
Diffstat (limited to 'include/taxonomy.php')
-rw-r--r-- | include/taxonomy.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/taxonomy.php b/include/taxonomy.php index 85396a51d..5159dad02 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -96,13 +96,14 @@ function format_term_for_display($term) { // Tag cloud functions - need to be adpated to this database format -function tagadelic($uid, $count = 0, $authors = '', $flags = 0, $type = TERM_HASHTAG) { +function tagadelic($uid, $count = 0, $authors = '', $flags = 0, $restrict = 0, $type = TERM_HASHTAG) { $sql_options = ''; $count = intval($count); if($flags) $sql_options .= " and ((item_flags & " . intval($flags) . ") = " . intval($flags) . ") "; + if($authors) { if(! is_array($authors)) $authors = array($authors); @@ -113,12 +114,13 @@ function tagadelic($uid, $count = 0, $authors = '', $flags = 0, $type = TERM_HAS // Fetch tags $r = q("select term, count(term) as total from term left join item on term.oid = item.id where term.uid = %d and term.type = %d - and otype = %d and item_restrict = 0 and item_private = 0 + and otype = %d and item_restrict = %d and item_private = 0 $sql_options group by term order by total desc %s", intval($uid), intval($type), intval(TERM_OBJ_POST), + intval($restrict), ((intval($count)) ? "limit $count" : '') ); @@ -199,10 +201,10 @@ function dir_tagadelic($count = 0) { } -function tagblock($link,$uid,$count = 0,$authors = '',$flags = 0,$type = TERM_HASHTAG) { +function tagblock($link,$uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$type = TERM_HASHTAG) { $o = ''; $tab = 0; - $r = tagadelic($uid,$count,$authors,$flags,$type); + $r = tagadelic($uid,$count,$authors,$flags,$restrict,$type); if($r) { $o = '<div class="tagblock widget"><h3>' . t('Tags') . '</h3><div class="tags" align="center">'; |