Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/28/2014 10:52:14 PM (12 years ago)
Author:
r-a-y
Message:

Blogs: Support post comment synchronization in the activity stream.

Previously, if a reply to a blog post was made in the activity stream,
the reply would only exist in the activity stream and not as a comment
for the blog post.

This commit:

  • Adds a blog comment whenever an activity reply is made under a blog post activity entry
  • Adds an activity comment to the blog post's activity entry whenever a blog comment is made
  • Checks to see if the blog post is open for comments (whether manually closed or due to age) (see r8189) to determine whether the activity item can be replied to
  • Handles content edit synchronization to either the post comment or the activity comment
  • Handles deletion synchronization to a degree

See #5130

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-template.php

    r8142 r8190  
    27732773    }
    27742774
     2775/**
     2776 * Recurse through all activity comments and return the activity comment IDs.
     2777 *
     2778 * @since BuddyPress (2.0.0)
     2779 *
     2780 * @param array $activity Array of activities generated from {@link bp_activity_get()}.
     2781 * @param array $activity_ids Used for recursion purposes in this function.
     2782 * @return array
     2783 */
     2784function bp_activity_recurse_comments_activity_ids( $activity = array(), $activity_ids = array() ) {
     2785    if ( is_array( $activity ) && ! empty( $activity['activities'] ) ) {
     2786        $activity = $activity['activities'][0];
     2787    }
     2788
     2789    if ( ! empty( $activity->children ) ) {
     2790        foreach ($activity->children as $child ) {
     2791            $activity_ids[] = $child->id;
     2792
     2793            if( ! empty( $child->children ) ) {
     2794                $activity_ids = bp_activity_recurse_comments_activity_ids( $child, $activity_ids );
     2795            }
     2796        }
     2797    }
     2798
     2799    return $activity_ids;
     2800}
    27752801
    27762802/**
Note: See TracChangeset for help on using the changeset viewer.