Ticket #5022: 5022.diff
File 5022.diff, 2.3 KB (added by , 11 years ago) |
---|
-
bp-activity/bp-activity-classes.php
256 256 $activity_user_ids = wp_list_pluck( $activities, 'user_id' ); 257 257 $activity_user_ids = implode( ',', wp_parse_id_list( $activity_user_ids ) ); 258 258 259 if ( !empty( $activity_user_ids ) ) { 259 if ( !empty( $activity_user_ids ) ) { 260 260 if ( $names = $wpdb->get_results( "SELECT user_id, value AS user_fullname FROM {$bp->profile->table_name_data} WHERE field_id = 1 AND user_id IN ({$activity_user_ids})" ) ) { 261 261 foreach ( (array) $names as $name ) 262 262 $tmp_names[$name->user_id] = $name->user_fullname; … … 584 584 return $comments; 585 585 } 586 586 587 /** 588 * Rebuild nested comment tree under an activity or activity comment. 589 * 590 * @global BuddyPress $bp The one true BuddyPress instance 591 * @global wpdb $wpdb WordPress database object 592 * @param int parent_id ID of an activty or activity comment 593 * @param int left node boundary start for activity or activity comment 594 * @return int Right node boundary of activity or activity comment 595 * @since BuddyPress (1.1.3) 596 */ 587 597 function rebuild_activity_comment_tree( $parent_id, $left = 1 ) { 588 598 global $wpdb, $bp; 589 599 … … 608 618 return $right + 1; 609 619 } 610 620 621 /** 622 * Get child comments of an activity or activity comment 623 * 624 * @global BuddyPress $bp The one true BuddyPress instance 625 * @global wpdb $wpdb WordPress database object 626 * @param int parent_id ID of an activty or activity comment 627 * @return object Numerically indexed array of child comments 628 * @since BuddyPress (1.2) 629 */ 611 630 function get_child_comments( $parent_id ) { 612 631 global $bp, $wpdb; 613 632 614 633 return $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND secondary_item_id = %d", $parent_id ) ); 615 634 } 616 635 636 /** 637 * Get a unique list of components that have related activity recorded to them 638 * 639 * @global BuddyPress $bp The one true BuddyPress instance 640 * @global wpdb $wpdb WordPress database object 641 * @return array The components 642 * @since BuddyPress (1.2) 643 */ 617 644 function get_recorded_components() { 618 645 global $wpdb, $bp; 619 646