Changeset 846
- Timestamp:
- 01/15/2009 08:08:59 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
bp-activity.php (modified) (1 diff)
-
bp-activity/bp-activity-classes.php (modified) (2 diffs)
-
bp-blogs.php (modified) (5 diffs)
-
bp-core/bp-core-templatetags.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r805 r846 213 213 function bp_activity_record( $item_id, $component_name, $component_action, $is_private, $secondary_item_id = false, $user_id = false, $secondary_user_id = false ) { 214 214 global $bp, $wpdb; 215 215 216 216 if ( !$user_id ) 217 217 $user_id = $bp['loggedin_userid']; -
trunk/bp-activity/bp-activity-classes.php
r835 r846 68 68 // Add the cached version of the activity to the sitewide activity table. 69 69 if ( !$this->no_sitewide_recording ) 70 $sitewide_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_sitewide'] . " ( user_id, item_id, secondary_item_id, content, primary_link, component_name, component_action, date_cached, date_recorded ) VALUES ( %d, %d, %d, %s, %s, %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d) )", $ bp['loggedin_userid'], $this->item_id, $this->secondary_item_id, $activity_content['content'], $activity_content['primary_link'], $this->component_name, $this->component_action, time(), $this->date_recorded ) );70 $sitewide_cached = $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp['activity']['table_name_sitewide'] . " ( user_id, item_id, secondary_item_id, content, primary_link, component_name, component_action, date_cached, date_recorded ) VALUES ( %d, %d, %d, %s, %s, %s, %s, FROM_UNIXTIME(%d), FROM_UNIXTIME(%d) )", $this->user_id, $this->item_id, $this->secondary_item_id, $activity_content['content'], $activity_content['primary_link'], $this->component_name, $this->component_action, time(), $this->date_recorded ) ); 71 71 72 72 if ( $activity && $activity_cached ) … … 93 93 $secondary_sql = $wpdb->prepare( " AND secondary_item_id = %d", $secondary_item_id ); 94 94 95 //var_dump($wpdb->prepare( "DELETE FROM {$wpdb->base_prefix}user_{$user_id}_activity WHERE item_id = %d{$secondary_sql} AND user_id = %d AND component_name = %s AND component_action = %s", $item_id, $user_id, $component_name, $component_action ) ); 96 //var_dump($wpdb->prepare( "DELETE FROM {$wpdb->base_prefix}user_{$user_id}_activity_cached WHERE item_id = %d{$secondary_sql} AND component_name = %s AND component_action = %s", $item_id, $component_name, $component_action ) ); 97 //var_dump($wpdb->prepare( "DELETE FROM " . $bp['activity']['table_name_sitewide'] . " WHERE item_id = %d{$secondary_sql} AND user_id = %d AND component_name = %s AND component_action = %s", $item_id, $user_id, $component_name, $component_action ) ); 98 //die; 95 //error_log($wpdb->prepare( "DELETE FROM {$wpdb->base_prefix}user_{$user_id}_activity WHERE item_id = %d{$secondary_sql} AND user_id = %d AND component_name = %s AND component_action = %s", $item_id, $user_id, $component_name, $component_action ) ); 96 //error_log($wpdb->prepare( "DELETE FROM {$wpdb->base_prefix}user_{$user_id}_activity_cached WHERE item_id = %d{$secondary_sql} AND component_name = %s AND component_action = %s", $item_id, $component_name, $component_action ) ); 97 //error_log($wpdb->prepare( "DELETE FROM " . $bp['activity']['table_name_sitewide'] . " WHERE item_id = %d{$secondary_sql} AND user_id = %d AND component_name = %s AND component_action = %s", $item_id, $user_id, $component_name, $component_action ) ); 99 98 100 99 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->base_prefix}user_{$user_id}_activity WHERE item_id = %d{$secondary_sql} AND user_id = %d AND component_name = %s AND component_action = %s", $item_id, $user_id, $component_name, $component_action ) ); -
trunk/bp-blogs.php
r843 r846 374 374 375 375 $post_id = (int)$post_id; 376 $post = get_post($post_id); 376 377 377 378 if ( !$user_id ) 378 $user_id = (int)$ bp['loggedin_userid'];379 $user_id = (int)$post->post_author; 379 380 380 381 if ( !$blog_id ) … … 384 385 if ( (int)get_site_option('tags_blog_id') == $blog_id ) 385 386 return false; 386 387 $post = get_post($post_id); 388 389 /* If another user is editing this post, don't record this at all, otherwise 390 we will get multiple post recordings for each revisor. */ 391 if ( $user_id != (int)$post->post_author ) 392 return false; 393 387 394 388 /* Don't record this if it's not a post */ 395 389 if ( $post->post_type != 'post' ) … … 403 397 * at the max, then delete the oldest recorded post first. 404 398 */ 405 if ( BP_Blogs_Post::get_total_recorded_for_user( ) >= TOTAL_RECORDED_POSTS )406 BP_Blogs_Post::delete_oldest( );399 if ( BP_Blogs_Post::get_total_recorded_for_user( $user_id ) >= TOTAL_RECORDED_POSTS ) 400 BP_Blogs_Post::delete_oldest( $user_id ); 407 401 408 402 $recorded_post = new BP_Blogs_Post; … … 422 416 } 423 417 } else { 424 /** 425 * Check to see if the post have previously been recorded. 426 * If the post status has changed from public to private then we need 427 * to remove the record of the post. 418 $existing_post = new BP_Blogs_Post( null, $blog_id, $post_id ); 419 420 /** 421 * Delete the recorded post if: 422 * - The status is no longer "published" 423 * - The post is password protected 428 424 */ 429 if ( $post->post_status != 'publish' || $post->post_password != '') 430 BP_Blogs_Post::delete( $post_id, $blog_id ); 425 if ( $post->post_status != 'publish' || $post->post_password != '' ) 426 bp_blogs_remove_post( $post_id, $blog_id ); 427 428 // Check to see if the post author has changed. 429 if ( (int)$existing_post->user_id != (int)$post->post_author ) { 430 // Delete the existing recorded post 431 bp_blogs_remove_post( $post_id, $blog_id ); 432 433 // Re-record the post with the new author. 434 bp_blogs_record_post( $post_id ); 435 } 431 436 } 432 437 … … 580 585 // Delete post from the bp_blogs table 581 586 BP_Blogs_Post::delete( $post_id, $blog_id ); 582 587 583 588 // Delete activity stream item 584 589 bp_blogs_delete_activity( array( 'item_id' => $post->id, 'component_name' => 'blogs', 'component_action' => 'new_blog_post', 'user_id' => $post->user_id ) ); -
trunk/bp-core/bp-core-templatetags.php
r842 r846 13 13 * or not to highlight a particular nav item. 14 14 * 15 * It will also compare the current user to the logged in user, if a user profile is being viewed.16 * This allows the "Friends" item to be highlighted if the users are friends. This is only if the friends17 * component is installed.18 *19 15 * @package BuddyPress Core 20 16 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 21 * @uses friends_check_friendship() Checks to see if the logged in user is a friend of the currently viewed user.22 17 */ 23 18 function bp_get_nav() {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)