Skip to:
Content

BuddyPress.org

Ticket #7782: 7782.patch

File 7782.patch, 3.2 KB (added by imath, 18 months ago)
  • src/bp-templates/bp-nouveau/buddypress/activity/entry.php

    diff --git src/bp-templates/bp-nouveau/buddypress/activity/entry.php src/bp-templates/bp-nouveau/buddypress/activity/entry.php
    index e10b6d5df..e31473201 100644
     
    1010
    1111bp_nouveau_activity_hook( 'before', 'entry' ); ?>
    1212
    13 <li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>" data-bp-activity-id="<?php bp_activity_id(); ?>">
     13<li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>" data-bp-activity-id="<?php bp_activity_id(); ?>" data-bp-timestamp="<?php bp_nouveau_activity_timestamp(); ?>">
    1414
    1515        <div class="activity-avatar item-avatar">
    1616
  • src/bp-templates/bp-nouveau/includes/activity/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/activity/template-tags.php src/bp-templates/bp-nouveau/includes/activity/template-tags.php
    index 5972a9231..6ca7c5066 100644
    function bp_nouveau_activity_content() { 
    180180        do_action( 'bp_activity_entry_content' );
    181181}
    182182
     183/**
     184 * Output the Activity timestamp into the bp-timestamp attribute.
     185 *
     186 * @since 3.0.0
     187 */
     188function bp_nouveau_activity_timestamp() {
     189        echo esc_attr( bp_nouveau_get_activity_timestamp() );
     190}
     191
     192        /**
     193         * Get the Activity timestamp.
     194         *
     195         * @since 3.0.0
     196         *
     197         * @return integer The Activity timestamp.
     198         */
     199        function bp_nouveau_get_activity_timestamp() {
     200                /**
     201                 * Filter here to edit the activity timestamp.
     202                 *
     203                 * @since 3.0.0
     204                 *
     205                 * @param integer $value The Activity timestamp.
     206                 */
     207                return apply_filters( 'bp_nouveau_get_activity_timestamp', strtotime( bp_get_activity_date_recorded() ) );
     208        }
     209
    183210/**
    184211 * Output the action buttons inside an Activity Loop.
    185212 *
  • src/bp-templates/bp-nouveau/js/buddypress-activity.js

    diff --git src/bp-templates/bp-nouveau/js/buddypress-activity.js src/bp-templates/bp-nouveau/js/buddypress-activity.js
    index a2f3193b3..e14180d14 100644
    window.bp = window.bp || {}; 
    8282                 * @return {[type]}       [description]
    8383                 */
    8484                heartbeatSend: function( event, data ) {
    85                         this.heartbeat_data.first_recorded = $( '#buddypress [data-bp-list] [data-bp-activity-id] time' ).first().data( 'bp-timestamp' ) || 0;
     85                        this.heartbeat_data.first_recorded = $( '#buddypress [data-bp-list] [data-bp-activity-id]' ).first().data( 'bp-timestamp' ) || 0;
    8686
    8787                        if ( 0 === this.heartbeat_data.last_recorded || this.heartbeat_data.first_recorded > this.heartbeat_data.last_recorded ) {
    8888                                this.heartbeat_data.last_recorded = this.heartbeat_data.first_recorded;
    window.bp = window.bp || {}; 
    587587                                                } );
    588588
    589589                                                // reset vars to get newest activities when an activity is deleted
    590                                                 if ( ! activity_comment_id && activity_item.find( 'time' ).first().data( 'bp-timestamp' ) === parent.Activity.heartbeat_data.last_recorded ) {
     590                                                if ( ! activity_comment_id && activity_item.data( 'bp-timestamp' ) === parent.Activity.heartbeat_data.last_recorded ) {
    591591                                                        parent.Activity.heartbeat_data.newest        = '';
    592592                                                        parent.Activity.heartbeat_data.last_recorded  = 0;
    593593                                                }