query('INSERT INTO '.$db->prefix.'censoring (search_for, replace_with) VALUES (\''.$db->escape($search_for).'\', \''.$db->escape($replace_with).'\')') or error('Unable to add censor word', __FILE__, __LINE__, $db->error()); // Regenerate the censoring cache if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) require PUN_ROOT.'include/cache.php'; generate_censoring_cache(); redirect('admin_censoring.php', $lang_admin_censoring['Word added redirect']); } // Update a censor word else if (isset($_POST['update'])) { confirm_referrer('admin_censoring.php'); $id = intval(key($_POST['update'])); $search_for = pun_trim($_POST['search_for'][$id]); $replace_with = pun_trim($_POST['replace_with'][$id]); if ($search_for == '') message($lang_admin_censoring['Must enter word message']); $db->query('UPDATE '.$db->prefix.'censoring SET search_for=\''.$db->escape($search_for).'\', replace_with=\''.$db->escape($replace_with).'\' WHERE id='.$id) or error('Unable to update censor word', __FILE__, __LINE__, $db->error()); // Regenerate the censoring cache if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) require PUN_ROOT.'include/cache.php'; generate_censoring_cache(); redirect('admin_censoring.php', $lang_admin_censoring['Word updated redirect']); } // Remove a censor word else if (isset($_POST['remove'])) { confirm_referrer('admin_censoring.php'); $id = intval(key($_POST['remove'])); $db->query('DELETE FROM '.$db->prefix.'censoring WHERE id='.$id) or error('Unable to delete censor word', __FILE__, __LINE__, $db->error()); // Regenerate the censoring cache if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) require PUN_ROOT.'include/cache.php'; generate_censoring_cache(); redirect('admin_censoring.php', $lang_admin_censoring['Word removed redirect']); } $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Censoring']); $focus_element = array('censoring', 'new_search_for'); define('PUN_ACTIVE_PAGE', 'admin'); require PUN_ROOT.'header.php'; generate_admin_menu('censoring'); ?>

'.$lang_admin_common['Options'].'') : sprintf($lang_admin_censoring['Censoring disabled'], ''.$lang_admin_common['Options'].'')) ?>

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)) { ?> fetch_assoc($result)) echo "\t\t\t\t\t\t\t\t".''."\n"; ?>
 
'.$lang_admin_censoring['No words in list'].'

'."\n"; ?>