"active"
- This topic has 3 replies, 3 voices, and was last updated 11 years, 4 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Sorry if this has been covered elsewhere; I searched for but did not find a related discussion.
I’m curious how BP/CBOX defines the state of “active” in groups, and whether that definition can be adjusted. In a given group, the activity stream of course includes forum posts and responses, announcements, new docs, etc. However, the label under a group name, or in a list of groups, that details how recently the group was active seems only to include members joining or leaving the group. As a result, lists of groups that are ordered by “last active” seem only to include membership activity, rather than active discussions, which is the factor that I’m far more interested in.
There seems to be a similar oddity in the list of “last active” blogs — there’s no relationship between the ordering of that list and those that have actually published new posts recently.
Can this be clarified, and perhaps put on the roadmap for future adjustment?
Many thanks, as always! –K.
@kfitz – This sounds like a bug.
The intended behavior in BuddyPress is that a group’s last activity value is updated whenever anything of interest happens in the group (roughly, anything that is written to the database). This includes forum activity, new docs, and really anything else that might happen within the group context. The same is true for blogs: they should be marked “active” when a new post or comment is left on the blog.
Are you certain that it’s *only* group membership events that are updating the “last active” value? It sounds like you’ve definitely noticed that forum discussions are not producing updates, but what about new announcements and Docs activity? Each of these content types are separately responsible for updating the “last active” value for their own activity, so it’s unlikely that they’re all failing at once – though it’ll be a useful data point either way.
As for blogs, there are two different things that might be happening. One is that the BP blogs component is failing to update the last active values. Another is that the last active values are correct, but that the “last active” sort order for the blog directory/widget query is broken. One way to figure out which of these is the case is as follows: Find a blog that you know to have had recent post/comment activity; note what time the last comment or post was published on the blog; find the blog in the Sites directory; compare the time you previously took note of to the “active x minutes ago” gloss in the Sites directory. If they match, then the problem is with the Blogs query; if they do not match, it’s a problem with the way the “last active” value is recorded. (You could do the same thing with Groups, as another data point.)
Thanks for your help in troubleshooting.
For the specific issue that Kathleen mentioned about group forum posts, I have posted a patch on bbPress that should address this:
https://bbpress.trac.wordpress.org/ticket/2368
@cbox_admin – When a group activity item is added, the last active timestamp is not updated. The last active timestamp gets updated on other hooks.
I was thinking we could probably force the group’s ‘last_activity’ timestamp to update whenever an activity entry is added to the group activity stream. We could do the same thing for the blogs component as well.
@r-a-y Thanks for straightening me out 🙂 and also for the bbPress ticket.
I really like your idea for forcing last_activity updates when activity entries are added that are associated with that item. Seems like a nice catch-all that’ll have the added bonus of removing one more thing to worry about for third-party plugins. Let’s do this in BuddyPress. In the meantime, how does this look as a temporary implementation for Kathleen’s purposes?
function bbg_update_group_last_active_on_activity( $activity_params ) {
if ( buddypress()->groups->id == $activity_params['component'] ) {
groups_update_last_activity( $activity_params['item_id'] );
}
}
add_action( 'bp_activity_add', 'bbg_update_group_last_active_on_activity' );