Changeset 2381 for trunk/bp-blogs.php
- Timestamp:
- 01/20/2010 04:21:20 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r2328 r2381 246 246 $defaults = array( 247 247 'user_id' => $bp->loggedin_user->id, 248 'content' => false, 249 'primary_link' => false, 250 'component_name' => $bp->blogs->id, 251 'component_action' => false, 248 'action' => '', 249 'content' => '', 250 'primary_link' => '', 251 'component' => $bp->blogs->id, 252 'type' => false, 252 253 'item_id' => false, 253 254 'secondary_item_id' => false, … … 259 260 extract( $r, EXTR_SKIP ); 260 261 261 return bp_activity_add( array( 'user_id' => $user_id, ' content' => $content, 'primary_link' => $primary_link, 'component_name' => $component_name, 'component_action' => $component_action, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );262 return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 262 263 } 263 264 … … 268 269 $defaults = array( 269 270 'item_id' => false, 270 'component _name' => $bp->blogs->id,271 ' component_action' => false,271 'component' => $bp->blogs->id, 272 'type' => false, 272 273 'user_id' => false, 273 274 'secondary_item_id' => false … … 279 280 bp_activity_delete_by_item_id( array( 280 281 'item_id' => $item_id, 281 'component _name' => $component_name,282 ' component_action' => $component_action,282 'component' => $component, 283 'type' => $type, 283 284 'user_id' => $user_id, 284 285 'secondary_item_id' => $secondary_item_id … … 341 342 bp_blogs_record_activity( array( 342 343 'user_id' => $recorded_blog->user_id, 343 ' content' => apply_filters( 'bp_blogs_activity_created_blog', 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>' ), &$recorded_blog, $name, $description ),344 'action' => apply_filters( 'bp_blogs_activity_created_blog_action', 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>' ), &$recorded_blog, $name, $description ), 344 345 'primary_link' => apply_filters( 'bp_blogs_activity_created_blog_primary_link', get_blog_option( $recorded_blog->blog_id, 'siteurl' ), $recorded_blog->blog_id ), 345 ' component_action' => 'new_blog',346 'type' => 'new_blog', 346 347 'item_id' => $recorded_blog->blog_id 347 348 ) ); … … 389 390 $post_permalink = bp_post_get_permalink( $post, $blog_id ); 390 391 391 $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>' );392 $activity_content .= "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>";392 $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>' ); 393 $activity_content = "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>"; 393 394 394 395 bp_blogs_record_activity( array( 395 396 'user_id' => (int)$post->post_author, 396 'content' => apply_filters( 'bp_blogs_activity_new_post', $activity_content, &$post, $post_permalink ), 397 'action' => apply_filters( 'bp_blogs_activity_new_post_action', $activity_action, &$post, $post_permalink ), 398 'content' => apply_filters( 'bp_blogs_activity_new_post_content', $activity_content, &$post, $post_permalink ), 397 399 'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ), 398 ' component_action' => 'new_blog_post',400 'type' => 'new_blog_post', 399 401 'item_id' => $blog_id, 400 402 'secondary_item_id' => $post_id, … … 407 409 408 410 /* Delete and the activity stream item as we are probably going to re-add it later with new info. */ 409 bp_blogs_delete_activity( array( 'item_id' => $existing_post->id, 'component _name' => $bp->blogs->slug, 'component_action' => 'new_blog_post' ) );411 bp_blogs_delete_activity( array( 'item_id' => $existing_post->id, 'component' => $bp->blogs->slug, 'type' => 'new_blog_post' ) ); 410 412 411 413 /* Delete the recorded post if the status is not published or it is password protected */ … … 426 428 $post_permalink = bp_post_get_permalink( $post, $blog_id ); 427 429 428 $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>' );429 $activity_content .= "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>";430 $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>' ); 431 $activity_content = "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>"; 430 432 431 433 /* Record this in activity streams */ 432 434 bp_blogs_record_activity( array( 433 435 'user_id' => (int)$post->post_author, 434 'content' => apply_filters( 'bp_blogs_activity_new_post', $activity_content, &$post, $post_permalink ), 436 'action' => apply_filters( 'bp_blogs_activity_new_post_action', $activity_action, &$post, $post_permalink ), 437 'content' => apply_filters( 'bp_blogs_activity_new_post_content', $activity_content, &$post, $post_permalink ), 435 438 'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ), 436 ' component_action' => 'new_blog_post',439 'type' => 'new_blog_post', 437 440 'item_id' => $blog_id, 438 441 'secondary_item_id' => $existing_post->id, … … 483 486 /* Record in activity streams */ 484 487 $comment_link = bp_post_get_permalink( $comment->post, $wpdb->blogid ) . '#comment-' . $comment_id; 485 $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>' );486 $activity_content .= '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>';488 $activity_action = 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>' ); 489 $activity_content = '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>'; 487 490 488 491 /* Record this in activity streams */ 489 492 bp_blogs_record_activity( array( 490 493 'user_id' => $user_id, 491 'content' => apply_filters( 'bp_blogs_activity_new_comment', $activity_content, &$comment, &$recorded_comment, $comment_link ), 494 'action' => apply_filters( 'bp_blogs_activity_new_comment_action', $activity_action, &$comment, &$recorded_comment, $comment_link ), 495 'content' => apply_filters( 'bp_blogs_activity_new_comment_content', $activity_content, &$comment, &$recorded_comment, $comment_link ), 492 496 'primary_link' => apply_filters( 'bp_blogs_activity_new_comment_primary_link', $comment_link, &$comment, &$recorded_comment ), 493 ' component_action' => 'new_blog_comment',497 'type' => 'new_blog_comment', 494 498 'item_id' => $wpdb->blogid, 495 499 'secondary_item_id' => $comment_id, … … 530 534 531 535 // Delete activity stream item 532 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component _name' => $bp->blogs->slug, 'component_action' => 'new_blog' ) );536 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->slug, 'type' => 'new_blog' ) ); 533 537 534 538 do_action( 'bp_blogs_remove_blog', $blog_id ); … … 545 549 546 550 // Delete activity stream item 547 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component _name' => $bp->blogs->slug, 'component_action' => 'new_blog' ) );551 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->slug, 'type' => 'new_blog' ) ); 548 552 549 553 do_action( 'bp_blogs_remove_blog_for_user', $blog_id, $user_id ); … … 566 570 567 571 // Delete activity stream item 568 bp_blogs_delete_activity( array( 'item_id' => $wpdb->blogid, 'component _name' => $existing_post->id, 'component_action' => 'new_blog_post' ) );572 bp_blogs_delete_activity( array( 'item_id' => $wpdb->blogid, 'component' => $existing_post->id, 'type' => 'new_blog_post' ) ); 569 573 570 574 do_action( 'bp_blogs_remove_post', $blog_id, $post_id, $post->user_id ); … … 579 583 580 584 // Delete activity stream item 581 bp_blogs_delete_activity( array( 'item_id' => $wpdb->blogid, 'secondary_item_id' => $comment_id, ' component_action' => 'new_blog_comment' ) );585 bp_blogs_delete_activity( array( 'item_id' => $wpdb->blogid, 'secondary_item_id' => $comment_id, 'type' => 'new_blog_comment' ) ); 582 586 583 587 do_action( 'bp_blogs_remove_comment', $blog_id, $comment_id, $bp->loggedin_user->id ); … … 608 612 609 613 // Delete activity stream item 610 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component _name' => $bp->blogs->slug, 'component_action' => false ) );614 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->slug, 'type' => false ) ); 611 615 612 616 do_action( 'bp_blogs_remove_data_for_blog', $blog_id );
Note: See TracChangeset
for help on using the changeset viewer.