Skip to:
Content

bbPress.org

Changeset 1185


Ignore:
Timestamp:
03/02/2008 10:57:25 AM (18 years ago)
Author:
sambauers
Message:

These constants don't need to be user definable, they also look nicer with underscores.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-admin/admin-functions.php

    r1174 r1185  
    767767
    768768function bb_get_plugins() {
    769     $dir = new BB_Dir_Map( BBDEFAULTPLUGINDIR, array(
     769    $dir = new BB_Dir_Map( BB_CORE_PLUGIN_DIR, array(
    770770        'callback' => 'bb_get_plugins_callback',
    771771        'recurse' => 1
  • trunk/bb-admin/plugins.php

    r1174 r1185  
    55$_plugins = array();
    66if ( function_exists( 'glob' ) && is_callable( 'glob' ) ) {
    7     $_plugins_glob = glob(BBDEFAULTPLUGINDIR . '_*.php');
     7    $_plugins_glob = glob(BB_CORE_PLUGIN_DIR . '_*.php');
    88    foreach ( $_plugins_glob as $_plugin ) {
    99        $_data = bb_get_plugin_data( $_plugin );
     
    2525$update = false;
    2626foreach ( $current as $c => $cur )
    27     if ( !file_exists(BBPLUGINDIR . $cur) && !file_exists(BBDEFAULTPLUGINDIR . $cur) ) {
     27    if ( !file_exists(BBPLUGINDIR . $cur) && !file_exists(BB_CORE_PLUGIN_DIR . $cur) ) {
    2828        $update = true;
    2929        unset($current[$c]);
  • trunk/bb-admin/themes.php

    r1128 r1185  
    55$activetheme = bb_get_option('bb_active_theme');
    66if (!$activetheme) {
    7     $activetheme = BBDEFAULTTHEMEDIR;
     7    $activetheme = BB_DEFAULT_THEME_DIR;
    88}
    99
     
    1616    do_action( 'bb_deactivate_theme_' . basename($activetheme) );
    1717    $activetheme = stripslashes($_GET['theme']);
    18     if ($activetheme == BBDEFAULTTHEMEDIR) {
     18    if ($activetheme == BB_DEFAULT_THEME_DIR) {
    1919        bb_delete_option( 'bb_active_theme' );
    2020    } else {
     
    3030
    3131if ( !in_array($activetheme, $themes) ) {
    32     if ($activetheme == BBDEFAULTTHEMEDIR) {
     32    if ($activetheme == BB_DEFAULT_THEME_DIR) {
    3333        remove_action( 'bb_admin_notices', $theme_notice );
    3434        bb_admin_notice( __('Default theme is missing.'), 'error' );
  • trunk/bb-includes/functions.php

    r1174 r1185  
    23612361    $activetheme = bb_get_option( 'bb_active_theme' );
    23622362    if ( !$activetheme )
    2363         $activetheme = BBDEFAULTTHEMEDIR;
     2363        $activetheme = BB_DEFAULT_THEME_DIR;
    23642364
    23652365    return apply_filters( 'bb_get_active_theme_folder', $activetheme );
  • trunk/bb-includes/template-functions.php

    r1169 r1185  
    2020    if ( file_exists( bb_get_active_theme_folder() .  $file) )
    2121        return bb_get_active_theme_folder() .  $file;
    22     return BBDEFAULTTHEMEDIR . $file;
     22    return BB_DEFAULT_THEME_DIR . $file;
    2323}
    2424
     
    5555        $r = bb_get_active_theme_uri() . $css_file;
    5656    else
    57         $r = BBDEFAULTTHEMEURL . $css_file;
     57        $r = BB_DEFAULT_THEME_URL . $css_file;
    5858    return apply_filters( 'bb_get_stylesheet_uri', $r, $stylesheet );
    5959}
     
    6565function bb_get_active_theme_uri() {
    6666    if ( !$active_theme = bb_get_option( 'bb_active_theme' ) )
    67         $active_theme = BBDEFAULTTHEMEDIR;
     67        $active_theme = BB_DEFAULT_THEME_DIR;
    6868    return apply_filters( 'bb_get_active_theme_uri', bb_get_theme_uri( $active_theme ) );
    6969}
  • trunk/bb-settings.php

    r1174 r1185  
    178178}
    179179
     180define('BB_CORE_PLUGIN_DIR', BBPATH . 'bb-plugins/');
     181define('BB_CORE_PLUGIN_URL', $bb->uri . 'bb-plugins/');
     182define('BB_DEFAULT_THEME_DIR', BBPATH . 'bb-templates/kakumei/');
     183define('BB_DEFAULT_THEME_URL', $bb->uri . 'bb-templates/kakumei/');
     184
    180185if ( !defined('BBPLUGINDIR') )
    181186    define('BBPLUGINDIR', BBPATH . 'my-plugins/');
    182187if ( !defined('BBPLUGINURL') )
    183188    define('BBPLUGINURL', $bb->uri . 'my-plugins/');
    184 if ( !defined('BBDEFAULTPLUGINDIR') )
    185     define('BBDEFAULTPLUGINDIR', BBPATH . 'bb-plugins/');
    186 if ( !defined('BBDEFAULTPLUGINURL') )
    187     define('BBDEFAULTPLUGINURL', $bb->uri . 'bb-plugins/');
    188189if ( !defined('BBTHEMEDIR') )
    189190    define('BBTHEMEDIR', BBPATH . 'my-templates/');
    190191if ( !defined('BBTHEMEURL') )
    191192    define('BBTHEMEURL', $bb->uri . 'my-templates/');
    192 if ( !defined('BBDEFAULTTHEMEDIR') )
    193     define('BBDEFAULTTHEMEDIR', BBPATH . 'bb-templates/kakumei/');
    194 if ( !defined('BBDEFAULTTHEMEURL') )
    195     define('BBDEFAULTTHEMEURL', $bb->uri . 'bb-templates/kakumei/');
    196193
    197194// Check for defined custom user tables
     
    378375// Underscore plugins
    379376if ( function_exists( 'glob' ) && is_callable( 'glob' ) ) {
    380     // First BBDEFAULTPLUGINDIR
    381     $_plugins_glob = glob(BBDEFAULTPLUGINDIR . '_*.php');
     377    // First BB_CORE_PLUGIN_DIR
     378    $_plugins_glob = glob(BB_CORE_PLUGIN_DIR . '_*.php');
    382379    foreach ( $_plugins_glob as $_plugin )
    383380        require($_plugin);
     
    392389do_action( 'bb_underscore_plugins_loaded' );
    393390
    394 // Plugins in BBPLUGINDIR take precedence over BBDEFAULTPLUGINDIR when names collide
     391// Plugins in BBPLUGINDIR take precedence over BB_CORE_PLUGIN_DIR when names collide
    395392if ( $plugins = bb_get_option( 'active_plugins' ) )
    396393    foreach ( (array) $plugins as $plugin )
    397394        if ( file_exists(BBPLUGINDIR . $plugin) ) {
    398395            require( BBPLUGINDIR . $plugin );
    399         } elseif ( file_exists(BBDEFAULTPLUGINDIR . $plugin) ) {
    400             require( BBDEFAULTPLUGINDIR . $plugin );
     396        } elseif ( file_exists(BB_CORE_PLUGIN_DIR . $plugin) ) {
     397            require( BB_CORE_PLUGIN_DIR . $plugin );
    401398        }
    402399do_action( 'bb_plugins_loaded' );
Note: See TracChangeset for help on using the changeset viewer.