From 33e406d7fc74c1701ed4bb1d2a2b2a1bb330683f Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 17 Feb 2015 18:13:20 -0800 Subject: make tag clouds honour the full permissions repertoire, not just yes/no public/private, but who are you and what tags can you see --- include/taxonomy.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/taxonomy.php b/include/taxonomy.php index be80008df..d36c05db2 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -98,7 +98,12 @@ function format_term_for_display($term) { function tagadelic($uid, $count = 0, $authors = '', $flags = 0, $restrict = 0, $type = TERM_HASHTAG) { - $sql_options = ''; + require_once('include/security.php'); + + if(! perm_is_allowed($uid,get_observer_hash(),'view_stream')) + return array(); + + $sql_options = item_permissions_sql($uid); $count = intval($count); if($flags) @@ -114,7 +119,7 @@ function tagadelic($uid, $count = 0, $authors = '', $flags = 0, $restrict = 0, $ // 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 = %d and item_private = 0 + and otype = %d and item_restrict = %d $sql_options group by term order by total desc %s", intval($uid), -- cgit v1.2.3