Changeset 4845 for trunk/bp-friends/bp-friends-screens.php
- Timestamp:
- 07/25/2011 12:11:32 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-friends/bp-friends-screens.php
r4822 r4845 21 21 22 22 function friends_screen_requests() { 23 global $bp; 24 25 if ( isset( $bp->action_variables[0] ) && isset( $bp->action_variables[1] ) && 'accept' == $bp->action_variables[0] && is_numeric( $bp->action_variables[1] ) ) { 23 if ( bp_is_action_variable( 'accept', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) { 26 24 // Check the nonce 27 25 check_admin_referer( 'friends_accept_friendship' ); 28 26 29 if ( friends_accept_friendship( $bp->action_variables[1]) )27 if ( friends_accept_friendship( bp_action_variable( 1 ) ) ) 30 28 bp_core_add_message( __( 'Friendship accepted', 'buddypress' ) ); 31 29 else 32 30 bp_core_add_message( __( 'Friendship could not be accepted', 'buddypress' ), 'error' ); 33 31 34 bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action);32 bp_core_redirect( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ); 35 33 36 } elseif ( isset( $bp->action_variables[0] ) && isset( $bp->action_variables[1] ) && 'reject' == $bp->action_variables[0] && is_numeric( $bp->action_variables[1]) ) {34 } elseif ( bp_is_action_variable( 'reject', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) { 37 35 // Check the nonce 38 36 check_admin_referer( 'friends_reject_friendship' ); 39 37 40 if ( friends_reject_friendship( $bp->action_variables[1]) )38 if ( friends_reject_friendship( bp_action_variable( 1 ) ) ) 41 39 bp_core_add_message( __( 'Friendship rejected', 'buddypress' ) ); 42 40 else 43 41 bp_core_add_message( __( 'Friendship could not be rejected', 'buddypress' ), 'error' ); 44 42 45 bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action);43 bp_core_redirect( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ); 46 44 } 47 45 … … 49 47 50 48 if ( isset( $_GET['new'] ) ) 51 bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->friends->id, 'friendship_request' );49 bp_core_delete_notifications_by_type( bp_loggedin_user_id(), 'friends', 'friendship_request' ); 52 50 53 51 bp_core_load_template( apply_filters( 'friends_template_requests', 'members/single/home' ) );
Note: See TracChangeset
for help on using the changeset viewer.