Changeset 5712 for trunk/bp-friends/bp-friends-functions.php
- Timestamp:
- 02/11/2012 04:42:04 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-friends/bp-friends-functions.php
r5676 r5712 1 1 <?php 2 /******************************************************************************** 3 * Business Functions 2 3 /** 4 * BuddyPress Friends Functions 4 5 * 5 * Business functions are where all the magic happens in BuddyPress. They will6 * Functions are where all the magic happens in BuddyPress. They will 6 7 * handle the actual saving or manipulation of information. Usually they will 7 8 * hand off to a database class for data access, then return 8 9 * true or false on success or failure. 10 * 11 * @package BuddyPress 12 * @subpackage FriendsFunctions 9 13 */ 10 14 … … 53 57 54 58 function friends_remove_friend( $initiator_userid, $friend_userid ) { 55 global $bp;56 59 57 60 $friendship_id = BP_Friends_Friendship::get_friendship_id( $initiator_userid, $friend_userid ); … … 138 141 139 142 function friends_check_friendship( $user_id, $possible_friend_id ) { 140 global $bp;141 143 142 144 if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( $user_id, $possible_friend_id ) ) … … 152 154 153 155 function friends_get_total_friend_count( $user_id = 0 ) { 154 global $bp; 155 156 if ( !$user_id ) 156 157 if ( empty( $user_id ) ) 157 158 $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id(); 158 159 … … 182 183 } 183 184 184 function friends_get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false , $filter = false) {185 function friends_get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) { 185 186 return BP_Friends_Friendship::get_friend_user_ids( $user_id, $friend_requests_only, $assoc_arr ); 186 187 } … … 293 294 294 295 function friends_search_users( $search_terms, $user_id, $pag_num = 0, $pag_page = 0 ) { 295 global $bp;296 296 297 297 $user_ids = BP_Friends_Friendship::search_users( $search_terms, $user_id, $pag_num, $pag_page ); 298 298 299 if ( !$user_ids)299 if ( empty( $user_ids ) ) 300 300 return false; 301 301 302 $users = array(); 302 303 for ( $i = 0, $count = count( $user_ids ); $i < $count; ++$i ) 303 304 $users[] = new BP_Core_User( $user_ids[$i] ); … … 312 313 313 314 function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) { 314 global $bp;315 315 316 316 if ( 'add' == $status ) { … … 328 328 do_action( 'friends_before_remove_data', $user_id ); 329 329 330 BP_Friends_Friendship::delete_all_for_user( $user_id);330 BP_Friends_Friendship::delete_all_for_user( $user_id ); 331 331 332 332 // Remove usermeta
Note: See TracChangeset
for help on using the changeset viewer.