Skip to:
Content

bbPress.org


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-admin/upgrade-functions.php

    r1058 r1174  
    2525    $bb_upgrade[] = bb_upgrade_1020(); // Add a user_nicename to existing users
    2626    $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
    2728    bb_update_db_version();
    2829    return $bb_upgrade;
     
    520521}
    521522
     523// Activate Akismet and bozo plugins on upgrade only
     524function 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
    522544function bb_deslash($content) {
    523545    // Note: \\\ inside a regex denotes a single backslash.
Note: See TracChangeset for help on using the changeset viewer.