Notify all phpBB users at new post
Monday, February 9, 2009 at 9:00AM
Captain Rtfb in Tips and Tricks, phpbb

Last weekend I made a little hack for the phpBB software. Now every time a user makes a new post to our phpBB-forum, ALL users are notified by email. Since we have a closed board, there a only a few users and a few comments a day.

Instructions:
- Locate the file includes/functions_posting.php
- Find this code in the file:

// -- get forum_userids || topic_userids
$sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber
FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u
WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . "
AND w.user_id NOT IN ($sql_ignore_users)
AND w.notify_status = 0
AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')
AND u.user_id = w.user_id';
$result = $db->sql_query($sql);


- Replace the above code with:

// -- get forum_userids || topic_userids
$sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber
FROM ' . USERS_TABLE . " u
WHERE u.user_id NOT IN ($sql_ignore_users)
AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
$result = $db->sql_query($sql);


Now all your users are notified by email!

Article originally appeared on dutchtechies (http://dutchtechies.com/).
See website for complete article licensing information.