Skip to:
Content

BuddyPress.org

Changeset 1067


Ignore:
Timestamp:
02/12/2009 02:18:42 AM (17 years ago)
Author:
apeatling
Message:

Fixed bug around recording of password protected posts.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-classes.php

    r1062 r1067  
    100100            $cached_component_action_sql = $wpdb->prepare( "AND component_action = %s", $component_action );
    101101        }
    102        
    103         error_log( $component_action );
    104        
    105         error_log( $wpdb->prepare( "DELETE FROM {$wpdb->base_prefix}user_{$user_id}_activity WHERE item_id = %d {$secondary_sql} AND component_name = %s {$component_action_sql}", $item_id, $component_name ) );
    106         error_log( $wpdb->prepare( "DELETE FROM {$wpdb->base_prefix}user_{$user_id}_activity_cached WHERE item_id = %d {$secondary_sql} AND component_name = %s {$cached_component_action_sql}", $item_id, $component_name ) );
    107         error_log( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_sitewide} WHERE item_id = %d {$secondary_sql} AND component_name = %s {$component_action_sql}", $item_id, $component_name ) );
    108        
     102               
    109103        $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->base_prefix}user_{$user_id}_activity WHERE item_id = %d {$secondary_sql} AND component_name = %s {$component_action_sql}", $item_id, $component_name ) );
    110104               
     
    112106        $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->base_prefix}user_{$user_id}_activity_cached WHERE item_id = %d {$secondary_sql} AND component_name = %s {$cached_component_action_sql}", $item_id, $component_name ) );
    113107        $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name_sitewide} WHERE item_id = %d {$secondary_sql} AND component_name = %s {$component_action_sql}", $item_id, $component_name ) );
    114        
     108
    115109        return true;
    116110    }
  • trunk/bp-blogs.php

    r1052 r1067  
    88
    99/* These will be moved into admin configurable settings */
    10 define ( 'TOTAL_RECORDED_POSTS', 10 );
    11 define ( 'TOTAL_RECORDED_COMMENTS', 25 );
     10define ( 'TOTAL_RECORDED_POSTS', 150 );
     11define ( 'TOTAL_RECORDED_COMMENTS', 500 );
    1212
    1313include_once( 'bp-blogs/bp-blogs-classes.php' );
     
    410410   
    411411    if ( !$is_recorded = BP_Blogs_Post::is_recorded( $post_id, $blog_id, $user_id ) ) {
    412         if ( 'publish' == $post->post_status ) {
     412        if ( 'publish' == $post->post_status && '' == $post->post_password ) {
    413413           
    414414            /**
     
    442442         *  - The post is password protected
    443443         */
    444         if ( $post->post_status != 'publish' || $post->post_password != '' )
     444        if ( 'publish' != $post->post_status || '' != $post->post_password )
    445445            bp_blogs_remove_post( $post_id, $blog_id );
    446446       
     
    606606    // Delete post from the bp_blogs table
    607607    BP_Blogs_Post::delete( $post_id, $blog_id );
    608    
     608       
    609609    // Delete activity stream item
    610     bp_blogs_delete_activity( array( 'item_id' => $post->id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'user_id' => $post->user_id ) );
     610    bp_blogs_delete_activity( array( 'item_id' => $post->blog_id, 'secondary_item_id' => $post->id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'user_id' => $post->user_id ) );
    611611
    612612    do_action( 'bp_blogs_remove_post', $blog_id, $post_id );
     
    628628
    629629    // Delete activity stream item
    630     bp_blogs_delete_activity( array( 'item_id' => $comment_id, 'component_name' => 'blogs', 'component_action' => 'new_blog_comment', 'user_id' => $bp->loggedin_user->id ) );
     630    bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'secondary_item_id' => $comment_id, 'component_name' => 'blogs', 'component_action' => 'new_blog_comment', 'user_id' => $bp->loggedin_user->id ) );
    631631
    632632    do_action( 'bp_blogs_remove_comment', $blog_id, $comment_id );
  • trunk/bp-core.php

    r1063 r1067  
    982982        return false;
    983983   
    984     if ( time() >= strtotime( '+5 minutes', get_usermeta( $bp->loggedin_user->id, 'last_activity' ) ) || '' == get_usermeta( $bp->loggedin_user->id, 'last_activity' ) ) {
    985         // Updated last site activity for this user.
     984    if ( '' == get_usermeta( $bp->loggedin_user->id, 'last_activity' ) )
     985        update_usermeta( $bp->loggedin_user->id, 'last_activity', time() );     
     986   
     987    if ( time() >= strtotime( '+5 minutes', get_usermeta( $bp->loggedin_user->id, 'last_activity' ) ) )
    986988        update_usermeta( $bp->loggedin_user->id, 'last_activity', time() );
    987     }
    988989}
    989990add_action( 'wp_head', 'bp_core_record_activity' );
Note: See TracChangeset for help on using the changeset viewer.