Ticket #2028: 2028.2.diff
File 2028.2.diff, 4.5 KB (added by , 14 years ago) |
---|
-
bp-blogs.php
25 25 // Register this in the active components array 26 26 $bp->active_components[$bp->blogs->slug] = $bp->blogs->id; 27 27 28 // The default text for the blogs directory search box 29 $bp->default_search_strings[$bp->blogs->slug] = __( 'Search Blogs...', 'buddypress' ); 28 // The default text for the blogs directory search box 29 $bp->default_search_strings[$bp->blogs->slug] = __( 'Search Blogs...', 'buddypress' ); 30 30 31 31 do_action( 'bp_blogs_setup_globals' ); 32 32 } … … 291 291 $recorded_blog->blog_id = $blog_id; 292 292 293 293 $recorded_blog_id = $recorded_blog->save(); 294 295 $is_recorded = !empty( $recorded_blog_id ) ? true : false;296 294 295 $is_recorded = !empty( $recorded_blog_id ) ? true : false; 296 297 297 bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'name', $name ); 298 298 bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'description', $description ); 299 299 bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'last_activity', bp_core_current_time() ); 300 300 301 301 $is_private = !empty( $_POST['blog_public'] ) && (int)$_POST['blog_public'] ? false : true; 302 302 303 303 // Only record this activity if the blog is public … … 367 367 if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !bp_core_is_multisite() ) { 368 368 // Record this in activity streams 369 369 $post_permalink = get_permalink( $post_id ); 370 370 371 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>' );372 $activity_action = sprintf( __( '%1$s wrote a new blog post: %2$s on the blog %3$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 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>' );374 $activity_action = sprintf( __( '%1$s wrote a new blog post: %2$s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); 375 375 } 376 376 377 377 $activity_content = $post->post_content; … … 449 449 450 450 // Prepare to record in activity streams 451 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>' );452 $activity_action = sprintf( __( '%1$s commented on the blog post %2$s on the blog %3$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 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>' );454 $activity_action = sprintf( __( '%1$s commented on the blog post %2$s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $post_permalink . '">' . apply_filters( 'the_title', $recorded_comment->post->post_title ) . '</a>' ); 455 455 } 456 456 457 457 $activity_content = $recorded_comment->comment_content; 458 458 459 459 // Record in activity streams 460 460 bp_blogs_record_activity( array( 461 461 'user_id' => $user_id, … … 493 493 494 494 if ( empty( $role ) ) { 495 495 $key = $wpdb->get_blog_prefix( $blog_id ). 'capabilities'; 496 496 497 497 $roles = get_user_meta( $user_id, $key, true ); 498 498 499 499 if ( is_array( $roles ) ) 500 500 $role = array_search( 1, $roles ); 501 501 else … … 785 785 add_action( 'bp_blogs_new_blog', 'bp_core_clear_cache' ); 786 786 add_action( 'bp_blogs_remove_data', 'bp_core_clear_cache' ); 787 787 788 ?> 789 No newline at end of file 788 ?>