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'); ?>
Censoring
Add word  
Enter a word that you want to censor and the replacement text for this word. Wildcards are accepted (i.e. *some* would match somewhere and lonesome). Censor words also affect usernames. New users will not be able to register with usernames containing any censored words. The search is case insensitive. Censor words must be enabled in Options for this to have any effect.

Word
The word to censor.
Replacement
The text to replace the matching censored word with.
Edit/remove words  
query('SELECT id, search_for, replace_with FROM '.$db->prefix.'censoring ORDER BY id') or error('Unable to fetch censor word list', __FILE__, __LINE__, $db->error()); if ($db->num_rows($result)) { while ($cur_word = $db->fetch_assoc($result)) print "\t\t\t\t\t\t\t".'   Word       Replacement        
'."\n"; } else print "\t\t\t\t\t\t\t".'No censor words in list.'."\n"; ?>