Auto Subscribe to forum

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Scam Warning
ZillaConsulting
Registered User
Posts: 2
Joined: Fri Nov 30, 2012 6:26 am

Re: Auto Subscribe to forum

Post by ZillaConsulting » Thu Jul 11, 2013 11:02 am

ZillaConsulting wrote: This answer partly meets my needs going forwards, but what would meet my needs completely is the ability to include multiple insert statements in the trigger as I would like to autosubscribe new users to multiple forums. Any suggestions on the syntax to use to achieve this?
I managed to get this right by changing the syntaxt I am using on the trigger. I am now using the following to acheive my goal:

Code: Select all

INSERT INTO phpbb_forums_watch 
 VALUES 
 (2, NEW.user_id, 0),
 (21, NEW.user_id, 0)

User avatar
Gioweb
Registered User
Posts: 10
Joined: Fri Oct 16, 2009 9:47 am

Re: Auto Subscribe to forum

Post by Gioweb » Mon Nov 02, 2015 11:22 am

I use this SQL to subscribe all members in all Forums:

Code: Select all

INSERT INTO phpbb_forums_watch
SELECT distinct f.forum_id, u.user_id, 0
FROM phpbb_forums f, phpbb_users u
WHERE not exists (SELECT 1 from phpbb_forums_watch
   WHERE forum_id = f.forum_id
   AND user_id = u.user_id) AND u.user_type<>2
To not send too many emails, I have 1500 users, if you wanted to limit the auto registration to those who have written more than 200 posts as I do? thanks :)
Gioweb

Locked

Return to “[3.0.x] MOD Requests”

Who is online

Users browsing this forum: No registered users and 12 guests