Skip to:
Content

BuddyPress.org

Changeset 8340


Ignore:
Timestamp:
05/02/2014 05:34:28 AM (10 years ago)
Author:
imath
Message:

Only load the activity just posted when on a user activity page

HeartBeat activity check feature introduced a "since" argument to load the activity that are newest. In a user activity page, this feature is not used but a timestamp is created using a "0" value causing all user activities to be reloaded. Checking if the value is empty before creating the timestamp will make sure the activity just posted will be the only one loaded into user stream.

props boonebgorges, imath

See #5603

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/bp-templates/bp-legacy/buddypress-functions.php

    r8251 r8340  
    707707        exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update, please try again.', 'buddypress' ) . '</p></div>' );
    708708
    709     $last_recorded = isset( $_POST['since'] ) ? date( 'Y-m-d H:i:s', intval( $_POST['since'] ) ) : 0;
     709    $last_recorded = ! empty( $_POST['since'] ) ? date( 'Y-m-d H:i:s', intval( $_POST['since'] ) ) : 0;
    710710    if ( $last_recorded ) {
    711711        $activity_args = array( 'since' => $last_recorded );
Note: See TracChangeset for help on using the changeset viewer.