Skip to:
Content

BuddyPress.org

Ticket #5022: 5022.diff

File 5022.diff, 2.3 KB (added by ericlewis, 11 years ago)

Add block descriptions for rebuild_activity_comment_tree, get_child_comments, and get_recorded_components

  • bp-activity/bp-activity-classes.php

     
    256256                        $activity_user_ids = wp_list_pluck( $activities, 'user_id' );
    257257                        $activity_user_ids = implode( ',', wp_parse_id_list( $activity_user_ids ) );
    258258
    259                         if ( !empty( $activity_user_ids ) ) {                           
     259                        if ( !empty( $activity_user_ids ) ) {
    260260                                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})" ) ) {
    261261                                        foreach ( (array) $names as $name )
    262262                                                $tmp_names[$name->user_id] = $name->user_fullname;
     
    584584                return $comments;
    585585        }
    586586
     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         */
    587597        function rebuild_activity_comment_tree( $parent_id, $left = 1 ) {
    588598                global $wpdb, $bp;
    589599
     
    608618                return $right + 1;
    609619        }
    610620
     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         */
    611630        function get_child_comments( $parent_id ) {
    612631                global $bp, $wpdb;
    613632
    614633                return $wpdb->get_results( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND secondary_item_id = %d", $parent_id ) );
    615634        }
    616635
     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         */
    617644        function get_recorded_components() {
    618645                global $wpdb, $bp;
    619646