Skip to:
Content

BuddyPress.org

Changeset 1048 for trunk/bp-blogs.php


Ignore:
Timestamp:
02/10/2009 08:50:05 PM (16 years ago)
Author:
apeatling
Message:

Fixes #464

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r1032 r1048  
    268268        break;
    269269        case 'new_blog_post':
    270             $post = new BP_Blogs_Post($item_id);
     270            $post = new BP_Blogs_Post($secondary_item_id);
    271271           
    272272            if ( !$post )
     
    296296                return false;
    297297
    298             $comment = new BP_Blogs_Comment($item_id);
     298            $comment = new BP_Blogs_Comment($secondary_item_id);
    299299           
    300300            if ( !$comment )
     
    432432           
    433433            // Record in activity streams
    434             bp_blogs_record_activity( array( 'item_id' => $recorded_post_id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'is_private' => $is_private, 'user_id' => $recorded_post->user_id ) );
     434            bp_blogs_record_activity( array( 'item_id' => $recorded_post->blog_id, 'secondary_item_id' => $recorded_post_id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'is_private' => $is_private, 'user_id' => $recorded_post->user_id ) );
    435435        }
    436436    } else {
     
    508508               
    509509                // Record in activity streams
    510                 bp_blogs_record_activity( array( 'item_id' => $recorded_commment_id, 'component_name' => 'blogs', 'component_action' => 'new_blog_comment', 'is_private' => $is_private, 'user_id' => $recorded_comment->user_id ) );
     510                bp_blogs_record_activity( array( 'item_id' => $recorded_comment->blog_id, 'secondary_item_id' => $recorded_commment_id, 'component_name' => 'blogs', 'component_action' => 'new_blog_comment', 'is_private' => $is_private, 'user_id' => $recorded_comment->user_id ) );
    511511            }
    512512        } else {
     
    635635
    636636function bp_blogs_remove_data_for_blog( $blog_id ) {
     637    global $bp;
     638   
    637639    /* If this is regular blog, delete all data for that blog. */
    638640    BP_Blogs_Blog::delete_blog_for_all( $blog_id );
    639641    BP_Blogs_Post::delete_posts_for_blog( $blog_id );       
    640642    BP_Blogs_Comment::delete_comments_for_blog( $blog_id );
     643
     644    // Delete activity stream item
     645    bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component_name' => 'blogs', 'component_action' => false, 'user_id' => $bp->loggedin_user->id ) );
    641646
    642647    do_action( 'bp_blogs_remove_data_for_blog', $blog_id );
     
    722727
    723728    if ( !$meta_key ) {
    724         $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->blogs->table_name_blogpmeta . " WHERE blog_id = %d", $blog_id ) );     
     729        $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d", $blog_id ) );     
    725730    } else if ( !$meta_value ) {
    726731        $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d AND meta_key = %s AND meta_value = %s", $blog_id, $meta_key, $meta_value ) );
Note: See TracChangeset for help on using the changeset viewer.