Skip to:
Content

BuddyPress.org

Changeset 4342


Ignore:
Timestamp:
05/10/2011 01:10:20 PM (15 years ago)
Author:
boonebgorges
Message:

Changes text on wizard Permalink panel to reflect whether user has already set permalinks. Fixes #3178. Props cnorris23

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/admin/bp-core-update.php

    r4311 r4342  
    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' );
     
    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%' );
     521
     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. If you\'re happy with your current settings, click Save & Next to continue.', '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' );
    520527
    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
     
    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
     
    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
     
    10561063
    10571064        require_once( dirname( __FILE__ ) . '/bp-core-schema.php' );
    1058        
     1065
    10591066        // Core DB Tables
    10601067        bp_core_install_notifications();
     
    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}
Note: See TracChangeset for help on using the changeset viewer.