markus_petrux wrote: Good catch, btw.
.
Code: Select all
$sql = "SELECT u.user_id, u.user_email, u.user_lang, u.username, f.forum_name
FROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u, " . FORUMS_TABLE . " f
WHERE tw.topic_id = $topic_id
AND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . ")
AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . "
AND f.forum_id = $forum_id
AND u.user_id = tw.user_id";
Code: Select all
// start mod prevent_reply_notification_emails_from_being_emailed_to_unauthorized_users...replaced the original
// $sql definition with the one that appears below
$sql = "SELECT DISTINCT u.user_id, u.user_email, u.user_lang, u.username, f.forum_name
FROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u, " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . FORUMS_TABLE . " f
WHERE tw.topic_id = $topic_id
AND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . ")
AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . "
AND u.user_id = tw.user_id
AND f.forum_id = $forum_id
AND u.user_active = 1
AND
(
(
ug.user_id = tw.user_id
AND aa.group_id = ug.group_id
AND aa.forum_id = f.forum_id
AND aa.auth_read = 1
)
OR f.auth_read <= " . AUTH_REG . "
OR (u.user_level = " . MOD . " AND f.auth_read = " . AUTH_MOD . ")
OR (u.user_level = " . ADMIN . " AND f.auth_read = " . AUTH_ADMIN . ")
)";
// end mod prevent_reply_notification_emails_from_being_emailed_to_unauthorized_users
Code: Select all
$sql = "SELECT u.user_id, u.user_email, u.user_lang, f.forum_name
FROM " . USERS_TABLE . " u, " . FORUMS_WATCH_TABLE . " fw, " . FORUMS_TABLE . " f
WHERE fw.forum_id = $forum_id
AND fw.user_id NOT IN (" . $already_mailed . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . " )
AND f.forum_id = $forum_id
AND f.forum_notify = '1'
AND u.user_id = fw.user_id";
Code: Select all
// start mod prevent_reply_notification_emails_from_being_emailed_to_unauthorized_users...replaced the original
// $sql definition with the one that appears below
$sql = "SELECT DISTINCT u.user_id, u.user_email, u.user_lang, f.forum_name
FROM " . FORUMS_WATCH_TABLE . " fw, " . USERS_TABLE . " u, " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . FORUMS_TABLE . " f
WHERE fw.forum_id = $forum_id
AND fw.user_id NOT IN (" . $already_mailed . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . ")
AND f.forum_notify = '1'
AND u.user_id = fw.user_id
AND f.forum_id = $forum_id
AND u.user_active = 1
AND
(
(
ug.user_id = fw.user_id
AND aa.group_id = ug.group_id
AND aa.forum_id = f.forum_id
AND aa.auth_read = 1
)
OR f.auth_read <= " . AUTH_REG . "
OR (u.user_level = " . MOD . " AND f.auth_read = " . AUTH_MOD . ")
OR (u.user_level = " . ADMIN . " AND f.auth_read = " . AUTH_ADMIN . ")
)";
// end mod prevent_reply_notification_emails_from_being_emailed_to_unauthorized_users
ymmotrojam wrote: hmm... could this mod possibly be modified to also stop sending replies to a person if they haven't looked a thread in a certain amount of time?