Changeset 1175
- Timestamp:
- 03/02/2008 07:04:36 AM (18 years ago)
- Location:
- branches/0.8
- Files:
-
- 2 deleted
- 6 edited
- 3 copied
-
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 (copied) (copied from trunk/bb-plugins)
-
bb-plugins/akismet.php (copied) (copied from trunk/bb-plugins/akismet.php)
-
bb-plugins/bozo.php (copied) (copied from trunk/bb-plugins/bozo.php)
-
bb-settings.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.8/bb-admin/admin-functions.php
r1161 r1175 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 -
branches/0.8/bb-admin/options-general.php
r1161 r1175 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" /> -
branches/0.8/bb-admin/plugins.php
r1126 r1175 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]); -
branches/0.8/bb-admin/upgrade-functions.php
r1078 r1175 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. -
branches/0.8/bb-includes/functions.php
r1141 r1175 1442 1442 break; 1443 1443 case 'bb_db_version' : 1444 return '1 058'; // Don't filter1444 return '1174'; // Don't filter 1445 1445 break; 1446 1446 case 'html_type' : -
branches/0.8/bb-settings.php
r1146 r1175 109 109 require( BBPATH . BBINC . 'deprecated.php'); 110 110 111 if ( defined('BB_DISABLE_BOZO_CHECKS') && !BB_DISABLE_BOZO_CHECKS )112 require( BBPATH . BBINC . 'bozo.php');113 114 111 require( BBPATH . BBINC . 'default-filters.php'); 115 112 require( BBPATH . BBINC . 'script-loader.php'); … … 122 119 $bbdb->show_errors(); 123 120 } 124 125 if ( bb_get_option( 'akismet_key' ) )126 require( BBPATH . BBINC . 'akismet.php');127 121 128 122 $_GET = bb_global_sanitize($_GET ); … … 164 158 if ( !defined('BBPLUGINURL') ) 165 159 define('BBPLUGINURL', $bb->uri . 'my-plugins/'); 160 if ( !defined('BBDEFAULTPLUGINDIR') ) 161 define('BBDEFAULTPLUGINDIR', BBPATH . 'bb-plugins/'); 162 if ( !defined('BBDEFAULTPLUGINURL') ) 163 define('BBDEFAULTPLUGINURL', $bb->uri . 'bb-plugins/'); 166 164 if ( !defined('BBTHEMEDIR') ) 167 165 define('BBTHEMEDIR', BBPATH . 'my-templates/'); … … 295 293 296 294 // Load Plugins 297 if ( function_exists( 'glob' ) && is_callable( 'glob' ) && $_plugins_glob = glob(BBPLUGINDIR . '_*.php') ) 295 296 // Underscore plugins 297 if ( function_exists( 'glob' ) && is_callable( 'glob' ) ) { 298 // First BBDEFAULTPLUGINDIR 299 $_plugins_glob = glob(BBDEFAULTPLUGINDIR . '_*.php'); 298 300 foreach ( $_plugins_glob as $_plugin ) 299 301 require($_plugin); 300 unset($_plugins_glob, $_plugin); 302 unset($_plugins_glob, $_plugin); 303 304 // Second BBPLUGINDIR, with no name clash testing 305 $_plugins_glob = glob(BBPLUGINDIR . '_*.php'); 306 foreach ( $_plugins_glob as $_plugin ) 307 require($_plugin); 308 unset($_plugins_glob, $_plugin); 309 } 301 310 do_action( 'bb_underscore_plugins_loaded' ); 302 311 312 // Plugins in BBPLUGINDIR take precedence over BBDEFAULTPLUGINDIR when names collide 303 313 if ( $plugins = bb_get_option( 'active_plugins' ) ) 304 314 foreach ( (array) $plugins as $plugin ) 305 if ( file_exists(BBPLUGINDIR . $plugin) ) 315 if ( file_exists(BBPLUGINDIR . $plugin) ) { 306 316 require( BBPLUGINDIR . $plugin ); 317 } elseif ( file_exists(BBDEFAULTPLUGINDIR . $plugin) ) { 318 require( BBDEFAULTPLUGINDIR . $plugin ); 319 } 307 320 do_action( 'bb_plugins_loaded' ); 308 321 unset($plugins, $plugin);
Note: See TracChangeset
for help on using the changeset viewer.