Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/22/2013 08:45:34 PM (12 years ago)
Author:
r-a-y
Message:

Add checks for member and activity components on the welcome page.

On certain setups, the default components (members and activity) can be
deactivated programatically. Since we were not explicitly checking if
these components were active or not, a fatal error occurred.

This commit adds checks for the default components and adds a fallback
message if these components are not active on the welcome page.

Fixes #5181.

File:
1 edited

Legend:

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

    r7433 r7455  
    418418                <div class="feature-section">
    419419                    <h4><?php _e( 'Your Default Setup', 'buddypress' ); ?></h4>
    420                     <p><?php printf(
     420
     421                    <?php if ( bp_is_active( 'members' ) && bp_is_active( 'activity' ) ) : ?>
     422                        <p><?php printf(
    421423                        __( 'BuddyPress&#8217;s powerful features help your users connect and collaborate. To help get your community started, we&#8217;ve activated two of the most commonly used tools in BP: <strong>Extended Profiles</strong> and <strong>Activity Streams</strong>. See these components in action at the %1$s and %2$s directories, and be sure to spend a few minutes <a href="%3$s">configuring user profiles</a>. Want to explore more of BP&#8217;s features? Visit the <a href="%4$s">Components panel</a>.', 'buddypress' ),
    422424                        $pretty_permalinks_enabled ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . __( 'Members', 'buddypress' ) . '</a>' : __( 'Members', 'buddypress' ),
     
    425427                        bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) )
    426428                    ); ?></p>
     429
     430                    <?php else : ?>
     431                        <p><?php printf(
     432                        __( 'BuddyPress&#8217;s powerful features help your users connect and collaborate. Want to explore BP&#8217;s features? Visit the <a href="%s">Components panel</a>.', 'buddypress' ),
     433                        bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) )
     434                    ); ?></p>
     435
     436                    <?php endif; ?>
    427437
    428438                    <h4><?php _e( 'Community and Support', 'buddypress' ); ?></h4>
Note: See TracChangeset for help on using the changeset viewer.