MyBB Community Forums
[How To?] Select forums that the current user can access - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [How To?] Select forums that the current user can access (/thread-213254.html)



Select forums that the current user can access - Mark T. - 2017-09-30

How would I make my SQL query only take the forums that the currently authenticated user can see?

SELECT * FROM mybb_forums

Thanks in advanceĀ  Cool


RE: Select forums that the current user can access - Nasyr - 2017-09-30

Hello,

Can you explain more about what you want to do? If you've set permissions per group in the ACP to access specific forums why do you need to run an SQL Query?


RE: Select forums that the current user can access - Mark T. - 2017-10-02

What I am trying to do is actually to remake the "latest threads" section of the site to only show latest threads from forum sections that they have access to. By default, I can only make some specific forums be excluded.


RE: Select forums that the current user can access - Nasyr - 2017-10-02

MyBB operations work on the basis that when a member clicks new posts/today's posts they only see threads from sections they have permissions to view. In other words, if you have a 'Staff' forum, normal users will not see the threads when searching if they cannot view the forum directly. The built-in permissions should support what you are trying to do without the need of plugins or queries.


RE: Select forums that the current user can access - Mark T. - 2017-10-02

But the theme I have bought does have a custom section showing "latest threads" that does not support this.
And the creator of the theme does not really do any support.


RE: Select forums that the current user can access - Nasyr - 2017-10-05

There is a plugin that it probably uses - https://community.mybb.com/mods.php?action=view&pid=191


RE: Select forums that the current user can access - Mark T. - 2017-10-06

It seems like another one, since my one has a "latests_threads.php" file in the root.
However I will look into that one, maybe it can help.
Thanks.