Changeset 1389
- Timestamp:
- 04/22/2009 07:00:12 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/bp-blogs.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r1388 r1389 358 358 function bp_blogs_record_blog( $blog_id, $user_id ) { 359 359 global $bp; 360 361 if ( !$bp ) { 362 bp_core_setup_globals(); 363 bp_blogs_setup_globals(); 364 } 365 360 366 361 if ( !$user_id ) 367 362 $user_id = $bp->loggedin_user->id; … … 394 389 function bp_blogs_record_post( $post_id, $blog_id = false, $user_id = false ) { 395 390 global $bp, $wpdb; 396 397 if ( !$bp ) {398 bp_core_setup_globals();399 bp_blogs_setup_globals();400 }401 391 402 392 $post_id = (int)$post_id; … … 429 419 430 420 bp_blogs_update_blogmeta( $recorded_post->blog_id, 'last_activity', time() ); 431 432 if ( strtotime( $recorded_post->date_created ) >= strtotime( "-24 hours" ) ) { 433 // Record in activity streams, but only if the post is 30 minutes 434 // old or less (stops old posts registering as new posts in activity streams when a comment is posted on them) 435 bp_blogs_record_activity( array( 'item_id' => $recorded_post->id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'is_private' => bp_blogs_is_blog_hidden( $recorded_post->blog_id ), 'user_id' => $recorded_post->user_id ) ); 436 } 421 bp_blogs_record_activity( array( 'item_id' => $recorded_post->id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'is_private' => bp_blogs_is_blog_hidden( $recorded_post->blog_id ), 'user_id' => $recorded_post->user_id, 'recorded_time' => strtotime( $post->post_date ) ) ); 437 422 } 438 423 } else { … … 466 451 } 467 452 add_action( 'publish_post', 'bp_blogs_record_post' ); 453 add_action( 'edit_post', 'bp_blogs_record_post' ); 454 468 455 469 456 function bp_blogs_record_comment( $comment_id, $is_approved ) { … … 527 514 function bp_blogs_remove_blog( $blog_id ) { 528 515 global $bp; 529 530 if ( !$bp ) { 531 bp_core_setup_globals(); 532 bp_blogs_setup_globals(); 533 } 534 516 535 517 $blog_id = (int)$blog_id; 536 518 … … 561 543 function bp_blogs_remove_post( $post_id ) { 562 544 global $current_blog, $bp; 563 564 if ( !$bp ) { 565 bp_core_setup_globals(); 566 bp_blogs_setup_globals(); 567 } 568 545 569 546 $post_id = (int)$post_id; 570 547 $blog_id = (int)$current_blog->blog_id; … … 576 553 577 554 // Delete activity stream item 578 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 ) );555 bp_blogs_delete_activity( array( 'item_id' => $post->id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'user_id' => $post->user_id ) ); 579 556 580 557 do_action( 'bp_blogs_remove_post', $blog_id, $post_id, $post->user_id ); … … 584 561 function bp_blogs_remove_comment( $comment_id ) { 585 562 global $wpdb, $bp; 586 587 if ( !$bp ) { 588 bp_core_setup_globals(); 589 bp_blogs_setup_globals(); 590 } 591 563 592 564 $recorded_comment = new BP_Blogs_Comment( false, $wpdb->blogid, $comment_id ); 593 565 BP_Blogs_Comment::delete( $comment_id, $wpdb->blogid );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)