Skip to:
Content

BuddyPress.org

Changeset 3698


Ignore:
Timestamp:
01/11/2011 05:41:53 PM (14 years ago)
Author:
djpaul
Message:

Swap function_exists calls to bp_is_active in BP-Default. See #2718

Location:
trunk/bp-themes/bp-default
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r3627 r3698  
    147147    }
    148148
    149     if ( empty( $_POST['object'] ) && function_exists( 'bp_activity_post_update' ) ) {
     149    if ( empty( $_POST['object'] ) && bp_is_active( 'activity' ) ) {
    150150        $activity_id = bp_activity_post_update( array( 'content' => $_POST['content'] ) );
    151151    } elseif ( $_POST['object'] == 'groups' ) {
    152         if ( !empty( $_POST['item_id'] ) && function_exists( 'groups_post_update' ) )
     152        if ( !empty( $_POST['item_id'] ) && bp_is_active( 'groups' ) )
    153153            $activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $_POST['item_id'] ) );
    154154    } else
     
    589589        }
    590590    } else {
    591         if ( function_exists( 'friends_search_friends' ) ) {
     591        if ( bp_is_active( 'friends' ) ) {
    592592            $users = friends_search_friends( $_GET['q'], $bp->loggedin_user->id, $limit, 1 );
    593593
  • trunk/bp-themes/bp-default/activity/index.php

    r3460 r3698  
    2626                        <?php do_action( 'bp_before_activity_type_tab_friends' ) ?>
    2727
    28                         <?php if ( function_exists( 'bp_get_total_friend_count' ) ) : ?>
     28                        <?php if ( bp_is_active( 'friends' ) ) : ?>
    2929                            <?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
    3030                                <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' . BP_FRIENDS_SLUG . '/' ?>" title="<?php _e( 'The activity of my friends only.', 'buddypress' ) ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?></a></li>
     
    3434                        <?php do_action( 'bp_before_activity_type_tab_groups' ) ?>
    3535
    36                         <?php if ( function_exists( 'bp_get_total_group_count_for_user' ) ) : ?>
     36                        <?php if ( bp_is_active( 'groups' ) ) : ?>
    3737                            <?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
    3838                                <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/' . BP_GROUPS_SLUG . '/' ?>" title="<?php _e( 'The activity of groups I am a member of.', 'buddypress' ) ?>"><?php printf( __( 'My Groups (%s)', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
  • trunk/bp-themes/bp-default/activity/post-form.php

    r3460 r3698  
    3434            </div>
    3535
    36             <?php if ( function_exists('bp_has_groups') && !bp_is_my_profile() && !bp_is_group() ) : ?>
     36            <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?>
    3737                <div id="whats-new-post-in-box">
    3838                    <?php _e( 'Post in', 'buddypress' ) ?>:
  • trunk/bp-themes/bp-default/groups/create.php

    r3460 r3698  
    4141                    <?php do_action( 'bp_before_group_settings_creation_step' ); ?>
    4242
    43                     <?php if ( function_exists('bp_wire_install') ) : ?>
    44                     <div class="checkbox">
    45                         <label><input type="checkbox" name="group-show-wire" id="group-show-wire" value="1"<?php if ( bp_get_new_group_enable_wire() ) { ?> checked="checked"<?php } ?> /> <?php _e('Enable comment wire', 'buddypress') ?></label>
    46                     </div>
    47                     <?php endif; ?>
    48 
    49                     <?php if ( function_exists('bp_forums_is_installed_correctly') ) : ?>
     43                    <?php if ( bp_is_active( 'forums' ) ) : ?>
    5044                        <?php if ( bp_forums_is_installed_correctly() ) : ?>
    5145                            <div class="checkbox">
     
    157151                    <?php do_action( 'bp_before_group_invites_creation_step' ); ?>
    158152
    159                     <?php if ( function_exists( 'bp_get_total_friend_count' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
     153                    <?php if ( bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
    160154                        <div class="left-menu">
    161155
  • trunk/bp-themes/bp-default/groups/single/admin.php

    r3592 r3698  
    4040    <?php do_action( 'bp_before_group_settings_admin' ); ?>
    4141
    42     <?php if ( function_exists('bp_wire_install') ) : ?>
    43 
    44         <div class="checkbox">
    45             <label><input type="checkbox" name="group-show-wire" id="group-show-wire" value="1"<?php bp_group_show_wire_setting() ?>/> <?php _e( 'Enable comment wire', 'buddypress' ) ?></label>
    46         </div>
    47 
    48     <?php endif; ?>
    49 
    50     <?php if ( function_exists('bp_forums_is_installed_correctly') ) : ?>
     42    <?php if ( bp_is_active( 'forums' ) ) : ?>
    5143
    5244        <?php if ( bp_forums_is_installed_correctly() ) : ?>
  • trunk/bp-themes/bp-default/members/index.php

    r3460 r3698  
    1818                    <li class="selected" id="members-all"><a href="<?php bp_root_domain() ?>"><?php printf( __( 'All Members (%s)', 'buddypress' ), bp_get_total_member_count() ) ?></a></li>
    1919
    20                     <?php if ( is_user_logged_in() && function_exists( 'bp_get_total_friend_count' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
     20                    <?php if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
    2121                        <li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . BP_FRIENDS_SLUG . '/my-friends/' ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?></a></li>
    2222                    <?php endif; ?>
  • trunk/bp-themes/bp-default/members/single/member-header.php

    r3300 r3698  
    1515
    1616    <div id="item-meta">
    17         <?php if ( function_exists( 'bp_activity_latest_update' ) ) : ?>
     17        <?php if ( bp_is_active( 'activity' ) ) : ?>
    1818            <div id="latest-update">
    1919                <?php bp_activity_latest_update( bp_displayed_user_id() ) ?>
  • trunk/bp-themes/bp-default/members/single/profile/profile-loop.php

    r3300 r3698  
    11<?php do_action( 'bp_before_profile_loop_content' ) ?>
    22
    3 <?php if ( function_exists('xprofile_get_profile') ) : ?>
     3<?php if ( bp_is_active( 'xprofile' ) ) : ?>
    44
    55    <?php if ( bp_has_profile() ) : ?>
  • trunk/bp-themes/bp-default/registration/register.php

    r3691 r3698  
    5757
    5858                        <?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
    59                         <?php if ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
     59                        <?php if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    6060
    6161                        <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
  • trunk/bp-themes/bp-default/sidebar.php

    r3466 r3698  
    2323        <?php do_action( 'bp_after_sidebar_me' ) ?>
    2424
    25         <?php if ( function_exists( 'bp_message_get_notices' ) ) : ?>
     25        <?php if ( bp_is_active( 'messages' ) ) : ?>
    2626            <?php bp_message_get_notices(); /* Site wide notices to all users */ ?>
    2727        <?php endif; ?>
     
    6161
    6262            <h3 class="widgettitle"><?php _e( 'Forum Topic Tags', 'buddypress' ) ?></h3>
    63             <?php if ( function_exists('bp_forums_tag_heat_map') ) : ?>
     63            <?php if ( bp_is_active( 'forums' ) ) : ?>
    6464                <div id="tag-text"><?php bp_forums_tag_heat_map(); ?></div>
    6565            <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.