diff options
author | friendica <info@friendica.com> | 2013-07-03 17:22:40 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-07-03 17:22:40 -0700 |
commit | 1af5ecf1af7111020d99a7f274e7fed2bbc663f1 (patch) | |
tree | fcf730e1382475998df01ee299b35b804995ec58 | |
parent | 42d5d515b25e1bf0068da6bbf4ffef2374f02617 (diff) | |
download | volse-hubzilla-1af5ecf1af7111020d99a7f274e7fed2bbc663f1.tar.gz volse-hubzilla-1af5ecf1af7111020d99a7f274e7fed2bbc663f1.tar.bz2 volse-hubzilla-1af5ecf1af7111020d99a7f274e7fed2bbc663f1.zip |
tag cloud tweaking - allow your own comments, disallow all private posts
-rw-r--r-- | include/taxonomy.php | 19 | ||||
-rw-r--r-- | mod/channel.php | 2 |
2 files changed, 15 insertions, 6 deletions
diff --git a/include/taxonomy.php b/include/taxonomy.php index e9cc0faf4..6b7987ba6 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -96,14 +96,23 @@ function format_term_for_display($term) { // Tag cloud functions - need to be adpated to this database format -function tagadelic($uid, $count = 0, $flags = 0, $type = TERM_HASHTAG) { +function tagadelic($uid, $count = 0, $authors = '', $flags = 0, $type = TERM_HASHTAG) { + + $sql_options = ''; if($flags) - $sql_options = " and ((item_flags & " . intval($flags) . ") = " . intval($flags) . ") "; + $sql_options .= " and ((item_flags & " . intval($flags) . ") = " . intval($flags) . ") "; + if($authors) { + if(! is_array($authors)) + $authors = array($authors); + stringify_array_elms($authors,true); + $sql_options .= " and author_xchan in (" . implode(',',$authors) . ") "; + } + // 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 otype = %d and item_restrict = 0 and item_private = 0 $sql_options group by term order by total desc %s", intval($uid), @@ -148,10 +157,10 @@ function tags_sort($a,$b) { } -function tagblock($link,$uid,$count = 0,$flags = 0,$type = TERM_HASHTAG) { +function tagblock($link,$uid,$count = 0,$authors = '',$flags = 0,$type = TERM_HASHTAG) { $o = ''; $tab = 0; - $r = tagadelic($uid,$count,$flags,$type); + $r = tagadelic($uid,$count,$authors,$flags,$type); if($r) { $o = '<div class="tagblock widget"><h3>' . t('Tags') . '</h3><div class="tags" align="center">'; diff --git a/mod/channel.php b/mod/channel.php index 5d4c7ce1b..c7b631c96 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -48,7 +48,7 @@ function channel_aside(&$a) { $a->set_widget('categories',categories_widget($a->get_baseurl(true) . '/channel/' . $a->profile['channel_address'],$cat)); } if(feature_enabled($a->profile['profile_uid'],'tagadelic')) - $a->set_widget('tagcloud',tagblock('search',$a->profile['profile_uid'],50,ITEM_WALL|ITEM_THREAD_TOP)); + $a->set_widget('tagcloud',tagblock('search',$a->profile['profile_uid'],50,$a->profile['channel_hash'],ITEM_WALL)); } |