Changeset 1174
- Timestamp:
- 03/02/2008 06:34:21 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 2 deleted
- 6 edited
-
bb-admin/admin-functions.php (modified) (1 diff)
-
bb-admin/options-general.php (modified) (1 diff)
-
bb-admin/plugins.php (modified) (2 diffs)
-
bb-admin/upgrade-functions.php (modified) (2 diffs)
-
bb-includes/akismet.php (deleted)
-
bb-includes/bozo.php (deleted)
-
bb-includes/functions.php (modified) (1 diff)
-
bb-plugins (added)
-
bb-plugins/akismet.php (added)
-
bb-plugins/bozo.php (added)
-
bb-settings.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-admin/admin-functions.php
r1160 r1174 760 760 /* Pluigns */ 761 761 762 function bb_get_plugins_callback( $f, $_f ) { 763 if ( ".php" != substr($f,-4) || "_" == substr($_f, 0, 1) ) 764 return false; 765 return bb_get_plugin_data( $f ); 766 } 767 762 768 function bb_get_plugins() { 763 $dir = new BB_Dir_Map( BB PLUGINDIR, array(764 'callback' => create_function('$f,$_f', 'if ( ".php" != substr($f,-4) || "_" == substr($_f, 0, 1) ) return false; return bb_get_plugin_data( $f );'),769 $dir = new BB_Dir_Map( BBDEFAULTPLUGINDIR, array( 770 'callback' => 'bb_get_plugins_callback', 765 771 'recurse' => 1 766 772 ) ); 767 $r = $dir->get_results(); 768 return is_wp_error($r) ? array() : $r; 773 $r1 = $dir->get_results(); 774 $r1 = is_wp_error($r1) ? array() : $r1; 775 $dir = new BB_Dir_Map( BBPLUGINDIR, array( 776 'callback' => 'bb_get_plugins_callback', 777 'recurse' => 1 778 ) ); 779 $r2 = $dir->get_results(); 780 $r2 = is_wp_error($r2) ? array() : $r2; 781 return array_merge($r1, $r2); 769 782 } 770 783 -
trunk/bb-admin/options-general.php
r1160 r1174 122 122 </fieldset> 123 123 <fieldset> 124 <legend><?php _e('Anti-spam') ?></legend>125 <label for="akismet_key">126 <?php _e('Akismet Key:') ?>127 </label>128 <div>129 <input class="text" name="akismet_key" id="akismet_key" value="<?php bb_form_option('akismet_key'); ?>" />130 <p><?php _e('You do not need a key to run bbPress, but if you want to take advantage of Akismet\'s powerful spam blocking, you\'ll need one.'); ?></p>131 <p><?php _e('You can get an Akismet key at <a href="http://wordpress.com/api-keys/">WordPress.com</a>') ?></p>132 </div>133 </fieldset>134 <fieldset>135 124 <?php bb_nonce_field( 'options-general-update' ); ?> 136 125 <input type="hidden" name="action" id="action" value="update" /> -
trunk/bb-admin/plugins.php
r1125 r1174 4 4 $plugins = bb_get_plugins(); 5 5 $_plugins = array(); 6 if ( function_exists( 'glob' ) && is_callable( 'glob' ) && $_plugins_glob = glob(BBPLUGINDIR . '_*.php') ) { 6 if ( function_exists( 'glob' ) && is_callable( 'glob' ) ) { 7 $_plugins_glob = glob(BBDEFAULTPLUGINDIR . '_*.php'); 7 8 foreach ( $_plugins_glob as $_plugin ) { 8 9 $_data = bb_get_plugin_data( $_plugin ); 9 10 $_plugins[$_plugin] = $_data ? $_data : true; 10 11 } 12 unset($_plugins_glob, $_data, $_plugin); 13 14 $_plugins_glob = glob(BBPLUGINDIR . '_*.php'); 15 foreach ( $_plugins_glob as $_plugin ) { 16 $_data = bb_get_plugin_data( $_plugin ); 17 $_plugins[$_plugin] = $_data ? $_data : true; 18 } 19 unset($_plugins_glob, $_data, $_plugin); 11 20 } 12 unset($_plugins_glob, $_plugin); 21 13 22 14 23 $current = (array) bb_get_option( 'active_plugins' ); … … 16 25 $update = false; 17 26 foreach ( $current as $c => $cur ) 18 if ( !file_exists(BBPLUGINDIR . $cur) ) {27 if ( !file_exists(BBPLUGINDIR . $cur) && !file_exists(BBDEFAULTPLUGINDIR . $cur) ) { 19 28 $update = true; 20 29 unset($current[$c]); -
trunk/bb-admin/upgrade-functions.php
r1058 r1174 25 25 $bb_upgrade[] = bb_upgrade_1020(); // Add a user_nicename to existing users 26 26 $bb_upgrade[] = bb_upgrade_1030(); // Move admin_email option to from_email 27 $bb_upgrade[] = bb_upgrade_1040(); // Activate Akismet and bozo plugins on upgrade only 27 28 bb_update_db_version(); 28 29 return $bb_upgrade; … … 520 521 } 521 522 523 // Activate Akismet and bozo plugins on upgrade only 524 function bb_upgrade_1040() { 525 if ( ( $dbv = bb_get_option_from_db( 'bb_db_version' ) ) && $dbv >= 1174 ) 526 return; 527 528 // Only do this when upgrading 529 if ( defined( 'BB_UPGRADING' ) && BB_UPGRADING ) { 530 $plugins = bb_get_option('active_plugins') 531 if ( bb_get_option('akismet_key') && !in_array('akismet.php', $plugins) ) { 532 $plugins[] = 'akismet.php'; 533 } 534 if ( !in_array('bozo.php', $plugins) ) { 535 $plugins[] = 'bozo.php'; 536 } 537 ksort($plugins); 538 bb_update_option( 'active_plugins', $plugins ); 539 } 540 541 bb_update_option( 'bb_db_version', 1174 ); 542 } 543 522 544 function bb_deslash($content) { 523 545 // Note: \\\ inside a regex denotes a single backslash. -
trunk/bb-includes/functions.php
r1140 r1174 1441 1441 break; 1442 1442 case 'bb_db_version' : 1443 return '1 058'; // Don't filter1443 return '1174'; // Don't filter 1444 1444 break; 1445 1445 case 'html_type' : -
trunk/bb-settings.php
r1153 r1174 133 133 require( BBPATH . BBINC . 'deprecated.php'); 134 134 135 if ( defined('BB_DISABLE_BOZO_CHECKS') && !BB_DISABLE_BOZO_CHECKS )136 require( BBPATH . BBINC . 'bozo.php');137 138 135 require( BBPATH . BBINC . 'default-filters.php'); 139 136 require( BBPATH . BBINC . 'script-loader.php'); … … 146 143 $bbdb->show_errors(); 147 144 } 148 149 if ( bb_get_option( 'akismet_key' ) )150 require( BBPATH . BBINC . 'akismet.php');151 145 152 146 $_GET = bb_global_sanitize($_GET ); … … 188 182 if ( !defined('BBPLUGINURL') ) 189 183 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/'); 190 188 if ( !defined('BBTHEMEDIR') ) 191 189 define('BBTHEMEDIR', BBPATH . 'my-templates/'); … … 377 375 378 376 // Load Plugins 379 if ( function_exists( 'glob' ) && is_callable( 'glob' ) && $_plugins_glob = glob(BBPLUGINDIR . '_*.php') ) 377 378 // Underscore plugins 379 if ( function_exists( 'glob' ) && is_callable( 'glob' ) ) { 380 // First BBDEFAULTPLUGINDIR 381 $_plugins_glob = glob(BBDEFAULTPLUGINDIR . '_*.php'); 380 382 foreach ( $_plugins_glob as $_plugin ) 381 383 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 } 383 392 do_action( 'bb_underscore_plugins_loaded' ); 384 393 394 // Plugins in BBPLUGINDIR take precedence over BBDEFAULTPLUGINDIR when names collide 385 395 if ( $plugins = bb_get_option( 'active_plugins' ) ) 386 396 foreach ( (array) $plugins as $plugin ) 387 if ( file_exists(BBPLUGINDIR . $plugin) ) 397 if ( file_exists(BBPLUGINDIR . $plugin) ) { 388 398 require( BBPLUGINDIR . $plugin ); 399 } elseif ( file_exists(BBDEFAULTPLUGINDIR . $plugin) ) { 400 require( BBDEFAULTPLUGINDIR . $plugin ); 401 } 389 402 do_action( 'bb_plugins_loaded' ); 390 403 unset($plugins, $plugin);
Note: See TracChangeset
for help on using the changeset viewer.