+ $tags[] = trim(mb_strtolower($term['term']), '#');
+ }
+ DBA::close($termsStmt);
+
+ $condition = $user_condition;
+ $condition[0] = "SELECT `include-tags` FROM `channel` INNER JOIN `user` ON `channel`.`uid` = `user`.`uid` WHERE " . $user_condition[0];
+ $sql = array_shift($condition);
+ $channels = DBA::p($sql, $condition);
+ while ($channel = DBA::fetch($channels)) {
+ foreach (explode(',', $channel['include-tags']) as $tag) {
+ $tag = trim(mb_strtolower($tag));
+ if (empty($tag)) {
+ continue;
+ }
+ if (!in_array($tag, $tags)) {
+ $tags[] = $tag;
+ }
+ }