ich denke mal es wird dieser abschnitt hier sein... was muss ich alles ändern damit der user nur eine email bekommt wenn sein account aktiviert wurde... er soll keine bekommen wenn der account gelöscht bzw deaktiviert wurde!
Code: Alles auswählen
if( (($delete && $confirm) || $activate) && $mark_list )
{
if( count($mark_list) )
{
$email_id = '';
for( $i = 0; $i < count($mark_list); $i++ )
{
$email_id .= (($email_id != '') ? ', ' : '') . intval($mark_list[$i]);
}
$sql_mail = "SELECT username, user_email, user_lang, user_active FROM ". USERS_TABLE ." WHERE user_id IN ($email_id)";
if( !($result_mail = $db->sql_query($sql_mail)) )
{
message_die(GENERAL_ERROR, 'could not get mail addresses', '', __LINE__, __FILE__, $sql_mail);
}
while( $mail = $db->sql_fetchrow($result_mail) )
{
if( $delete )
{
$subject = $lang['Account_deleted'];
$text = $lang['Account_deleted_text'];
}
else if( $activate )
{
$subject = ( $mail['user_active'] == '0' ) ? $lang['Account_activated'] : $lang['Account_deactivated'];
$text = ( $mail['user_active'] == '0' ) ? $lang['Account_activated_text'] : $lang['Account_deactivated_text'];
}
include_once($phpbb_root_path .'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
$emailer->use_template('admin_account_action', stripslashes($mail['user_lang']));
$emailer->email_address($mail['user_email']);
$emailer->set_subject($subject);
$emailer->assign_vars(array(
'SUBJECT' => $subject,
'TEXT' => sprintf($text, $board_config['sitename']),
'USERNAME' => $mail['username'],
'EMAIL_SIG' => ( !empty($board_config['board_email_sig']) ) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '',
));
$emailer->send();
$emailer->reset();
}
$db->sql_freeresult($result_mail);
}
}