Changeset 7105
- Timestamp:
- 06/05/2020 08:59:46 PM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
-
includes/replies/functions.php (modified) (2 diffs)
-
includes/topics/functions.php (modified) (2 diffs)
-
templates/default/bbpress/user-profile.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/functions.php
r7098 r7105 820 820 // Set transient for throttle check (only on new, not edit) 821 821 if ( empty( $is_edit ) ) { 822 set_transient( '_bbp_' . bbp_current_author_ip() . '_last_posted', time() ); 823 } 824 825 // If not anonymous, then 826 } else { 827 if ( empty( $is_edit ) && ! current_user_can( 'throttle' ) ) { 828 bbp_update_user_last_posted( $author_id ); 822 set_transient( '_bbp_' . bbp_current_author_ip() . '_last_posted', time(), HOUR_IN_SECONDS ); 829 823 } 830 824 } … … 859 853 if ( empty( $is_edit ) ) { 860 854 861 // Update poster IP if not editing 855 // Update poster activity time 856 bbp_update_user_last_posted( $author_id ); 857 858 // Update poster IP 862 859 update_post_meta( $reply_id, '_bbp_author_ip', bbp_current_author_ip(), false ); 863 860 -
trunk/src/includes/topics/functions.php
r7098 r7105 787 787 // Set transient for throttle check (only on new, not edit) 788 788 if ( empty( $is_edit ) ) { 789 set_transient( '_bbp_' . bbp_current_author_ip() . '_last_posted', time() ); 790 } 791 792 // If not anonymous, then 793 } else { 794 if ( empty( $is_edit ) && ! current_user_can( 'throttle' ) ) { 795 bbp_update_user_last_posted( $author_id ); 789 set_transient( '_bbp_' . bbp_current_author_ip() . '_last_posted', time(), HOUR_IN_SECONDS ); 796 790 } 797 791 } … … 821 815 if ( empty( $is_edit ) ) { 822 816 823 // Update poster IP if not editing 817 // Update poster activity time 818 bbp_update_user_last_posted( $author_id ); 819 820 // Update poster IP 824 821 update_post_meta( $topic_id, '_bbp_author_ip', bbp_current_author_ip(), false ); 825 822 -
trunk/src/templates/default/bbpress/user-profile.php
r7006 r7105 36 36 <?php if ( bbp_get_user_last_posted() ) : ?> 37 37 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> 39 39 40 40 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.