query('INSERT INTO '.$db->prefix.'censoring (search_for, replace_with) VALUES (\''.escape($search_for).'\', \''.escape($replace_with).'\')') or error('Unable to add censor word', __FILE__, __LINE__, $db->error()); redirect('admin_censoring.php', 'Censor word added. Redirecting ...'); } // Update a censor word else if (isset($_POST['update'])) { confirm_referer('admin_censoring.php'); $id = key($_POST['update']); $search_for = trim($_POST['search_for'][$id]); $replace_with = trim($_POST['replace_with'][$id]); if ($search_for == '' || $replace_with == '') message('You must enter both text to search for and text to replace with.'); $db->query('UPDATE '.$db->prefix.'censoring SET search_for=\''.escape($search_for).'\', replace_with=\''.escape($replace_with).'\' WHERE id='.$id) or error('Unable to update censor word', __FILE__, __LINE__, $db->error()); redirect('admin_censoring.php', 'Censor word updated. Redirecting ...'); } // Remove a censor word else if (isset($_POST['remove'])) { confirm_referer('admin_censoring.php'); $id = key($_POST['remove']); $db->query('DELETE FROM '.$db->prefix.'censoring WHERE id='.$id) or error('Unable to delete censor word', __FILE__, __LINE__, $db->error()); redirect('admin_censoring.php', 'Censor word removed. Redirecting ...'); } $page_title = htmlspecialchars($options['board_title']).' / Admin / Censoring'; $form_name = 'censoring'; $focus_element = 'new_search_for'; require 'header.php'; if ($cur_user['status'] > 1) admin_menu('censoring'); else moderator_menu('censoring'); ?>