$value ) { if ( !in_array( $option, array('_wpnonce', '_wp_http_referer', 'action', 'submit') ) ) { $option = trim( $option ); $value = is_array( $value ) ? $value : trim( $value ); $value = stripslashes_deep( $value ); if ( ( $option == 'wp_siteurl' || $option == 'wp_home' ) && !empty( $value ) ) { $value = rtrim( $value, " \t\n\r\0\x0B/" ) . '/'; } if ( $value ) { bb_update_option( $option, $value ); } else { bb_delete_option( $option ); } } } if ($action == 'update-users') { bb_apply_wp_role_map_to_orphans(); } $goback = add_query_arg('updated', $action, wp_get_referer()); bb_safe_redirect($goback); exit; } switch (@$_GET['updated']) { case 'update-users': bb_admin_notice( __( 'User role mapping saved.' ) ); break; case 'update-options': bb_admin_notice( __( 'User integration settings saved.' ) ); break; } $bb_role_names[''] = _c( 'none|no bbPress role' ); $bb_role_names = array_merge( $bb_role_names, array_map( create_function( '$a', 'return sprintf( _c( "bbPress %s|bbPress role" ), $a );' ), $wp_roles->get_names() ) ); $wpRoles = array( 'administrator' => __('WordPress Administrator'), 'editor' => __('WordPress Editor'), 'author' => __('WordPress Author'), 'contributor' => __('WordPress Contributor'), 'subscriber' => __('WordPress Subscriber') ); $wpRoles = apply_filters( 'role_map_wp_roles', $wpRoles ); $cookie_options = array( 'wp_siteurl' => array( 'title' => __( 'WordPress address (URL)' ), 'class' => 'long', 'note' => __( 'This value should exactly match the WordPress address (URL) setting in your WordPress general settings.' ) ), 'wp_home' => array( 'title' => __( 'Blog address (URL)' ), 'class' => 'long', 'note' => __( 'This value should exactly match the Blog address (URL) setting in your WordPress general settings.' ) ), 'bb_auth_salt' => array( 'title' => __( 'WordPress "auth" cookie salt' ), 'note' => __( 'This must match the value of the WordPress setting named "auth_salt" in your WordPress site. Look for the option labeled "auth_salt" in this WordPress admin page.' ) ), 'bb_secure_auth_salt' => array( 'title' => __( 'WordPress "secure auth" cookie salt' ), 'note' => __( 'This must match the value of the WordPress setting named "secure_auth_salt" in your WordPress site. Look for the option labeled "secure_auth_salt" in this WordPress admin page. Sometimes this value is not set in WordPress, in that case you can leave this setting blank as well.' ) ), 'bb_logged_in_salt' => array( 'title' => __( 'WordPress "logged in" cookie salt' ), 'note' => __( 'This must match the value of the WordPress setting named "logged_in_salt" in your WordPress site. Look for the option labeled "logged_in_salt" in this WordPress admin page.' ) ) ); foreach ( array( 'bb_auth_salt', 'bb_secure_auth_salt', 'bb_logged_in_salt' ) as $salt_constant ) { if ( defined( strtoupper( $salt_constant ) ) ) { $cookie_options[$salt_constant]['note'] = array( sprintf( __( 'You have defined the "%s" constant which locks this setting.' ), strtoupper( $salt_constant ) ), $cookie_options[$salt_constant]['note'], ); $cookie_options[$salt_constant]['value'] = constant( strtoupper( $salt_constant ) ); $bb_hardcoded[$salt_constant] = true; } } $user_db_options = array( 'wp_table_prefix' => array( 'title' => __( 'User database table prefix' ), 'note' => __( 'If your bbPress and WordPress sites share the same database, then this is the same value as $table_prefix in your WordPress wp-config.php file. It is usually wp_.' ) ), 'wordpress_mu_primary_blog_id' => array( 'title' => __( 'WordPress MU primary blog ID' ), 'note' => __( 'If you are integrating with a WordPress MU site you need to specify the primary blog ID for that site. It is usually 1. You should probably leave this blank if you are integrating with a standard WordPress site' ) ), 'user_bbdb_advanced' => array( 'title' => __( 'Show advanced database settings' ), 'type' => 'checkbox', 'options' => array( 1 => array( 'label' => __( 'If your bbPress and WordPress site do not share the same database, then you will need to add advanced settings.' ), 'attributes' => array( 'onclick' => 'toggleAdvanced(this);' ) ) ) ) ); $advanced_user_db_options = array( 'user_bbdb_name' => array( 'title' => __( 'User database name' ), 'note' => __( 'The name of the database in which your user tables reside.' ) ), 'user_bbdb_user' => array( 'title' => __( 'User database user' ), 'note' => __( 'The database user that has access to that database.' ) ), 'user_bbdb_password' => array( 'title' => __( 'User database password' ), 'note' => __( 'That database user\'s password.' ) ), 'user_bbdb_host' => array( 'title' => __( 'User database host' ), 'note' => __( 'The domain name or IP address of the server where the database is located. If the database is on the same server as the web site, then this probably should be localhost.' ) ), 'user_bbdb_charset' => array( 'title' => __( 'User database character set' ), 'note' => __( 'The best choice is utf8, but you will need to match the character set which you created the database with.' ) ), 'user_bbdb_collate' => array( 'title' => __( 'User database character collation' ), 'note' => __( 'The character collation value set when the user database was created.' ) ) ); $custom_table_options = array( 'custom_user_table' => array( 'title' => __( 'User database "user" table' ), 'note' => __( 'The complete table name, including any prefix.' ), ), 'custom_user_meta_table' => array( 'title' => __( 'User database "user meta" table' ), 'note' => __( 'The complete table name, including any prefix.' ), ), ); $advanced_display = bb_get_option( 'user_bbdb_advanced' ) ? 'block' : 'none'; $bb_admin_body_class = ' bb-admin-settings'; bb_get_admin_header(); ?>

$wpRoleName ) bb_option_form_element( "wp_roles_map[$wpRole]", array( 'title' => $wpRoleName, 'type' => 'select', 'options' => $bb_role_names ) ); ?>

Note: changing the settings below may cause you to be logged out!'); ?>

$args ) bb_option_form_element( $option, $args ); ?> 'COOKIE_DOMAIN', 'cookiepath' => 'COOKIEPATH' ); $wp_settings = ''; foreach ($cookie_settings as $bb_setting => $wp_setting) { if ( isset($bb->$bb_setting) ) { $wp_settings .= 'define(\'' . $wp_setting . '\', \'' . $bb->$bb_setting . '\');' . "\n"; } } ?>

wp-config.php file in the root directory of your WordPress installation. To get those settings, you will need to install and configure the "bbPress Integration" plugin for WordPress.'), 'http://wordpress.org/extend/plugins/bbpress-integration/'); ?>

AUTH_KEY <=> BB_AUTH_KEY
SECURE_AUTH_KEY <=> BB_SECURE_AUTH_KEY
LOGGED_IN_KEY <=> BB_LOGGED_IN_KEY

$args ) bb_option_form_element( $option, $args ); ?>

not required. Look before you leap!'); ?>

$args ) bb_option_form_element( $option, $args ); ?>

$args ) bb_option_form_element( $option, $args ); ?>