Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/05/2020 08:59:46 PM (4 years ago)
Author:
johnjamesjacoby
Message:

Users: Correctly calculate offset in User Profile > Last Activity.

Previous to this, Last Activity was being saved with time() but then using the site offset on display. For negative timezones, this would cause "sometime ago" type output in screens like User Profiles.

Also correctly update Last Activity when posting new Topics and Replies, and add expiration to transients for anonymous users to prevent them from being autoloaded while also never expiring.

In trunk, for 2.7.0.

Fixes #3378.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/templates/default/bbpress/user-profile.php

    r7006 r7105  
    3636        <?php if ( bbp_get_user_last_posted() ) : ?>
    3737
    38             <p class="bbp-user-topic-count"><?php printf( esc_html__( 'Last Activity: %s',  'bbpress' ), bbp_get_time_since( bbp_get_user_last_posted() ) ); ?></p>
     38            <p class="bbp-user-topic-count"><?php printf( esc_html__( 'Last Activity: %s',  'bbpress' ), bbp_get_time_since( bbp_get_user_last_posted(), false, true ) ); ?></p>
    3939
    4040        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.