[CDB] [forum permission] Allow viewing topics started by others

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
brunoais
Registered User
Posts: 443
Joined: Wed Jun 18, 2008 10:50 am

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by brunoais »

canonknipser wrote: Thu Mar 01, 2018 9:21 pm
brunoais wrote: Thu Mar 01, 2018 9:14 pm Does the extensions team allow that?
It's in the official tutorial: https://area51.phpbb.com/docs/dev/exten ... sions.html
I asked thinking about order but that's not what 3Di mentioned (ups).
Ty for that. I'll see if this extension is refused, if so, then, I'll solve whatever they complain and I'll use this if they include mentioning this.
3Di wrote: Thu Mar 01, 2018 9:28 pm
brunoais wrote: Thu Mar 01, 2018 9:14 pm
3Di wrote: Thu Mar 01, 2018 7:32 pm ^^ Why are you not using core.permissions event if I can ask? To set the right category where the new permission will be shown.
This? https://github.com/phpbb/phpbb/blob/mas ... ns.php#L66
Does the extensions team allow that?

In any case, I'd have to study in what situations that event is called. I also find it weird that original permissions' category is set in the DB and extension's categories have to be adjusted after loading from the DB.
Yes it' allowed, moreover it's suggested:
https://github.com/3D-I/HighlightPosts/ ... er.php#L33
https://github.com/3D-I/HighlightPosts/ ... #L354-L386

migration https://github.com/3D-I/HighlightPosts/ ... hp#L13-L35

language https://github.com/3D-I/HighlightPosts/ ... hp#L11-L26

usage https://github.com/3D-I/HighlightPosts/ ... hp#L76-L86
Thanks for the links. It will allow me to speed up the process.
3Di wrote: Thu Mar 01, 2018 9:28 pm And you can also copy native permissions into your new permission, see the guide:
https://area51.phpbb.com/docs/dev/3.2.x ... ssion.html
Had done in my submission:
https://github.com/brunoais/readOthersT ... elease.php
3Di wrote: Thu Mar 01, 2018 9:28 pm You'd need to rewrite your migration and get rid of all of those queries at a first glance.
Already.... kinda did.
https://github.com/brunoais/readOthersT ... elease.php
3Di wrote: Thu Mar 01, 2018 9:28 pm And, your extension will be pretty finished. :)
Great :D
Last edited by brunoais on Thu Mar 01, 2018 9:46 pm, edited 1 time in total.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by 3Di »

brunoais wrote: Thu Mar 01, 2018 9:39 pm
canonknipser wrote: Thu Mar 01, 2018 9:21 pm
brunoais wrote: Thu Mar 01, 2018 9:14 pm Does the extensions team allow that?
It's in the official tutorial: https://area51.phpbb.com/docs/dev/exten ... sions.html
I asked thinking about order but that's not what 3Di mentioned (ups).
Ty for that. I'll see if this extension is refused, if so, then, I'll solve whatever they complain and I'll use this if they include mentioning this.
It's about ordering
https://area51.phpbb.com/docs/dev/exten ... ermissions there is no way to inject into the right place (it's alphabetical so you have to play with names), just add to a category.

See my post above yours viewtopic.php?p=14951881#p14951881
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by 3Di »

To add:
you will be notified by the Team (99%) that playing with roles needs to check if those roles exist first, many admin delete native roles and is always a good practize to avoid bugs, we have seen a lot of complaints about this bit.

I for one I leave the game of roles to the end user: https://github.com/3D-I/HighlightPosts/ ... ermissions
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
brunoais
Registered User
Posts: 443
Joined: Wed Jun 18, 2008 10:50 am

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by brunoais »

Oh, found it.
https://github.com/brunoais/readOthersT ... er.php#L25
I just didn't search correctly in the code. This is what happens when I'm tired with work and sleepy and try to remember my own work.
3Di wrote: Thu Mar 01, 2018 9:41 pm
brunoais wrote: Thu Mar 01, 2018 9:39 pm
canonknipser wrote: Thu Mar 01, 2018 9:21 pm
brunoais wrote: Thu Mar 01, 2018 9:14 pm Does the extensions team allow that?
It's in the official tutorial: https://area51.phpbb.com/docs/dev/exten ... sions.html
I asked thinking about order but that's not what 3Di mentioned (ups).
Ty for that. I'll see if this extension is refused, if so, then, I'll solve whatever they complain and I'll use this if they include mentioning this.
It's about ordering
https://area51.phpbb.com/docs/dev/exten ... ermissions there is no way to inject into the right place (it's alphabetical so you have to play with names), just add to a category.

See my post above yours viewtopic.php?p=14951881#p14951881
It's not alphabetical. It's array-ordered. Change the order of the array and the permission changes placement too.
3Di wrote: Thu Mar 01, 2018 9:51 pm To add:
you will be notified by the Team (99%) that playing with roles needs to check if those roles exist first, many admin delete native roles and is always a good practize to avoid bugs, we have seen a lot of complaints about this bit.
If the role from which it is copied from disappears, the query does nothing (in the migration of v1.0.1).
davyg
Registered User
Posts: 6
Joined: Tue Apr 03, 2018 5:50 pm

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by davyg »

Hi,
would it require some structural changes to alter this mod so that users can see/read all posts, but only interact with their own?

"Generates a new permission which allows the user to see and interact with topics that he didn't start."
I would like some kind of "diary" subforum where a user can start a topic and add posts afterwards.
Anyone should be able to read the topics, but only the author can add replies (interact)

I have programming skills, but am not very familiar with phpbb mod development.
If you could point me in the right direction (which files / functions to change) that would be great.
Or if anyone knows any other mods which could achieve this on a 3.1 board?

Thanks in advance! :)
Davy
brunoais
Registered User
Posts: 443
Joined: Wed Jun 18, 2008 10:50 am

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by brunoais »

Yes. You can make such permission while using this as the base blueprint for your extension.
Fortunately, though, such extension would only have to listen itself to the events related to creating posts.
Unfortunately, though, you will have to attach to other events that are not here, so you can also turn off the whole elements used for topic reply (access to topic reply page, remove reply+quote buttons and remove quick reply).
I'll try to get you the list of stuff you can use from this extension in the next days so you can jump start your work but that is all I can really help you without doing your work for you ;)
davyg
Registered User
Posts: 6
Joined: Tue Apr 03, 2018 5:50 pm

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by davyg »

brunoais wrote: Wed Apr 04, 2018 9:32 pm I'll try to get you the list of stuff you can use from this extension in the next days so you can jump start your work but that is all I can really help you without doing your work for you ;)
Sure I know... Thanks for this info Brunoais. Appreciate it!
User avatar
yasser33311
Registered User
Posts: 277
Joined: Sat Jul 27, 2013 1:27 pm
Location: algeria
Name: yasser ghe
Contact:

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by yasser33311 »

not work with phpbb3.2.2
blank page
PhpBB Services - install, update, upgrade, customize: PM
brunoais
Registered User
Posts: 443
Joined: Wed Jun 18, 2008 10:50 am

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by brunoais »

Anything reported in the logs?
niftysmith
Registered User
Posts: 27
Joined: Wed Mar 28, 2018 3:24 pm

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by niftysmith »

Alright, so I've installed this extension.

Could I get a walk through on how to set up a Forum and User/Group Permissions so that this works properly? I don't see any instruction, and I'd like to set up a Moderator Ticket Forum where my users can post their "request" and only the OP user and moderators can see it, but other users cannot. Can I get a step by step on how to do this as I'll admit I'm relatively new to phpBB as a web designer.

Much appreciated!
brunoais
Registered User
Posts: 443
Joined: Wed Jun 18, 2008 10:50 am

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by brunoais »

niftysmith wrote: Wed Apr 11, 2018 5:57 pm Alright, so I've installed this extension.

Could I get a walk through on how to set up a Forum and User/Group Permissions so that this works properly? I don't see any instruction, and I'd like to set up a Moderator Ticket Forum where my users can post their "request" and only the OP user and moderators can see it, but other users cannot. Can I get a step by step on how to do this as I'll admit I'm relatively new to phpBB as a web designer.

Much appreciated!
All you have to do is to set to "no" the permission "Can read topics started by others", in those forums, to the normal users group (and dependents on those, including the not logged in user group and the newly created user group)
yukizzz
Registered User
Posts: 2
Joined: Sun Apr 15, 2018 7:56 pm

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by yukizzz »

Hello,

Just tried installing this extension on phpbb 3.2.2 - made the forum return a 500.

Here's the error I could find in the logs:
[15-Apr-2018 20:44:18 Europe/London] PHP Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /home/***/public_html/forum/ext/brunoais/readOthersTopics/event/main_listener.php on line 334

Hope that helps,
Cheers
Laurent
brunoais
Registered User
Posts: 443
Joined: Wed Jun 18, 2008 10:50 am

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by brunoais »

davyg wrote: Tue Apr 03, 2018 6:00 pm Hi,
would it require some structural changes to alter this mod so that users can see/read all posts, but only interact with their own?

"Generates a new permission which allows the user to see and interact with topics that he didn't start."
I would like some kind of "diary" subforum where a user can start a topic and add posts afterwards.
Anyone should be able to read the topics, but only the author can add replies (interact)

I have programming skills, but am not very familiar with phpbb mod development.
If you could point me in the right direction (which files / functions to change) that would be great.
Or if anyone knows any other mods which could achieve this on a 3.1 board?

Thanks in advance! :)
Davy
I got your answer.
Checkout these files:
  • event/language_listener.php
  • event/mcp_listener.php
  • event/main_listener.php functions:
    • phpbb_modify_posting_auth
    • phpbb_viewtopic_before_f_read_check
  • language/*
  • migrations/* [In the phpBB's delivery branch]
  • shared/* [all of it is useful]
Those can work as your starting point as for the information you can use from my extension. Sorry for the delay but life was super busy for me.
brunoais
Registered User
Posts: 443
Joined: Wed Jun 18, 2008 10:50 am

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by brunoais »

This extension was denied again.

IMO, there were some acceptable reasons for its denial but, in my opinion, most of them didn't have enough reason.
they also complained about things they had ignored me previously!!!! FFS!!!!!!!!!!!!!!!!!!!!!!
I'm now discussing on the things I disagree. I'll give an update when able.
davyg
Registered User
Posts: 6
Joined: Tue Apr 03, 2018 5:50 pm

Re: [BETA] [forum permission] Allow viewing topics started by others

Post by davyg »

brunoais wrote: Thu Apr 19, 2018 8:40 am I got your answer.
Checkout these files...
Thanks for the help. Appreciate it :)
Locked

Return to “Extensions in Development”