Changeset 373 for trunk/bp-friends.php
- Timestamp:
- 10/07/2008 07:16:51 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/bp-friends.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-friends.php
r359 r373 3 3 4 4 define ( 'BP_FRIENDS_IS_INSTALLED', 1 ); 5 define ( 'BP_FRIENDS_VERSION', '0.1. 3' );5 define ( 'BP_FRIENDS_VERSION', '0.1.4' ); 6 6 7 7 include_once( 'bp-friends/bp-friends-classes.php' ); 8 8 include_once( 'bp-friends/bp-friends-ajax.php' ); 9 9 include_once( 'bp-friends/bp-friends-cssjs.php' ); 10 include_once( 'bp-friends/bp-friends-templatetags.php' ); 11 include_once( 'bp-friends/bp-friends-widgets.php' ); 10 12 /*include_once( 'bp-messages/bp-friends-admin.php' );*/ 11 include_once( 'bp-friends/bp-friends-templatetags.php' );12 13 13 14 14 … … 53 53 $bp['friends'] = array( 54 54 'table_name' => $wpdb->base_prefix . 'bp_friends', 55 'image_base' => get_option('siteurl') . '/wp-content/mu-plugins/bp-friends/images',55 'image_base' => site_url() . '/wp-content/mu-plugins/bp-friends/images', 56 56 'format_activity_function' => 'friends_format_activity', 57 57 'slug' => 'friends' … … 373 373 374 374 if ( BP_Friends_Friendship::accept( $friendship_id ) ) { 375 friends_update_friend_totals( $friendship->initiator_user_id, $friendship->friend_user_id ); 376 375 377 do_action( 'bp_friends_friendship_accepted', array( 'item_id' => $friendship_id, 'component_name' => 'friends', 'component_action' => 'friendship_accepted', 'is_private' => 0, 'dual_record' => true, 'secondary_user_homebase_id' => $secondary_user_homebase_id ) ); 376 378 return true; … … 389 391 } 390 392 393 function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) { 394 if ( $status == 'add' ) { 395 update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) + 1 ); 396 update_usermeta( $friend_user_id, 'total_friend_count', (int)get_usermeta( $friend_user_id, 'total_friend_count' ) + 1 ); 397 } else { 398 update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) - 1 ); 399 update_usermeta( $friend_user_id, 'total_friend_count', (int)get_usermeta( $friend_user_id, 'total_friend_count' ) - 1 ); 400 } 401 } 402 403 function friends_remove_data( $user_id ) { 404 BP_Friends_Friendship::delete_all_for_user($user_id); 405 406 /* Remove usermeta */ 407 delete_usermeta( $user_id, 'total_friend_count' ); 408 } 409 add_action( 'wpmu_delete_user', 'bp_core_remove_data', 1 ); 410 add_action( 'delete_user', 'bp_core_remove_data', 1 ); 411 391 412 392 413 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)