Support » Fixing WordPress » Last activity timestamp for BuddyPress

  • [ Moved to the Fixing WordPress sub-forum. ]

    Hey guys,

    I moved all my users from Ning to WordPress+BuddyPress (yay!), and I need to generate a last activity timestamp for all the users so they show up in my BuddyPress members list. Boone B Gorges (BuddyPress superstar!) provided the following script:

    $user_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->users}");
    foreach ( $user_ids as $user_id ) {
        if ( ! bp_core_get_user_last_activity( $user_id ) ) {
            bp_core_update_user_last_activity( $user_id );

    I just need some help “finishing” it. He said I need to declare the $wpdb global. I don’t know PHP, so appreciate if anyone could help. I have a local instance of WordPress to test, so no worries about destroying my main site. 🙂

    I’m going to follow the instructions here to run the script:

    Thank so much – I’m loving this platform so far!

Viewing 1 replies (of 1 total)
  • Hi there!
    Can you please guide me that where you want to display this information?
    1- In user profile page.
    2- In admin area (Where all user are listed)

Viewing 1 replies (of 1 total)
  • The topic ‘Last activity timestamp for BuddyPress’ is closed to new replies.