Skip to:
Content

BuddyPress.org

Changeset 1245


Ignore:
Timestamp:
03/19/2009 09:26:24 PM (16 years ago)
Author:
apeatling
Message:

Fixes #584

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r1238 r1245  
    10771077    return $wpdb->get_var( $wpdb->prepare( "SELECT path FROM {$wpdb->base_prefix}site WHERE id = 1") );
    10781078}
    1079 
    10801079
    10811080function bp_core_redirect( $location, $status = 302 ) {
     
    13611360    /* Remove usermeta */
    13621361    delete_usermeta( $user_id, 'last_activity' );
     1362
     1363    /* Flush the cache to remove the user from all cached objects */
    13631364    wp_cache_flush();
    13641365}
  • trunk/bp-core/bp-core-classes.php

    r1138 r1245  
    309309    }
    310310   
     311    function delete_from_user_by_type( $user_id, $component_name, $component_action ) {
     312        global $wpdb, $bp;
     313       
     314        return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE item_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) );
     315    }
     316   
    311317    function delete_all_by_type( $item_id, $component_name, $component_action, $secondary_item_id ) {
    312318        global $wpdb, $bp;
  • trunk/bp-core/bp-core-notifications.php

    r1082 r1245  
    8585}
    8686
     87function bp_core_delete_notifications_from_user( $user_id, $component_name, $component_action ) {
     88    return BP_Core_Notification::delete_from_user_by_type( $user_id, $component_name, $component_action );
     89}
     90
    8791function bp_core_check_notification_access( $user_id, $notification_id ) {
    8892    if ( !BP_Core_Notification::check_access( $user_id, $notification_id ) )
  • trunk/bp-friends.php

    r1238 r1245  
    613613    /* Remove usermeta */
    614614    delete_usermeta( $user_id, 'total_friend_count' );
     615   
     616    /* Remove friendship requests FROM user */
     617    bp_core_delete_notifications_from_user( $user_id, $bp->friends->slug, 'friendship_request' );
    615618
    616619    do_action( 'friends_remove_data', $user_id );
  • trunk/bp-xprofile.php

    r1238 r1245  
    852852    $field->user_id = $user_id;
    853853    $field->value = $value;
    854 
     854   
    855855    return $field->save();
    856856}
Note: See TracChangeset for help on using the changeset viewer.