diff options
author | redmatrix <git@macgirvin.com> | 2016-07-19 22:57:23 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-07-19 22:57:23 -0700 |
commit | a3e5307b93ea524781abd885e26a5d6c8f5c4c54 (patch) | |
tree | 2ef9760d8cd31ddc4a610e8a6f59efab5de1cbe7 /include | |
parent | ae6256f95a45dce44672bdc2e832c5c5757e0f20 (diff) | |
download | volse-hubzilla-a3e5307b93ea524781abd885e26a5d6c8f5c4c54.tar.gz volse-hubzilla-a3e5307b93ea524781abd885e26a5d6c8f5c4c54.tar.bz2 volse-hubzilla-a3e5307b93ea524781abd885e26a5d6c8f5c4c54.zip |
fix the forum detection in include/zot
Diffstat (limited to 'include')
-rw-r--r-- | include/api.php | 3 | ||||
-rw-r--r-- | include/zot.php | 18 |
2 files changed, 16 insertions, 5 deletions
diff --git a/include/api.php b/include/api.php index df6aba957..8d475c5fa 100644 --- a/include/api.php +++ b/include/api.php @@ -282,7 +282,8 @@ require_once('include/api_auth.php'); intval($uinfo[0]['xchan_hash']) ); $countitms = $r[0]['count']; - $following = (($uinfo[0]['abook_myperms'] & PERMS_R_STREAM) ? true : false ); + + $following = ((get_abconfig($uinfo[0]['abook_channel'],$uinfo[0]['abook_xchan'],'my_perms','view_stream')) ? true : false ); } diff --git a/include/zot.php b/include/zot.php index dec3dc2bc..73d9ef950 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3782,11 +3782,21 @@ function zotinfo($arr) { } else { // check if it has characteristics of a public forum based on custom permissions. - $t = q("select abook_my_perms from abook where abook_channel = %d and abook_self = 1 limit 1", - intval($e['channel_id']) + $t = q("select * from abconfig where abconfig.cat = 'my_perms' and abconfig.chan = %d and abconfig.xchan = '%s' and abconfig.k in ('tag_deliver', 'send_stream') ", + intval($e['channel_id']), + intval($e['channel_hash']) ); - if(($t) && (($t[0]['abook_my_perms'] & PERMS_W_TAGWALL) && (! ($t[0]['abook_my_perms'] & PERMS_W_STREAM)))) - $public_forum = true; + $ch = 0; + if($t) { + foreach($t as $tt) { + if($tt['k'] == 'tag_deliver' && $tt['v'] == 1) + $ch ++; + if($tt['k'] == 'send_stream' && $tt['v'] == 0) + $ch ++; + } + if($ch == 2) + $public_forum = true; + } } |