Changeset 2919 for trunk/bp-core/bp-core-classes.php
- Timestamp:
- 04/13/2010 04:01:07 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-classes.php
r2695 r2919 56 56 */ 57 57 function populate() { 58 if ( function_exists( 'xprofile_install' ) )58 if ( bp_is_active( 'xprofile' ) ) 59 59 $this->profile_data = $this->get_profile_data(); 60 60 … … 86 86 global $bp; 87 87 88 if ( function_exists('friends_install') )88 if ( bp_is_active( 'friends' ) ) 89 89 $this->total_friends = BP_Friends_Friendship::total_friend_count( $this->id ); 90 90 91 if ( function_exists('groups_install') ) {91 if ( bp_is_active( 'groups' ) ) { 92 92 $this->total_groups = BP_Groups_Member::total_group_count( $this->id ); 93 93 … … 125 125 $sql['from'] = "FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN " . CUSTOM_USER_META_TABLE . " um ON um.user_id = u.ID"; 126 126 127 if ( $search_terms && function_exists( 'xprofile_install' ) || 'alphabetical' == $type )127 if ( $search_terms && bp_is_active( 'xprofile' ) || 'alphabetical' == $type ) 128 128 $sql['join_profiledata'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id"; 129 129 … … 142 142 $sql['where_alpha'] = "AND pd.field_id = 1"; 143 143 144 if ( $user_id && function_exists( 'friends_install' ) ) {144 if ( $user_id && bp_is_active( 'friends' ) ) { 145 145 $friend_ids = friends_get_friend_user_ids( $user_id ); 146 146 $friend_ids = $wpdb->escape( implode( ',', (array)$friend_ids ) ); … … 154 154 } 155 155 156 if ( $search_terms && function_exists( 'xprofile_install' ) ) {156 if ( $search_terms && bp_is_active( 'xprofile' ) ) { 157 157 $search_terms = like_escape( $wpdb->escape( $search_terms ) ); 158 158 $sql['where_searchterms'] = "AND pd.value LIKE '%%$search_terms%%'"; … … 320 320 321 321 /* Fetch the user's full name */ 322 if ( function_exists( 'xprofile_install' ) && 'alphabetical' != $type ) {322 if ( bp_is_active( 'xprofile' ) && 'alphabetical' != $type ) { 323 323 $names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id as id, pd.value as fullname FROM {$bp->profile->table_name_fields} pf, {$bp->profile->table_name_data} pd WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} )", BP_XPROFILE_FULLNAME_FIELD_NAME ) ); 324 324 for ( $i = 0; $i < count( $paged_users ); $i++ ) { … … 342 342 343 343 /* Fetch whether or not the user is a friend */ 344 if ( function_exists( 'friends_install' ) ) {344 if ( bp_is_active( 'friends' ) ) { 345 345 $friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", $bp->loggedin_user->id, $bp->loggedin_user->id ) ); 346 346 for ( $i = 0; $i < count( $paged_users ); $i++ ) { … … 381 381 } 382 382 } 383 384 var_dump( $paged_users ); 383 385 384 386 return $paged_users;
Note: See TracChangeset
for help on using the changeset viewer.