Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

#4655 closed enhancement (fixed)

Template functions to get activity item's comments' author IDs

Reported by: djpaul's profile DJPaul Owned by: djpaul's profile DJPaul
Milestone: 1.7 Priority: normal
Severity: normal Version:
Component: Activity Keywords:
Cc:

Description

In the activity loop, it's not easy to get data about the authors of all activity comments belonging to a single activity item. You either have to write code and loop through the global, or perform two activity loops; the first to get some piece of data, then the second to render the template.

Storing the data can be tricky, too, as the activity item and activity comment templates are split across several files. Theme developers shouldn't have to expect to iterate through our globals and internal data structure.

Change History (2)

#1 @DJPaul
12 years ago

An example use case is where you want to show a list of all users participating in a discussion on a particular activity, above or before the activity comments themselves.

#2 @djpaul
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6501]) Add template functions to get an activity item's comments' author IDs

  • bp_activity_get_comments_user_ids() returns the user IDs of everyone who's written an activity comment on the current activity item.
  • bp_activity_comments_user_avatars() uses the above to output the users' avatars, linked to their profile page, into <LI> tags.
  • Fixes #4655

An example use case is where you want to show a list of all users participating in a discussion on a particular activity, above or before the activity comments themselves.

Note: See TracTickets for help on using tickets.