} // Get users of deleted warnings (to refresh their restrictions) $query = array('SELECT' => 'DISTINCT user_id', 'FROM' => 'om_warnings_reports', 'WHERE' => 'id IN(' . implode(',', $warnings) . ')'); ($hook = get_hook('om_warnings_list_delete_comply_qr_update users')) ? eval($hook) : null; $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); $users = array(); while ($cur_warning = $forum_db->fetch_assoc($result)) { $users[$cur_warning['user_id']] = $cur_warning['user_id']; } // Delete the warning reports $query = array('DELETE' => 'om_warnings_reports', 'WHERE' => 'id IN(' . implode(',', $warnings) . ')'); ($hook = get_hook('om_warnings_list_delete_comply_qr_delete_warnings')) ? eval($hook) : null; $forum_db->query_build($query) or error(__FILE__, __LINE__); // Refresh user restrictions foreach ($users as $user_id) { om_warnings_refresh_user($user_id); } $forum_flash->add_info($lang_om_warnings['Delete warnings redirect']); ($hook = get_hook('om_warnings_list_delete_comply_pre_redirect')) ? eval($hook) : null; redirect(forum_link($forum_url['om_warnings_list']), $lang_om_warnings['Delete warnings redirect']); } // From not submitted, display confirmation dialog. $forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0; $forum_page['form_action'] = forum_link($forum_url['om_warnings_list']); $forum_page['hidden_fields'] = array('csrf_token' => '<input type="hidden" name="csrf_token" value="' . generate_form_token($forum_page['form_action']) . '" />', 'warn' => '<input type="hidden" name="warn" value="' . implode(',', $warnings) . '" />'); // Setup breadcrumbs $forum_page['crumbs'] = array(array($forum_config['o_board_title'], forum_link($forum_url['index'])), array($lang_admin_common['Forum administration'], forum_link($forum_url['admin_index'])), array($lang_om_warnings['Warnings'], forum_link($forum_url['om_warnings_list'])), array($lang_om_warnings['Warning list'], forum_link($forum_url['om_warnings_list'])), $lang_om_warnings['Delete warnings']); ($hook = get_hook('om_warnings_list_delete_selected_pre_header_load')) ? eval($hook) : null; define('FORUM_PAGE', 'dialogue'); require FORUM_ROOT . 'header.php'; // START SUBST - <!-- forum_main -->
$mail_subject = str_replace('<username>', $username, $mail_subject); $mail_message = str_replace('<username>', $username, $mail_message); $mail_message = str_replace('<base_url>', $base_url . '/', $mail_message); $mail_message = str_replace('<warning_list>', str_replace('&', '&', forum_link($forum_url['om_warnings_profile'], $user_id)), $mail_message); $mail_message = str_replace('<warning_help>', str_replace('&', '&', forum_link($forum_url['help'], 'om_warnings')), $mail_message); $mail_message = str_replace('<message>', $message, $mail_message); $mail_message = str_replace('<board_mailer>', sprintf($lang_common['Forum mailer'], $forum_config['o_board_title']), $mail_message); if (!defined('FORUM_EMAIL_FUNCTIONS_LOADED')) { require FORUM_ROOT . 'include/email.php'; } ($hook = get_hook('om_warnings_modify_message')) ? eval($hook) : null; // Send e-mail forum_mail($user_email, $mail_subject, $mail_message); } // Refresh user warnings cache om_warnings_refresh_user($topic_info['poster_id']); $forum_flash->add_info($lang_om_warnings['Warning reported']); ($hook = get_hook('om_warnings_report_pre_redirect')) ? eval($hook) : null; redirect($forum_page['redirect_page'], $lang_om_warnings['Warning reported']); } } // Setup form $forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0; $forum_page['hidden_fields'] = array('form_sent' => '<input type="hidden" name="form_sent" value="1" />', 'csrf_token' => '<input type="hidden" name="csrf_token" value="' . generate_form_token($forum_page['form_action']) . '" />'); $om_warnings_types = om_warnings_get_warning_types(); if (!$om_warnings_types) { message($lang_om_warnings['Must define warning types']); } // Setup breadcrumbs $forum_page['crumbs'] = array(array($forum_config['o_board_title'], forum_link($forum_url['index'])), $lang_om_warnings['Report warning']); // Setup main heading