insert ignore into xf_forum_watch (node_id, user_id, notify_on, send_alert, send_email)
select 1, user_id, 'thread', 1, 0
from xf_user
where is_banned = 0;
node_id value in the select as required, the insert ignore means existing forum watches are preserved.Yes.Can I confirm that the node_id is the number after the period at the end of the url of the node?
insert ignore into xf_forum_watch (node_id, user_id, notify_on, send_alert, send_email)
select 92, user_id, 'thread', 1, 0
from xf_user
where is_banned = 0;
For the node_id of 92, this sql should do it (get alerts but not emails for new threads);

insert ignore into xf_forum_watch (node_id, user_id, notify_on, send_alert, send_email)
select 20, user_id, 'thread', 1, 1
from xf_user
where is_banned = 0;
Warning: #1062 Duplicate entry '5-20' for key 'PRIMARY'
INSERT INTO xf_forum_watch (node_id, user_id, notify_on, send_alert, send_email)
SELECT 20, user_id, 'thread', 1, 1
FROM xf_user
WHERE is_banned = 0
ON DUPLICATE KEY UPDATE send_alert=VALUES(send_alert), send_email=VALUES(send_email);
We use essential cookies to make this site work, and optional cookies to enhance your experience.