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

anexity

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

Post 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
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

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

Post 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.
anexity

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

Post by anexity »

That sounds great, thank you very much! :)
anexity
Posts: 3
Joined: Sat Jun 24, 2017 9:56 am
Location: Austria

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

Post 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! :)
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

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

Post 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
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

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

Post 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.
Post Reply