Changeset 3419
- Timestamp:
- 11/14/2010 05:28:25 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r3417 r3419 349 349 $user_id = (int)$post->post_author; 350 350 351 /* This is to stop infinite loops with Donncha's sitewide tags plugin */ 352 if ( (int)$bp->site_options['tags_blog_id'] == (int)$blog_id ) 353 return false; 354 355 /* Don't record this if it's not a post */ 356 if ( $post->post_type != 'post' ) 357 return false; 358 359 if ( 'publish' == $post->post_status && '' == $post->post_password ) { 360 if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !is_multisite() ) { 361 /* Record this in activity streams */ 362 $post_permalink = get_permalink( $post_id ); 363 364 $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>' ); 351 // This is to stop infinite loops with Donncha's sitewide tags plugin 352 if ( (int)$blog_id == (int)$bp->site_options['tags_blog_id'] ) 353 return false; 354 355 // Don't record this if it's not a post 356 if ( 'post' != $post->post_type ) 357 return false; 358 359 if ( 'publish' == $post->post_status && empty( $post->post_password ) ) { 360 if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !bp_core_is_multisite() ) { 361 // Record this in activity streams 362 $post_permalink = get_permalink( $post_id ); 363 $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>' ); 365 364 $activity_content = $post->post_content; 366 365 367 366 bp_blogs_record_activity( array( 368 'user_id' => (int)$post->post_author,369 'action' => apply_filters( 'bp_blogs_activity_new_post_action', $activity_action, &$post, $post_permalink ),370 'content' => apply_filters( 'bp_blogs_activity_new_post_content', $activity_content, &$post, $post_permalink ),371 'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ),372 'type' => 'new_blog_post',373 'item_id' => $blog_id,367 'user_id' => (int)$post->post_author, 368 'action' => apply_filters( 'bp_blogs_activity_new_post_action', $activity_action, &$post, $post_permalink ), 369 'content' => apply_filters( 'bp_blogs_activity_new_post_content', $activity_content, &$post, $post_permalink ), 370 'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ), 371 'type' => 'new_blog_post', 372 'item_id' => $blog_id, 374 373 'secondary_item_id' => $post_id, 375 'recorded_time' => $post->post_date_gmt374 'recorded_time' => $post->post_date_gmt 376 375 )); 377 376 } 378 } else 377 378 // Update the blogs last activity 379 bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() ); 380 } else { 379 381 bp_blogs_remove_post( $post_id, $blog_id ); 380 381 bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() ); 382 } 382 383 383 384 do_action( 'bp_blogs_new_blog_post', $post_id, $post, $user_id );
Note: See TracChangeset
for help on using the changeset viewer.