Skip to:
Content
Pages
Categories
Search
Top
Bottom

Filtering activities by recorded date

  • @paulmontwill

    Participant

    Guys, I know how to filter activities for e.g. by category:
    – bp-activity-templatetags.php – bp_has_activities
    ‘action’ => false, // action to filter on e.g. activity_update, new_forum_post, profile_updated

    But how to filter by recorded date? For example – show only from the last 24 hours?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @nuprn1

    Participant

    i don’t believe so – (you can restrict one page, how many items, etc)

    if you look at the Class BP_Activity_Activity and the get function – you can see what is being allowed.

    @boonebgorges

    Keymaster

    In the past I have done this by grabbing a large number of activities with bp_has_activities, and iterate over the items with foreach( $activities->activities as $activity). For each $activity, check the time. Once they’re older than 24 hours, chuck the rest of $activities->activities.

    Not ideal, and not really good for efficiency (since you end up looping through the array twice, once during this purge and once during while ( bp_activities() )) but better than nothing :)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filtering activities by recorded date’ is closed to new replies.
Skip to toolbar