$input) { // Make sure the input is never a negative value if($input < 0) $input = 0; // Only update values that have changed if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input) $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); } // Regenerate the config cache if (!defined('FORUM_CACHE_FUNCTIONS_LOADED')) require PUN_ROOT.'include/cache.php'; generate_config_cache(); redirect('admin_permissions.php', $lang_admin_permissions['Perms updated redirect']); } $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Permissions']); define('PUN_ACTIVE_PAGE', 'admin'); require PUN_ROOT.'header.php'; generate_admin_menu('permissions'); ?>