<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[BuddyPress] [1794] trunk/bp-blogs.php: Fixed all comment/post/
blog recording and deletion functions.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>1794</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-09-04 22:42:52 +0000 (Fri, 04 Sep 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fixed all comment/post/blog recording and deletion functions. Fixes #772</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpblogsphp">trunk/bp-blogs.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpblogsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs.php (1793 => 1794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs.php        2009-09-04 21:09:33 UTC (rev 1793)
+++ trunk/bp-blogs.php        2009-09-04 22:42:52 UTC (rev 1794)
</span><span class="lines">@@ -263,9 +263,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function bp_blogs_delete_activity( $args = true ) {
</span><del>-        if ( function_exists('bp_activity_delete') ) {
</del><ins>+        if ( function_exists('bp_activity_delete_by_item_id') ) {
</ins><span class="cx">                 extract($args);
</span><del>-                bp_activity_delete_by_item_id( $item_id, $component_name, $component_action, $user_id, $secondary_item_id );
</del><ins>+                
+                bp_activity_delete_by_item_id( array(
+                        'item_id' => $item_id,
+                        'component_name' => $component_name,
+                        'component_action' => $component_action,
+                        'user_id' => $user_id,
+                        'secondary_item_id' => $secondary_item_id
+                ) );
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -299,7 +306,7 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-function bp_blogs_record_blog( $blog_id, $user_id ) {
</del><ins>+function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) {
</ins><span class="cx">         global $bp;
</span><span class="cx">         
</span><span class="cx">         if ( !$user_id )
</span><span class="lines">@@ -311,42 +318,38 @@
</span><span class="cx">         $recorded_blog = new BP_Blogs_Blog;
</span><span class="cx">         $recorded_blog->user_id = $user_id;
</span><span class="cx">         $recorded_blog->blog_id = $blog_id;
</span><del>-        
</del><ins>+
</ins><span class="cx">         $recorded_blog_id = $recorded_blog->save();
</span><span class="cx">         
</span><span class="cx">         bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'name', $name );
</span><span class="cx">         bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'description', $description );
</span><span class="cx">         bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'last_activity', time() );
</span><span class="cx">         
</span><del>-        if ( (int)$_POST['blog_public'] )
-                $is_private = 0;
-        else
-                $is_private = 1;
</del><ins>+        /* Only record this activity if the blog is public */
+        if ( (int)$_POST['blog_public'] && !$no_activity ) {        
+                /* Record this in activity streams */
+                bp_blogs_record_activity( array(
+                        'user_id' => $recorded_blog->user_id,
+                        'content' => sprintf( __( '%s created the blog %s', 'buddypress'), bp_core_get_userlink( $recorded_blog->user_id ), '<a href="' . get_blog_option( $recorded_blog->blog_id, 'siteurl' ) . '">' . attribute_escape( $name ) . '</a>' ),
+                        'primary_link' => get_blog_option( $recorded_blog->blog_id, 'siteurl' ),
+                        'component_action' => 'new_blog',
+                        'item_id' => $recorded_blog->blog_id
+                ) );
+        }
</ins><span class="cx">         
</span><del>-        /* Record this in activity streams */
-        bp_blogs_record_activity( array(
-                'user_id' => $recorded_blog->user_id,
-                'content' => sprintf( __( '%s created the blog %s', 'buddypress'), bp_core_get_userlink( $recorded_blog->user_id ), '<a href="' . get_blog_option( $recorded_blog->blog_id, 'siteurl' ) . '">' . attribute_escape( $name ) . '</a>' ),
-                'primary_link' => get_blog_option( $recorded_blog->blog_id, 'siteurl' ),
-                'component_action' => 'new_blog',
-                'item_id' => $recorded_blog_id
-        ) );
-        
-        do_action( 'bp_blogs_new_blog', $recorded_blog, $is_private, $is_recorded );
</del><ins>+        do_action( 'bp_blogs_new_blog', &$recorded_blog, $is_private, $is_recorded );
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'wpmu_new_blog', 'bp_blogs_record_blog', 10, 2 );
</span><span class="cx">
</span><del>-function bp_blogs_record_post( $post_id, $blog_id = false, $user_id = false ) {
</del><ins>+function bp_blogs_record_post( $post_id, $post, $user_id = false ) {
</ins><span class="cx">         global $bp, $wpdb;
</span><span class="cx">         
</span><span class="cx">         $post_id = (int)$post_id;
</span><del>-        $post = get_post($post_id);
</del><ins>+        $blog_id = (int)$wpdb->blogid;
</ins><span class="cx">         
</span><span class="cx">         if ( !$user_id )
</span><span class="cx">                 $user_id = (int)$post->post_author;
</span><del>-                
-        if ( !$blog_id )
-                $blog_id = (int)$wpdb->blogid;
</del><ins>+
</ins><span class="cx">         
</span><span class="cx">         /* This is to stop infinate loops with Donncha's sitewide tags plugin */
</span><span class="cx">         if ( (int)get_site_option('tags_blog_id') == (int)$blog_id )
</span><span class="lines">@@ -363,7 +366,7 @@
</span><span class="cx">                         $recorded_post->user_id = $user_id;
</span><span class="cx">                         $recorded_post->blog_id = $blog_id;
</span><span class="cx">                         $recorded_post->post_id = $post_id;
</span><del>-                        $recorded_post->date_created = strtotime( $post->post_date_gmt );
</del><ins>+                        $recorded_post->date_created = strtotime( $post->post_date );
</ins><span class="cx">                         
</span><span class="cx">                         $recorded_post_id = $recorded_post->save();
</span><span class="cx">                         
</span><span class="lines">@@ -371,56 +374,59 @@
</span><span class="cx">
</span><span class="cx">                         $post_permalink = bp_post_get_permalink( $post, $blog_id );
</span><span class="cx">
</span><ins>+                        $activity_content = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
+                        $activity_content .= "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>";
+                        
</ins><span class="cx">                         /* Record this in activity streams */
</span><span class="cx">                         bp_blogs_record_activity( array(
</span><span class="cx">                                 'user_id' => (int)$post->post_author,
</span><del>-                                'content' => sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ),
</del><ins>+                                'content' => $activity_content,
</ins><span class="cx">                                 'primary_link' => $post_permalink,
</span><span class="cx">                                 'component_action' => 'new_blog_post',
</span><del>-                                'item_id' => $recorded_post->id,
-                                'recorded_time' => $recorded_post->date_created
</del><ins>+                                'item_id' => $recorded_post_id,
+                                'recorded_time' => strtotime( $post->post_date )
</ins><span class="cx">                         ) );
</span><span class="cx">                 }
</span><span class="cx">         } else {
</span><span class="cx">                 $existing_post = new BP_Blogs_Post( null, $blog_id, $post_id );
</span><span class="cx">
</span><del>-                /**
-                 * Delete the recorded post if:
-                 * - The status is no longer "published"
-                 * - The post is password protected
-                 */
-                if ( 'publish' != $post->post_status || '' != $post->post_password )
-                        bp_blogs_remove_post( $post_id, $blog_id );
</del><ins>+                /* Delete and the activity stream item as we are probably going to re-add it later with new info. */
+                bp_blogs_delete_activity( array( 'item_id' => $existing_post->id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_post' ) );
+
+                /* Delete the recorded post if the status is not published or it is password protected */
+                if ( 'publish' != $post->post_status || '' != $post->post_password ) {
+                        return bp_blogs_remove_post( $post_id, $blog_id, $existing_post );                        
</ins><span class="cx">                 
</span><del>-                // Check to see if the post author has changed.
-                if ( (int)$existing_post->user_id != (int)$post->post_author ) {
</del><ins>+                /* If the post author has changed, delete the post and re-add it. */
+                } else if ( (int)$existing_post->user_id != (int)$post->post_author ) {
</ins><span class="cx">                         // Delete the existing recorded post
</span><del>-                        bp_blogs_remove_post( $post_id, $blog_id );
</del><ins>+                        bp_blogs_remove_post( $post_id, $blog_id, $existing_post );
</ins><span class="cx">                         
</span><span class="cx">                         // Re-record the post with the new author.
</span><del>-                        bp_blogs_record_post( $post_id );
</del><ins>+                        bp_blogs_record_post( $post_id );                                
</ins><span class="cx">                 }
</span><span class="cx">                 
</span><ins>+                /* Now re-record the post in the activity streams */                
</ins><span class="cx">                 $post_permalink = bp_post_get_permalink( $post, $blog_id );
</span><span class="cx">                 
</span><del>-                /* Delete and re-add the activity stream item to reflect potential content changes. */
-                bp_blogs_delete_activity( array( 'item_id' => $recorded_post->id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_post', 'user_id' => $recorded_post->user_id ) );
</del><span class="cx">
</span><ins>+                $activity_content = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
+                $activity_content .= "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>";
+                
</ins><span class="cx">                 /* Record this in activity streams */
</span><span class="cx">                 bp_blogs_record_activity( array(
</span><span class="cx">                         'user_id' => (int)$post->post_author,
</span><del>-                        'content' => sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ),
</del><ins>+                        'content' => $activity_content,
</ins><span class="cx">                         'primary_link' => $post_permalink,
</span><span class="cx">                         'component_action' => 'new_blog_post',
</span><span class="cx">                         'item_id' => $existing_post->id,
</span><del>-                        'recorded_time' => $existing_post->date_created
</del><ins>+                        'recorded_time' => strtotime( $post->post_date )
</ins><span class="cx">                 ) );
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         do_action( 'bp_blogs_new_blog_post', $existing_post, $is_private, $is_recorded );
</span><span class="cx"> }
</span><del>-add_action( 'publish_post', 'bp_blogs_record_post' );
-add_action( 'edit_post', 'bp_blogs_record_post' );
</del><ins>+add_action( 'save_post', 'bp_blogs_record_post', 10, 2 );
</ins><span class="cx">
</span><span class="cx"> function bp_blogs_record_comment( $comment_id, $is_approved ) {
</span><span class="cx">         global $wpdb, $bp;
</span><span class="lines">@@ -429,6 +435,7 @@
</span><span class="cx">                 return false;
</span><span class="cx">                 
</span><span class="cx">         $comment = get_comment($comment_id);
</span><ins>+        $comment->post = get_post( $comment->comment_post_ID );
</ins><span class="cx">         
</span><span class="cx">         /* Get the user_id from the author email. */
</span><span class="cx">         $user = get_user_by_email( $comment->comment_author_email );
</span><span class="lines">@@ -442,25 +449,28 @@
</span><span class="cx">         $recorded_comment->blog_id = $wpdb->blogid;
</span><span class="cx">         $recorded_comment->comment_id = $comment_id;
</span><span class="cx">         $recorded_comment->comment_post_id = $comment->comment_post_ID;
</span><del>-        $recorded_comment->date_created = strtotime( $comment->comment_date_gmt );
</del><ins>+        $recorded_comment->date_created = strtotime( $comment->comment_date );
</ins><span class="cx">
</span><span class="cx">         $recorded_commment_id = $recorded_comment->save();
</span><span class="cx">         
</span><span class="cx">         bp_blogs_update_blogmeta( $recorded_comment->blog_id, 'last_activity', time() );
</span><span class="cx">
</span><span class="cx">         $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id );
</span><del>-        $content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ) . ' <span class="time-since">%s</span>';                        
-        $content .= '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>';
</del><ins>+        $activity_content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' );                        
+        $activity_content .= '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>';
</ins><span class="cx">
</span><span class="cx">         /* Record this in activity streams */
</span><span class="cx">         bp_blogs_record_activity( array(
</span><span class="cx">                 'user_id' => $recorded_comment->user_id,
</span><del>-                'content' => $content,
</del><ins>+                'content' => $activity_content,
</ins><span class="cx">                 'primary_link' => $comment_link,
</span><span class="cx">                 'component_action' => 'new_blog_comment',
</span><del>-                'item_id' => $recorded_comment->blog_id,
-                'recorded_time' => $recorded_comment->date_created
</del><ins>+                'item_id' => $comment_id,
+                'secondary_item_id' => $recorded_comment->blog_id,
+                'recorded_time' => $recorded_comment->date_created
</ins><span class="cx">         ) );
</span><ins>+        
+        return $recorded_comment;
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'comment_post', 'bp_blogs_record_comment', 10, 2 );
</span><span class="cx">
</span><span class="lines">@@ -469,11 +479,12 @@
</span><span class="cx">
</span><span class="cx">         $recorded_comment = bp_blogs_record_comment( $comment_id, true );
</span><span class="cx">         $comment = get_comment($comment_id);
</span><ins>+        $comment->post = get_post( $comment->comment_post_ID );
+        
+        bp_blogs_delete_activity( array( 'item_id' => $comment_id, 'secondary_item_id' => $recorded_comment->blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_comment' ) );
</ins><span class="cx">
</span><del>-        bp_blogs_delete_activity( array( 'item_id' => $recorded_comment->blog_id, 'secondary_item_id' => $recorded_commment_id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_comment', 'user_id' => $recorded_comment->user_id ) );
-
</del><span class="cx">         $comment_link = bp_post_get_permalink( $comment->post, $comment->blog_id );
</span><del>-        $content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ) . ' <span class="time-since">%s</span>';                        
</del><ins>+        $content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $recorded_comment->user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' );                        
</ins><span class="cx">         $content .= '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>';
</span><span class="cx">
</span><span class="cx">         /* Record this in activity streams */
</span><span class="lines">@@ -482,7 +493,8 @@
</span><span class="cx">                 'content' => $content,
</span><span class="cx">                 'primary_link' => $comment_link,
</span><span class="cx">                 'component_action' => 'new_blog_comment',
</span><del>-                'item_id' => $recorded_comment->blog_id,
</del><ins>+                'item_id' => $comment_id,
+                'secondary_item_id' => $recorded_comment->blog_id,
</ins><span class="cx">                 'recorded_time' => $recorded_comment->date_created
</span><span class="cx">         ) );
</span><span class="cx"> }
</span><span class="lines">@@ -497,7 +509,7 @@
</span><span class="cx">
</span><span class="cx"> function bp_blogs_add_user_to_blog( $user_id, $role, $blog_id ) {
</span><span class="cx">         if ( $role != 'subscriber' ) {
</span><del>-                bp_blogs_record_blog( $blog_id, $user_id );
</del><ins>+                bp_blogs_record_blog( $blog_id, $user_id, $no_activity = true );
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> add_action( 'add_user_to_blog', 'bp_blogs_add_user_to_blog', 10, 3 );
</span><span class="lines">@@ -515,7 +527,7 @@
</span><span class="cx">         BP_Blogs_Blog::delete_blog_for_all( $blog_id );
</span><span class="cx">         
</span><span class="cx">         // Delete activity stream item
</span><del>-        bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog', 'user_id' => $bp->loggedin_user->id ) );
</del><ins>+        bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog' ) );
</ins><span class="cx">         
</span><span class="cx">         do_action( 'bp_blogs_remove_blog', $blog_id );
</span><span class="cx"> }
</span><span class="lines">@@ -530,25 +542,28 @@
</span><span class="cx">         BP_Blogs_Blog::delete_blog_for_user( $blog_id, $user_id );
</span><span class="cx">
</span><span class="cx">         // Delete activity stream item
</span><del>-        bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog', 'user_id' => $current_user->ID ) );
</del><ins>+        bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog' ) );
</ins><span class="cx">
</span><span class="cx">         do_action( 'bp_blogs_remove_blog_for_user', $blog_id, $user_id );
</span><span class="cx"> }
</span><span class="cx"> add_action( 'remove_user_from_blog', 'bp_blogs_remove_blog_for_user', 10, 2 );
</span><span class="cx">
</span><del>-function bp_blogs_remove_post( $post_id ) {
</del><ins>+function bp_blogs_remove_post( $post_id, $blog_id = false, $existing_post = false ) {
</ins><span class="cx">         global $current_blog, $bp;
</span><span class="cx">
</span><span class="cx">         $post_id = (int)$post_id;
</span><del>-        $blog_id = (int)$current_blog->blog_id;
</del><span class="cx">         
</span><del>-        $post = new BP_Blogs_Post( null, $blog_id, $post_id );
</del><ins>+        if ( !$blog_id )
+                $blog_id = (int)$current_blog->blog_id;
+        
+        if ( !$existing_post )
+                $existing_post = new BP_Blogs_Post( null, $blog_id, $post_id );
</ins><span class="cx">
</span><span class="cx">         // Delete post from the bp_blogs table
</span><span class="cx">         BP_Blogs_Post::delete( $post_id, $blog_id );
</span><span class="cx">                 
</span><span class="cx">         // Delete activity stream item
</span><del>-        bp_blogs_delete_activity( array( 'item_id' => $post->id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_post', 'user_id' => $post->user_id ) );
</del><ins>+        bp_blogs_delete_activity( array( 'item_id' => $existing_post->id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_post' ) );
</ins><span class="cx">
</span><span class="cx">         do_action( 'bp_blogs_remove_post', $blog_id, $post_id, $post->user_id );
</span><span class="cx"> }
</span><span class="lines">@@ -561,7 +576,7 @@
</span><span class="cx">         BP_Blogs_Comment::delete( $comment_id, $wpdb->blogid );        
</span><span class="cx">
</span><span class="cx">         // Delete activity stream item
</span><del>-        bp_blogs_delete_activity( array( 'item_id' => $recorded_comment->blog_id, 'secondary_item_id' => $recorded_comment->id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_comment', 'user_id' => $recorded_comment->user_id ) );
</del><ins>+        bp_blogs_delete_activity( array( 'item_id' => $comment_id, 'secondary_item_id' => $recorded_comment->blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_comment' ) );
</ins><span class="cx">
</span><span class="cx">         do_action( 'bp_blogs_remove_comment', $blog_id, $comment_id, $bp->loggedin_user->id );
</span><span class="cx"> }
</span><span class="lines">@@ -576,7 +591,7 @@
</span><span class="cx">         BP_Blogs_Comment::delete_comments_for_blog( $blog_id );
</span><span class="cx">
</span><span class="cx">         // Delete activity stream item
</span><del>-        bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => false, 'user_id' => $bp->loggedin_user->id ) );
</del><ins>+        bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => false ) );
</ins><span class="cx">
</span><span class="cx">         do_action( 'bp_blogs_remove_data_for_blog', $blog_id );
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>