X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpublictagcloud.php;fp=actions%2Fpublictagcloud.php;h=8daf18d5042bd8b4dbe2653f6b3a8edb7f551b00;hb=c6f89b21748948fde902904f6ac9ce9afa026b84;hp=6d0d4237e9d74ce1788863f43eeb9ed14603d96c;hpb=597a3c89edd7200ab069f0e43c4f63406ca3d7f9;p=quix0rs-gnu-social.git diff --git a/actions/publictagcloud.php b/actions/publictagcloud.php index 6d0d4237e9..8daf18d504 100644 --- a/actions/publictagcloud.php +++ b/actions/publictagcloud.php @@ -110,6 +110,8 @@ class PublictagcloudAction extends Action */ $tags->selectAdd(); $tags->selectAdd('tag'); + $tags->selectAdd('notice_id'); + $tags->selectAdd('scope'); // Add the aggregated columns... $tags->selectAdd('max(notice_id) as last_notice_id'); @@ -117,6 +119,7 @@ class PublictagcloudAction extends Action $cutoff = sprintf("notice_tag.created > '%s'", common_sql_date(time() - common_config('tag', 'cutoff'))); $tags->selectAdd($calc . ' as weight'); + $tags->joinAdd(array('notice_id', 'notice:id')); $tags->whereAdd($cutoff); $tags->groupBy('tag'); $tags->orderBy('weight DESC'); @@ -132,8 +135,11 @@ class PublictagcloudAction extends Action $tw = array(); $sum = 0; while ($tags->fetch()) { - $tw[$tags->tag] = $tags->weight; - $sum += $tags->weight; + // Check scope: + if ($tags->isCurrentProfileInScope()) { + $tw[$tags->tag] = $tags->weight; + $sum += $tags->weight; + } } ksort($tw);