usergroup->can( 'aum' );
foreach( $activities as $index => $activity ) :
// For non-content actions (reactions, favorites, votes, etc.), the actor is in itemid_second
$actor_actions = [ 'new_like', 'new_dislike', 'new_up_vote', 'new_down_vote', 'new_reaction', 'new_favorite', 'topic_solved', 'topic_closed', 'post_answer' ];
$actor_userid = in_array( $activity['type'], $actor_actions ) && ! empty( $activity['itemid_second'] )
? $activity['itemid_second']
: $activity['userid'];
$member = wpforo_member( $actor_userid );
$icon = wpforo_activity_icon( $activity['type'] );
$info_html = wpforo_activity_info_html( $activity, $member );
$show_excerpt = in_array( $activity['type'], [ 'wpforo_topic', 'wpforo_post' ] );
$excerpt = '';
if( $show_excerpt && $activity['itemid'] ) {
// For wpforo_topic, itemid is topicid - get first post via topic's first_postid
if( $activity['type'] === 'wpforo_topic' ) {
$topic_data = wpforo_topic( $activity['itemid'] );
if( $topic_data && ! empty( $topic_data['first_postid'] ) ) {
$first_post = wpforo_post( $topic_data['first_postid'] );
if( $first_post && ! empty( $first_post['body'] ) ) {
$excerpt = wpforo_text( $first_post['body'], 300, false );
}
}
} else {
$post = wpforo_post( $activity['itemid'] );
if( $post && ! empty( $post['body'] ) ) {
$excerpt = wpforo_text( $post['body'], 300, false );
}
}
}
?>
usergroup->can( 'va' ) && wpforo_setting( 'profiles', 'avatars' ) ) : ?>