aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-10-16 11:43:21 +0000
committerMario <mario@mariovavti.com>2020-10-16 11:43:21 +0000
commitf0acb9f01e0e2e130121dff435dea4a29f460d8e (patch)
treeef86e87bdfb8e8e50cfeffd30caa0c966261f3ac /include/text.php
parentb6ca9b6020e2eae0b5389148ce45bc2f7a81f999 (diff)
downloadvolse-hubzilla-f0acb9f01e0e2e130121dff435dea4a29f460d8e.tar.gz
volse-hubzilla-f0acb9f01e0e2e130121dff435dea4a29f460d8e.tar.bz2
volse-hubzilla-f0acb9f01e0e2e130121dff435dea4a29f460d8e.zip
get_forum_channels(): fix an issue where we would not look for private forums in case we did not have any channels where tag_deliver is set
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/include/text.php b/include/text.php
index 0a54ddd2f..ec397910d 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3677,22 +3677,21 @@ function get_forum_channels($uid) {
intval($uid)
);
- if($x2) {
- $xf = ids_to_querystr($x2,'xchan',true);
+ $xf = ids_to_querystr($x2,'xchan',true);
+ $sql_extra = (($xf) ? ' and not xchan in (' . $xf . ')' : '');
- // private forums
- $x3 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'post_wall' and v = '1' and xchan in (" . $xc . ") and not xchan in (" . $xf . ") ",
- intval(local_channel())
- );
- if($x3) {
- $xf = ids_to_querystr(array_merge($x2,$x3),'xchan',true);
- }
+ // private forums
+ $x3 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'post_wall' and v = '1' and xchan in (" . $xc . ") $sql_extra ",
+ intval(local_channel())
+ );
+ if($x3) {
+ $xf = ids_to_querystr(array_merge($x2,$x3),'xchan',true);
}
}
- $sql_extra = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 ");
+ $sql_extra_1 = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 ");
- $r = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_addr, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 and abook_archived = 0 $sql_extra order by xchan_name",
+ $r = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_addr, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 and abook_archived = 0 $sql_extra_1 order by xchan_name",
intval($uid)
);