Page 1 of 2

Last Topics Widget: Don't show posts from hidden forums

Posted: Mon Jun 12, 2017 10:41 am
by anexity
Hello!

First I want to thank you for your plugin and your hard work!

My question is:
I use the "Last topics"-Widget in the sidebar which shows the newest postings in the forum.
My problem is: in my phpBB board I have categories or forums which are hidden to most users which don't have the proper permissions to see or read/write in this forums. If new postings are made in these categories/forums, the users without the proper permissions can also see this topics in the "Last topics"-widget (when they click on the topic in the widget they get the message that they do not have proper permission, which is correct).
Is there a way that you can adapt the widget so that users can only see topics in the "Last topics"-widget which they have the proper permissions for?

Thanks,
anexity

Re: Last Topics Widget: Don't show posts from hidden forums

Posted: Mon Jun 12, 2017 7:31 pm
by axew3
Yes it is possible.
I'll check for the code as i can, it seem be a nice feature.
Explained:
It will cost a single query more, or better, a single query more added to the one existent that get posts list.
So having for the user already all needed values (group), it will be easy to check against and achieve the result.

Re: Last Topics Widget: Don't show posts from hidden forums

Posted: Tue Jun 13, 2017 6:47 pm
by anexity
That sounds great, thank you very much! :)

Re: Last Topics Widget: Don't show posts from hidden forums

Posted: Sat Jun 24, 2017 2:55 pm
by anexity
Hello Alessio!
Thank you very much for implementing this option to the new version 1.7.2
The "exclude forums via ID" option is a good idea and works great, nevertheless I have some troubles with the second option "Retrieve posts on Last Topics Widget based on phpBB user's permissions". Posts in a forum where a user has no permissions are still shown in the Last Topics widget:

Example:
  • I have a forum "xyz" with subforums
  • I manage the permissions for this forum "xyz" + subforum with groups
  • Every group has the permission "No Access", only Global moderators and Admins have the permission "Full Access"
Yet still I can see the posting in the Last Post Widget, even when I log out and are only online as a guest user (cache is also emptied).
I could exlude the whole forum via ID from the widget but then users with the right permissions could also not see the last posts in the widget.

Grazie mille! :)

Re: Last Topics Widget: Don't show posts from hidden forums

Posted: Sat Jun 24, 2017 5:15 pm
by axew3
Hi, or to better say ciao!!
Thank for report i'll check this as soon!
I'll reply here when updated ... mh i was pretty sure it was working ... :cry: ehehe

Re: Last Topics Widget: Don't show posts from hidden forums

Posted: Sat Jun 24, 2017 8:43 pm
by axew3
patched views/config.php and class.wp.w3all-phpbb.php to fix error on activating option "Retrieve posts on Last Topics Widget based on phpBB user's permissions"
please download plugin and replace files, or better, download distinct files
class.wp.w3all-phpbb.php and
views/config.php from here
https://plugins.trac.wordpress.org/brow ... tion/trunk
and replace these two files on respective plugin's folders. All should work fine now.