Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/21/2014 02:49:33 PM (12 years ago)
Author:
boonebgorges
Message:

Automatically check for newly created items when viewing the Activity Stream.

Leveraging WP's Heartbeat API, this new functionality performs periodic checks
to see whether new activity items matching the current filter have been posted
since the page was originally loaded. If new items are found, a Load Newest
link is inserted into the top of the stream, which will insert the new items.

A filter is included, bp_activity_heartbeat_pulse, that allows site owners to
set a specific interval for these checks. The default value is 15 seconds, or
whatever your global Heartbeat interval is.

To disable the feature, there is a new setting "Automatically check for new
activity items when viewing the activity stream".

Fixes #5328

Props imath, boonebgorges

File:
1 edited

Legend:

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

    r7951 r7952  
    777777    global $activities_template;
    778778
    779     $remaining_pages = floor( ( $activities_template->total_activity_count - 1 ) / ( $activities_template->pag_num * $activities_template->pag_page ) );
     779    $remaining_pages = 0;
     780
     781    if ( ! empty( $activities_template->pag_page ) ) {
     782        $remaining_pages = floor( ( $activities_template->total_activity_count - 1 ) / ( $activities_template->pag_num * $activities_template->pag_page ) );
     783    }
     784
    780785    $has_more_items  = (int) $remaining_pages ? true : false;
    781786
Note: See TracChangeset for help on using the changeset viewer.