Changeset 2209 for trunk/bp-blogs.php
- Timestamp:
- 12/27/2009 10:41:10 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r2179 r2209 65 65 // On first installation - record all existing blogs in the system. 66 66 if ( !(int)get_site_option( 'bp-blogs-first-install') ) { 67 68 67 bp_blogs_record_existing_blogs(); 69 68 add_site_option( 'bp-blogs-first-install', 1 ); 70 71 } else {72 73 // Import blog titles and descriptions into the blogmeta table74 if ( get_site_option( 'bp-blogs-version' ) <= '0.1.5' ) {75 $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM " . $bp->blogs->table_name ) );76 77 for ( $i = 0; $i < count($blog_ids); $i++ ) {78 $name = get_blog_option( $blog_ids[$i], 'blogname' );79 $desc = get_blog_option( $blog_ids[$i], 'blogdescription' );80 81 bp_blogs_update_blogmeta( $blog_ids[$i], 'name', $name );82 bp_blogs_update_blogmeta( $blog_ids[$i], 'description', $desc );83 bp_blogs_update_blogmeta( $blog_ids[$i], 'last_activity', time() );84 }85 }86 87 69 } 88 70 … … 139 121 function bp_blogs_setup_nav() { 140 122 global $bp; 123 124 /* Blog/post/comment menus should not appear on single WordPress setups. Although comments 125 and posts made by users will still show on their activity stream .*/ 126 if ( !bp_core_is_multiblog_install() ) 127 return false; 141 128 142 129 /* Add 'Blogs' to the main navigation */ … … 171 158 global $bp; 172 159 173 if ( $bp->current_component == $bp->blogs->slug && empty( $bp->current_action ) ) {160 if ( bp_core_is_multiblog_install() && $bp->current_component == $bp->blogs->slug && empty( $bp->current_action ) ) { 174 161 $bp->is_directory = true; 175 162 … … 190 177 191 178 function bp_blogs_screen_my_blogs() { 179 global $bp; 180 181 if ( !bp_core_is_multiblog_install() ) 182 return false; 183 192 184 do_action( 'bp_blogs_screen_my_blogs' ); 193 185 bp_core_load_template( apply_filters( 'bp_blogs_template_my_blogs', 'members/single/home' ) ); … … 207 199 global $bp; 208 200 209 if ( $bp->current_component != $bp->blogs->slug || 'create' != $bp->current_action )201 if ( !bp_core_is_multiblog_install() || $bp->current_component != $bp->blogs->slug || 'create' != $bp->current_action ) 210 202 return false; 211 203 … … 379 371 bp_blogs_update_blogmeta( $recorded_post->blog_id, 'last_activity', time() ); 380 372 381 if ( (int)get_blog_option( $blog_id, 'blog_public' ) ) {373 if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !bp_core_is_multiblog_install() ) { 382 374 /* Record this in activity streams */ 383 375 $post_permalink = bp_post_get_permalink( $post, $blog_id ); … … 415 407 } 416 408 417 if ( (int)get_blog_option( $blog_id, 'blog_public' ) ) {409 if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !bp_core_is_multiblog_install() ) { 418 410 /* Now re-record the post in the activity streams */ 419 411 $post_permalink = bp_post_get_permalink( $post, $blog_id ); … … 469 461 bp_blogs_update_blogmeta( $recorded_comment->blog_id, 'last_activity', time() ); 470 462 471 if ( (int)get_blog_option( $recorded_comment->blog_id, 'blog_public' ) ) {463 if ( (int)get_blog_option( $recorded_comment->blog_id, 'blog_public' ) || !bp_core_is_multiblog_install() ) { 472 464 /* Record in activity streams */ 473 465 $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id ); … … 503 495 bp_blogs_delete_activity( array( 'item_id' => $comment_id, 'secondary_item_id' => $recorded_comment->blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_comment' ) ); 504 496 505 if ( (int)get_blog_option( $recorded_comment->blog_id, 'blog_public' ) ) {497 if ( (int)get_blog_option( $recorded_comment->blog_id, 'blog_public' ) || !bp_core_is_multiblog_install() ) { 506 498 /* Record in activity streams */ 507 499 $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id );
Note: See TracChangeset
for help on using the changeset viewer.