Changeset 3640
- Timestamp:
- 01/01/2011 08:06:28 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r3627 r3640 357 357 358 358 // This is to stop infinite loops with Donncha's sitewide tags plugin 359 if ( (int)$blog_id == (int)$bp->site_options['tags_blog_id'] )359 if ( !empty( $bp->site_options['tags_blog_id'] ) && (int)$blog_id == (int)$bp->site_options['tags_blog_id'] ) 360 360 return false; 361 361 … … 368 368 // Record this in activity streams 369 369 $post_permalink = get_permalink( $post_id ); 370 $activity_action = 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>' ); 370 371 if ( is_multisite() ) { 372 $activity_action = sprintf( __( '%s wrote a new blog post: %s on the blog %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', '<a href="' . get_blog_option( $blog_id, 'home' ) . '">' . get_blog_option( $blog_id, 'blogname' ) . '</a>' ); 373 } else { 374 $activity_action = 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>' ); 375 } 376 371 377 $activity_content = $post->post_content; 372 378 … … 386 392 bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() ); 387 393 } else { 388 bp_blogs_remove_post( $post_id, $blog_id );394 bp_blogs_remove_post( $post_id, $blog_id, $user_id ); 389 395 } 390 396 … … 443 449 444 450 // Prepare to record in activity streams 445 $activity_action = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $post_permalink . '">' . apply_filters( 'the_title', $recorded_comment->post->post_title ) . '</a>' ); 451 if ( is_multisite() ) { 452 $activity_action = sprintf( __( '%s commented on the blog post %s on the blog %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $post_permalink . '">' . apply_filters( 'the_title', $recorded_comment->post->post_title ) . '</a>', '<a href="' . get_blog_option( $blog_id, 'home' ) . '">' . get_blog_option( $blog_id, 'blogname' ) . '</a>' ); 453 } else { 454 $activity_action = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $post_permalink . '">' . apply_filters( 'the_title', $recorded_comment->post->post_title ) . '</a>' ); 455 } 456 446 457 $activity_content = $recorded_comment->comment_content; 447 458 448 459 // Record in activity streams 449 460 bp_blogs_record_activity( array( … … 538 549 add_action( 'remove_user_from_blog', 'bp_blogs_remove_blog_for_user', 10, 2 ); 539 550 540 function bp_blogs_remove_post( $post_id, $blog_id = false ) {551 function bp_blogs_remove_post( $post_id, $blog_id = false, $user_id = false ) { 541 552 global $current_blog, $bp; 542 553 … … 546 557 $blog_id = (int)$current_blog->blog_id; 547 558 559 if ( !$user_id ) 560 $user_id = $bp->loggedin_user->id; 561 548 562 // Delete activity stream item 549 563 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'secondary_item_id' => $post_id, 'component' => $bp->blogs->slug, 'type' => 'new_blog_post' ) ); 550 564 551 do_action( 'bp_blogs_remove_post', $blog_id, $post_id, $ post->user_id );565 do_action( 'bp_blogs_remove_post', $blog_id, $post_id, $user_id ); 552 566 } 553 567 add_action( 'delete_post', 'bp_blogs_remove_post' );
Note: See TracChangeset
for help on using the changeset viewer.