Changeset 4588 for trunk/bp-core/bp-core-functions.php
- Timestamp:
- 07/04/2011 06:07:33 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-functions.php
r4587 r4588 730 730 function bp_core_record_activity() { 731 731 global $bp; 732 732 733 733 if ( !is_user_logged_in() ) 734 734 return false; 735 736 $activity = bp_get_user_meta( $bp->loggedin_user->id, 'last_activity', true ); 735 736 $user_id = $bp->loggedin_user->id; 737 738 if ( bp_core_is_user_spammer( $user_id ) || bp_core_is_user_deleted( $user_id ) ) 739 return false; 740 741 $activity = bp_get_user_meta( $user_id, 'last_activity', true ); 737 742 738 743 if ( !is_numeric( $activity ) ) … … 743 748 744 749 if ( empty( $activity ) || strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) ) 745 bp_update_user_meta( $ bp->loggedin_user->id, 'last_activity', $current_time );750 bp_update_user_meta( $user_id, 'last_activity', $current_time ); 746 751 } 747 752 add_action( 'wp_head', 'bp_core_record_activity' );
Note: See TracChangeset
for help on using the changeset viewer.