Skip to:
Content

BuddyPress.org

Ticket #2028: 2028.2.diff

File 2028.2.diff, 4.5 KB (added by sorich87, 14 years ago)

Argument swapping added

  • bp-blogs.php

     
    2525        // Register this in the active components array
    2626        $bp->active_components[$bp->blogs->slug] = $bp->blogs->id;
    2727
    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' );
    3030
    3131        do_action( 'bp_blogs_setup_globals' );
    3232}
     
    291291        $recorded_blog->blog_id = $blog_id;
    292292
    293293        $recorded_blog_id = $recorded_blog->save();
    294        
    295         $is_recorded = !empty( $recorded_blog_id ) ? true : false;
    296294
     295        $is_recorded = !empty( $recorded_blog_id ) ? true : false;
     296
    297297        bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'name', $name );
    298298        bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'description', $description );
    299299        bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'last_activity', bp_core_current_time() );
    300        
     300
    301301        $is_private = !empty( $_POST['blog_public'] ) && (int)$_POST['blog_public'] ? false : true;
    302302
    303303        // Only record this activity if the blog is public
     
    367367                if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !bp_core_is_multisite() ) {
    368368                        // Record this in activity streams
    369369                        $post_permalink   = get_permalink( $post_id );
    370                        
     370
    371371                        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>' );
    373373                        } 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>' );
    375375                        }
    376376
    377377                        $activity_content = $post->post_content;
     
    449449
    450450                // Prepare to record in activity streams
    451451                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>' );
    453453                } 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>' );
    455455                }
    456                
     456
    457457                $activity_content       = $recorded_comment->comment_content;
    458                
     458
    459459                // Record in activity streams
    460460                bp_blogs_record_activity( array(
    461461                        'user_id'           => $user_id,
     
    493493
    494494        if ( empty( $role ) ) {
    495495                $key = $wpdb->get_blog_prefix( $blog_id ). 'capabilities';
    496                
     496
    497497                $roles = get_user_meta( $user_id, $key, true );
    498                
     498
    499499                if ( is_array( $roles ) )
    500500                        $role = array_search( 1, $roles );
    501501                else
     
    785785add_action( 'bp_blogs_new_blog', 'bp_core_clear_cache' );
    786786add_action( 'bp_blogs_remove_data', 'bp_core_clear_cache' );
    787787
    788 ?>
    789  No newline at end of file
     788?>