$filename ) { $filename = str_replace( array('core#', 'user#'), array(BB_CORE_PLUGIN_DIR, BB_PLUGIN_DIR), $filename ); if ( !file_exists($filename) ) { $update = true; unset($active_plugins[$index]); } } if ( $update ) { bb_update_option( 'active_plugins', $active_plugins ); } unset($update, $index, $filename); // Deal with user actions if ( isset($_GET['action']) ) { // Get the arguments $plugin = stripslashes(trim($_GET['plugin'])); $plugin_data = bb_get_plugin_data( $plugin ); if ($plugin_data['name']) { $name = $plugin_data['name']; } else { $name = str_replace(array('core#', 'user#'), '', $plugin); } if ('activate' == $_GET['action']) { // Activation bb_check_admin_referer( 'activate-plugin_' . $plugin ); // Check if the plugin exists in the normal plugins array if ( !in_array($plugin, array_keys($normal_plugins)) ) { wp_redirect( 'plugins.php?message=invalid' ); } elseif ( !in_array($plugin, $active_plugins) ) { // If the plugin isn't active already then activate it // We'll override this later if the plugin can be included without fatal error wp_redirect( 'plugins.php?message=error' ); // Get the right path and include the plugin $filename = str_replace( array('core#', 'user#'), array(BB_CORE_PLUGIN_DIR, BB_PLUGIN_DIR), $plugin ); @include( $filename ); // Add to the active plugins array $active_plugins[] = $plugin; ksort($active_plugins); bb_update_option( 'active_plugins', $active_plugins ); do_action( 'bb_activate_plugin_' . $plugin ); // Overrides the ?error=true one above wp_redirect( 'plugins.php?message=activate&name=' . urlencode($name) ); } } elseif ('deactivate' == $_GET['action']) { // Deactivation bb_check_admin_referer( 'deactivate-plugin_' . $plugin ); // Remove the deactivated plugin array_splice($active_plugins, array_search($plugin, $active_plugins), 1 ); bb_update_option( 'active_plugins', $active_plugins ); do_action( 'bb_deactivate_plugin_' . $plugin ); // Redirect wp_redirect( 'plugins.php?message=deactivate&name=' . urlencode($name) ); } // Stop processing exit; } // Display notices if ( isset($_GET['message']) ) { switch ( $_GET['message'] ) { case 'error' : bb_admin_notice( __('Plugin could not be activated; it produced a Fatal Error.'), 'error' ); break; case 'invalid' : bb_admin_notice( __('File is not a valid plugin.'), 'error' ); break; case 'activate' : bb_admin_notice( sprintf( __('Plugin "%s" activated'), attribute_escape($_GET['name']) ) ); break; case 'deactivate' : bb_admin_notice( sprintf( __('Plugin "%s" deactivated'), attribute_escape($_GET['name']) ) ); break; } } if ( isset( $bb->safemode ) && $bb->safemode === true ) { bb_admin_notice( __('"Safe mode" is on, all plugins are disabled even if they are listed as active.'), 'error' ); } bb_get_admin_header(); ?>

$plugin_data ) : $class = ''; $action = 'activate'; $action_class = 'edit'; $action_text = __('Activate'); if ( in_array($plugin, $active_plugins) ) { $class = 'active'; $action = 'deactivate'; $action_class = 'delete'; $action_text = __('Deactivate'); } $href = attribute_escape( bb_nonce_url( bb_get_uri( 'bb-admin/plugins.php', array( 'action' => $action, 'plugin' => urlencode($plugin) ), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN ), $action . '-plugin_' . $plugin ) ); ?> >

$plugin_data ) : ?> >

my-plugins directory and it will be automatically deactivated.'); ?>

bbPress plugin directory.'), 'http://bbpress.org/plugins/'); ?>

my-plugins directory. Once a plugin is uploaded, you may activate it here.'); ?>