Changeset 5729 for trunk/bp-blogs/bp-blogs-functions.php
- Timestamp:
- 02/11/2012 09:32:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-functions.php
r5686 r5729 55 55 56 56 if ( $blog_ids ) { 57 foreach( (array) $blog_ids as $blog_id ) {57 foreach( (array) $blog_ids as $blog_id ) { 58 58 $users = get_users( array( 'blog_id' => $blog_id ) ); 59 59 $subscribers = get_users( array( 'blog_id' => $blog_id, 'role' => 'subscriber' ) ); 60 60 61 61 if ( !empty( $users ) ) { 62 foreach ( (array) $users as $user ) {62 foreach ( (array) $users as $user ) { 63 63 // Don't record blogs for subscribers 64 64 if ( !in_array( $user, $subscribers ) ) … … 100 100 bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'last_activity', bp_core_current_time() ); 101 101 102 $is_private = !empty( $_POST['blog_public'] ) && (int) $_POST['blog_public'] ? false : true;102 $is_private = !empty( $_POST['blog_public'] ) && (int) $_POST['blog_public'] ? false : true; 103 103 $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private ); 104 104 … … 150 150 global $bp, $wpdb; 151 151 152 $post_id = (int) $post_id;153 $blog_id = (int) $wpdb->blogid;152 $post_id = (int) $post_id; 153 $blog_id = (int) $wpdb->blogid; 154 154 155 155 if ( !$user_id ) 156 $user_id = (int) $post->post_author;156 $user_id = (int) $post->post_author; 157 157 158 158 // Stop infinite loops with WordPress MU Sitewide Tags. … … 165 165 } 166 166 167 if ( (int) $blog_id == $tags_blog_id && apply_filters( 'bp_blogs_block_sitewide_tags_activity', true ) )167 if ( (int) $blog_id == $tags_blog_id && apply_filters( 'bp_blogs_block_sitewide_tags_activity', true ) ) 168 168 return false; 169 169 … … 181 181 182 182 if ( is_multisite() ) 183 $activity_action = sprintf( __( '%1$s wrote a new post, %2$s, on the site %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>' );183 $activity_action = sprintf( __( '%1$s wrote a new post, %2$s, on the site %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>' ); 184 184 else 185 $activity_action = sprintf( __( '%1$s wrote a new post, %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );185 $activity_action = sprintf( __( '%1$s wrote a new post, %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); 186 186 187 187 // Make sure there's not an existing entry for this post (prevent bumping) … … 189 189 $existing = bp_activity_get( array( 190 190 'filter' => array( 191 'user_id' => (int) $post->post_author,191 'user_id' => (int) $post->post_author, 192 192 'action' => 'new_blog_post', 193 193 'primary_id' => $blog_id, … … 204 204 205 205 bp_blogs_record_activity( array( 206 'user_id' => (int) $post->post_author,206 'user_id' => (int) $post->post_author, 207 207 'action' => apply_filters( 'bp_blogs_activity_new_post_action', $activity_action, $post, $post_permalink ), 208 208 'content' => apply_filters( 'bp_blogs_activity_new_post_content', $activity_content, $post, $post_permalink ), … … 248 248 // Get the user_id from the comment author email. 249 249 $user = get_user_by( 'email', $recorded_comment->comment_author_email ); 250 $user_id = (int) $user->ID;250 $user_id = (int) $user->ID; 251 251 252 252 // If there's no registered user id, don't record activity … … 345 345 global $bp; 346 346 347 $blog_id = (int) $blog_id;347 $blog_id = (int) $blog_id; 348 348 do_action( 'bp_blogs_before_remove_blog', $blog_id ); 349 349 … … 384 384 return false; 385 385 386 $post_id = (int) $post_id;386 $post_id = (int) $post_id; 387 387 388 388 if ( !$blog_id ) 389 $blog_id = (int) $wpdb->blogid;389 $blog_id = (int) $wpdb->blogid; 390 390 391 391 if ( !$user_id ) … … 597 597 } 598 598 599 $metas = array_map('maybe_unserialize', (array) $metas);599 $metas = array_map('maybe_unserialize', (array) $metas); 600 600 601 601 if ( 1 == count($metas) )
Note: See TracChangeset
for help on using the changeset viewer.