Notification on new topic

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
jinjie
Registered User
Posts: 1
Joined: Thu Dec 08, 2011 5:03 am

Notification on new topic

Post by jinjie »

Dear all,

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.

The Problem
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.

User avatar
Oyabun1
Former Team Member
Posts: 20
Joined: Thu Mar 31, 2011 9:48 am

Re: Notification on new topic

Post by Oyabun1 »

Use the already available Board watch MOD. It uses the inbuilt phpBB permissions system, so users will not receive notifications for forums they do not have permissions to read.

Post Reply