Show
Ignore:
Timestamp:
01/03/08 00:57:27 (1 year ago)
Author:
mdawaffe
Message:

bring branches/0.8 in line with trunk@971

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.8/bb-settings.php

    r840 r995  
    44        die(sprintf('Your server is running PHP version %s but bbPress requires at least 4.2', phpversion()) ); 
    55 
    6 if ( !extension_loaded('mysql') && !extension_loaded('mysqli') ) 
    7         die('Your PHP installation appears to be missing the MySQL which is required for bbPress.'); 
    8  
    96if ( !$bb_table_prefix ) 
    107        die('You must specify a table prefix in your <code>config.php</code> file.'); 
    11  
    12 if ( preg_match('/[^A-Za-z0-9_]/', $bb_table_prefix) ) 
    13         die('Your table prefix may only contain letters, numbers and underscores.'); 
    148 
    159if ( !defined('BBPATH') ) 
     
    8781if ( !defined('BBTHEMEURL') ) 
    8882        define('BBTHEMEURL', $bb->uri . 'my-templates/'); 
    89  
    90 if ( extension_loaded('mysqli') ) { 
     83if ( !defined('BBDEFAULTTHEMEDIR') ) 
     84        define('BBDEFAULTTHEMEDIR', BBPATH . 'bb-templates/kakumei/'); 
     85if ( !defined('BBDEFAULTTHEMEURL') ) 
     86        define('BBDEFAULTTHEMEURL', $bb->uri . 'bb-templates/kakumei/'); 
     87 
     88require( BBPATH . BBINC . 'db-base.php'); 
     89if ( extension_loaded('mysql') ) { 
     90        require( BBPATH . BBINC . 'db.php'); 
     91} elseif ( extension_loaded('mysqli') ) { 
    9192        require( BBPATH . BBINC . 'db-mysqli.php'); 
    9293} else { 
    93         require( BBPATH . BBINC . 'db.php'); 
    94 } 
    95  
    96 $bbdb->forums    = $bb_table_prefix . 'forums'
    97 $bbdb->posts     = $bb_table_prefix . 'posts'
    98 $bbdb->topics    = $bb_table_prefix . 'topics'
    99 $bbdb->topicmeta = $bb_table_prefix . 'topicmeta'
    100 $bbdb->users     = ( $bb->wp_table_prefix ? $bb->wp_table_prefix : $bb_table_prefix ) . 'users'
    101 $bbdb->usermeta  = ( $bb->wp_table_prefix ? $bb->wp_table_prefix : $bb_table_prefix ) . 'usermeta'; 
    102 $bbdb->tags      = $bb_table_prefix . 'tags'; 
    103 $bbdb->tagged    = $bb_table_prefix . 'tagged'
     94        die('Your PHP installation appears to be missing the MySQL which is required for bbPress.'); 
     95} 
     96 
     97require( BBPATH . BBINC . 'compat.php')
     98require( BBPATH . BBINC . 'wp-functions.php')
     99require( BBPATH . BBINC . 'functions.php')
     100require( BBPATH . BBINC . 'wp-classes.php')
     101require( BBPATH . BBINC . 'classes.php')
     102 
     103if ( is_wp_error( $bbdb->set_prefix( $bb_table_prefix ) ) ) 
     104       die('Your table prefix may only contain letters, numbers and underscores.')
    104105 
    105106foreach ( array('use_cache', 'secret', 'debug', 'wp_table_prefix', 'wp_home', 'wp_siteurl', 'cookiedomain', 'static_title', 'load_options', 'akismet_key') as $o ) 
     
    113114unset($i); 
    114115 
    115 require( BBPATH . BBINC . 'functions.php'); 
    116 require( BBPATH . BBINC . 'wp-classes.php'); 
    117 require( BBPATH . BBINC . 'classes.php'); 
    118116require( BBPATH . BBINC . 'formatting-functions.php'); 
    119117require( BBPATH . BBINC . 'template-functions.php'); 
     
    121119require( BBPATH . BBINC . 'cache.php'); 
    122120require( BBPATH . BBINC . 'deprecated.php'); 
    123 require( BBPATH . BBINC . 'wp-functions.php'); 
    124121if ( defined('BBLANG') && '' != constant('BBLANG') ) { 
    125122        include_once(BBPATH . BBINC . 'streams.php'); 
     
    134131require( BBPATH . BBINC . 'default-filters.php'); 
    135132require( BBPATH . BBINC . 'script-loader.php'); 
    136 require( BBPATH . BBINC . 'compat.php'); 
    137133 
    138134if ( !bb_is_installed() && false === strpos($_SERVER['PHP_SELF'], 'install.php') && !defined('BB_INSTALLING') ) 
     
    141137$bb_cache = new BB_Cache(); 
    142138 
    143 if ( $bb->load_options ) 
     139if ( $bb->load_options ) { 
     140        $bbdb->hide_errors(); 
    144141        bb_cache_all_options(); 
     142        $bbdb->show_errors(); 
     143} 
    145144 
    146145$_GET    = bb_global_sanitize($_GET   ); 
     
    148147$_COOKIE = bb_global_sanitize($_COOKIE, false); 
    149148$_SERVER = bb_global_sanitize($_SERVER); 
    150  
    151 new BB_Dir_Map( BBPLUGINDIR, array( 'recurse' => 0, 'callback' => create_function( '$f,$_f', 'if ( preg_match("/^_.*?\.php$/", $_f) ) require($f);' ) ) ); 
    152 do_action( 'bb_underscore_plugins_loaded' ); 
    153  
    154 if ( $plugins = bb_get_option( 'active_plugins' ) ) 
    155         foreach ( (array) $plugins as $plugin ) 
    156                 if ( file_exists(BBPLUGINDIR . $plugin) ) 
    157                         require( BBPLUGINDIR . $plugin ); 
    158 do_action( 'bb_plugins_loaded' ); 
    159 unset($plugins, $plugin); 
    160  
    161 require( BBPATH . BBINC . 'pluggable.php'); 
    162149 
    163150if ( defined('CUSTOM_USER_TABLE') ) 
     
    179166        $bb->tagpath = $bb->path; 
    180167 
     168if ( is_callable( 'glob' ) ) 
     169        foreach ( glob(BBPLUGINDIR . '_*.php') as $_plugin ) 
     170                require($_plugin); 
     171unset($_plugin); 
     172do_action( 'bb_underscore_plugins_loaded' ); 
     173 
     174if ( $plugins = bb_get_option( 'active_plugins' ) ) 
     175        foreach ( (array) $plugins as $plugin ) 
     176                if ( file_exists(BBPLUGINDIR . $plugin) ) 
     177                        require( BBPLUGINDIR . $plugin ); 
     178do_action( 'bb_plugins_loaded' ); 
     179unset($plugins, $plugin); 
     180 
     181require( BBPATH . BBINC . 'pluggable.php'); 
     182 
    181183// Load the default text localization domain. 
    182184load_default_textdomain();