Skip to:
Content

bbPress.org

Changeset 1174 for trunk/bb-settings.php


Ignore:
Timestamp:
03/02/2008 06:34:21 AM (18 years ago)
Author:
sambauers
Message:

Make Bozo and Akismet plugins. Add bb-plugins directory. Let's see how it feels for a day or two then keep or dump.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-settings.php

    r1153 r1174  
    133133require( BBPATH . BBINC . 'deprecated.php');
    134134
    135 if ( defined('BB_DISABLE_BOZO_CHECKS') && !BB_DISABLE_BOZO_CHECKS )
    136     require( BBPATH . BBINC . 'bozo.php');
    137 
    138135require( BBPATH . BBINC . 'default-filters.php');
    139136require( BBPATH . BBINC . 'script-loader.php');
     
    146143    $bbdb->show_errors();
    147144}
    148 
    149 if ( bb_get_option( 'akismet_key' ) )
    150     require( BBPATH . BBINC . 'akismet.php');
    151145
    152146$_GET    = bb_global_sanitize($_GET   );
     
    188182if ( !defined('BBPLUGINURL') )
    189183    define('BBPLUGINURL', $bb->uri . 'my-plugins/');
     184if ( !defined('BBDEFAULTPLUGINDIR') )
     185    define('BBDEFAULTPLUGINDIR', BBPATH . 'bb-plugins/');
     186if ( !defined('BBDEFAULTPLUGINURL') )
     187    define('BBDEFAULTPLUGINURL', $bb->uri . 'bb-plugins/');
    190188if ( !defined('BBTHEMEDIR') )
    191189    define('BBTHEMEDIR', BBPATH . 'my-templates/');
     
    377375
    378376// Load Plugins
    379 if ( function_exists( 'glob' ) && is_callable( 'glob' ) && $_plugins_glob = glob(BBPLUGINDIR . '_*.php') )
     377
     378// Underscore plugins
     379if ( function_exists( 'glob' ) && is_callable( 'glob' ) ) {
     380    // First BBDEFAULTPLUGINDIR
     381    $_plugins_glob = glob(BBDEFAULTPLUGINDIR . '_*.php');
    380382    foreach ( $_plugins_glob as $_plugin )
    381383        require($_plugin);
    382 unset($_plugins_glob, $_plugin);
     384    unset($_plugins_glob, $_plugin);
     385   
     386    // Second BBPLUGINDIR, with no name clash testing
     387    $_plugins_glob = glob(BBPLUGINDIR . '_*.php');
     388    foreach ( $_plugins_glob as $_plugin )
     389        require($_plugin);
     390    unset($_plugins_glob, $_plugin);
     391}
    383392do_action( 'bb_underscore_plugins_loaded' );
    384393
     394// Plugins in BBPLUGINDIR take precedence over BBDEFAULTPLUGINDIR when names collide
    385395if ( $plugins = bb_get_option( 'active_plugins' ) )
    386396    foreach ( (array) $plugins as $plugin )
    387         if ( file_exists(BBPLUGINDIR . $plugin) )
     397        if ( file_exists(BBPLUGINDIR . $plugin) ) {
    388398            require( BBPLUGINDIR . $plugin );
     399        } elseif ( file_exists(BBDEFAULTPLUGINDIR . $plugin) ) {
     400            require( BBDEFAULTPLUGINDIR . $plugin );
     401        }
    389402do_action( 'bb_plugins_loaded' );
    390403unset($plugins, $plugin);
Note: See TracChangeset for help on using the changeset viewer.