Skip to:
Content

BuddyPress.org

Ticket #3178: 3178.003.diff

File 3178.003.diff, 3.8 KB (added by cnorris23, 15 years ago)
  • bp-core/admin/bp-core-update.php

     
    262262                        $blogs_slug = constant( 'BP_BLOGS_SLUG' );
    263263                else
    264264                        $blogs_slug = 'blogs';
    265  
    266                 // Call up old bp-pages to see if a page has been previously linked to Blogs 
     265
     266                // Call up old bp-pages to see if a page has been previously linked to Blogs
    267267                $page_blog_id           = is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? get_current_blog_id() : BP_ROOT_BLOG;
    268268                $existing_pages_data    = get_blog_option( $page_blog_id, 'bp-pages' );
    269269                $existing_pages         = $existing_pages_data[$page_blog_id];
     
    516516
    517517                $prefix              = '';
    518518                $permalink_structure = get_option( 'permalink_structure' );
     519                $using_permalinks    = ( !empty( $permalink_structure ) ) ? true : false;
    519520                $structures          = array( '', $prefix . '/%year%/%monthnum%/%day%/%postname%/', $prefix . '/%year%/%monthnum%/%postname%/', $prefix . '/archives/%post_id%' );
    520521
     522                // If we're using permalinks already, adjust text accordingly
     523                if ( $permalink_structure )
     524                        $permalink_setup_text = __( 'Congratulations! You are already using pretty permalinks, which BuddyPress requires. If you\'d like to change your settings, you may do so now. Otherwise, you may continue on.', 'buddypress' );
     525                else
     526                        $permalink_setup_text = __( 'To make sure the pages created in the previous step work correctly, pretty permalinks must be active on your site.', 'buddypress' );
     527
    521528                if ( !got_mod_rewrite() && !iis7_supports_permalinks() )
    522529                        $prefix = '/index.php'; ?>
    523530
    524                 <p><?php _e( 'To make sure the pages created in the previous step work correctly, pretty permalinks must be active on your site.', 'buddypress' ); ?></p>
     531                <p><?php echo $permalink_setup_text; ?></p>
    525532                <p><?php printf( __( 'Please select the permalink setting you would like to use. For more advanced options please visit the <a href="%s">permalink settings page</a> first, and complete this setup wizard later.', 'buddypress' ), admin_url( 'options-permalink.php' ) ); ?>
    526533
    527534                <table class="form-table">
     
    758765                                $page_blog_id           = is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? get_current_blog_id() : BP_ROOT_BLOG;
    759766                                $existing_pages_data    = get_blog_option( $page_blog_id, 'bp-pages' );
    760767                                $existing_pages         = $existing_pages_data[$page_blog_id];
    761                                
     768
    762769                                $bp_pages               = $this->setup_pages( (array)$_POST['bp_pages'] );
    763770                                $bp_pages               = array_merge( (array)$existing_pages, (array)$bp_pages );
    764                                
     771
    765772                                $existing_pages_data[$page_blog_id] = $bp_pages;
    766773
    767774                                update_site_option( 'bp-pages', $existing_pages_data );
     
    991998                        // Delete the setup cookie
    992999                        @setcookie( 'bp-wizard-step', '', time() - 3600, COOKIEPATH );
    9931000
    994                         // Load BP, so that the redirect is successful                 
     1001                        // Load BP, so that the redirect is successful
    9951002                        require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-loader.php' );
    9961003
    9971004                        // Redirect to the BuddyPress dashboard
     
    10551062                $active_components = apply_filters( 'bp_active_components', get_site_option( 'bp-active-components' ) );
    10561063
    10571064        require_once( dirname( __FILE__ ) . '/bp-core-schema.php' );
    1058        
     1065
    10591066        // Core DB Tables
    10601067        bp_core_install_notifications();
    10611068
     
    12331240 */
    12341241function bp_core_update_get_page_meta() {
    12351242        $page_ids = get_site_option( 'bp-pages' );
    1236        
     1243
    12371244        $is_enable_multiblog = is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? true : false;
    12381245
    12391246        $page_blog_id = $is_enable_multiblog ? get_current_blog_id() : BP_ROOT_BLOG;
    1240        
     1247
    12411248        $blog_page_ids = !empty( $page_ids[$page_blog_id] ) ? $page_ids[$page_blog_id] : false;
    1242        
     1249
    12431250        return apply_filters( 'bp_core_update_get_page_meta', $blog_page_ids );
    12441251}
    12451252