Since this is my first post, I am going to do a short introduction. I am fairly new to phpBB3 development and have more than 7 years of PHP development experience.
I have just deployed a production phpBB3 and my customer is asking for a feature which meet these requirements:
- Notify all users who have permission to read in a forum when a new topic is posted in a forum
I have setup the forum this way:
- I have assigned 2 groups for each forum, one group for Standard Access and another for Moderator. Example, FORUM1_MEMBER, FORUM1_MODERATOR, FORUM2_MEMBER and FORUM2_MODERATOR
- I then set the permission of FORUM1 to include FORUM1_MEMBER (Standard Access) and FORUM1_MODERATOR (Standard Access)
- I create users and place them into the respective groups so they can read or moderate the respective forum they belong to.
The objective of the forum is to eliminate email conversation of case studies (topics) between group members and at the same time, log these messages so all member of the group is able to read the conversation in topic. I would say it works more like a mailing list with feature of a forum.
I have read a few articles on the hook system and creating modules. I am still quite lost if I should approach the problem with hook or module. I am looking at two possibilities I can do:
- If a new user is added to a group, I will iterate through all forums. If this group have permission to the forum, I will subscribe this user to the forum. (Problem is, if the group is removed from the forum, the user is still subscribed unless I customize the code again to remove all users in this group from the subscription of the forum). This is rather tedious as more coding is required.
- Another way which I feel is rather straightforward which doesn't require much coding, is to customize the code if a new topic is posted. If a topic is posted, find the parent forum and iterate through the groups to get all users and send notification to them.
Please advise if I should be working on hook system or a module. I have tried using hook but I am not quite sure how do I start. I really appreciate if someone here can guide me to the right way so I can hit off.
I got to stumble that posting a new topic falls under submit_post() function but quite unsure on how do I override it and at the same time not breaking the core code.
Thank you in advance.