Code: Select all
// send email to board contact address?
if ($n2m_MAILTO_BOARDCONTACT) $n2m_MAILTO[] = $config[board_contact];
Code: Select all
// and finally send the mails
foreach ($n2m_MAILTO as $mailto) {
if ($config['smtp_delivery']) { // SMTP?
Code: Select all
// add recipients subscribed to that forum
if ( $n2m_MAILTO_FORUMWATCH )
{
$sql_stmt = array(
'SELECT' => 'u.user_email',
'FROM' => array( USERS_TABLE => 'u',
FORUMS_WATCH_TABLE => 'w'),
'WHERE' => 'u.user_id = w.user_id
AND u.user_inactive_time = 0
AND w.forum_id = ' . $data[forum_id]);
$sql = $db->sql_build_query('SELECT', $sql_stmt);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) $n2m_MAILTO[] = $row['user_email'];
$db->sql_freeresult($result);
}
// add recipients watching topic
if ( $n2m_MAILTO_TOPICWATCH )
{
$sql_stmt = array(
'SELECT' => 'u.user_email',
'FROM' => array( USERS_TABLE => 'u',
TOPICS_WATCH_TABLE => 'w'),
'WHERE' => 'u.user_id = w.user_id
AND u.user_inactive_time = 0
AND w.topic_id = ' . $data[topic_id]);
$sql = $db->sql_build_query('SELECT', $sql_stmt);
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) $n2m_MAILTO[] = $row['user_email'];
$db->sql_freeresult($result);
}
Code: Select all
$n2m_MAILTO_FORUMWATCH = 1;
$n2m_MAILTO_TOPICWATCH = 1;
I see!quielb wrote:That logic is somewhat built in. If they don't have permission to read the forum then they can't subscribe to it. Granted that doesn't address the case of a someone that at one time had permission and then got it taken away.