Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress Users


  • EvilBen
    Participant

    @evilben

    Hey Guys.

    I need your help as soon as you can. Actually i think it’s not that difficult, but I couldn’t find a solution to solve my problem.

    I’ve got an old Buddypress Database, and Set Up the Backup of my old Buddypress files, because of a plugin that caused an error.

    Now, its not possible to get my old BuddyPress users right in the Database. I’ve got a .csv File with my old BP Users, but I don’t know where to put the data in, that the users are marked as “active”. Buddypress just told me after the Import, that there is just 1 User (me), but there have to be, about 150 active Users.

    What do I have to do, that the Database “think” that all Buddypress Users have already logged in, or are activated? What do I have to do?

    Hope you can help me…

    ah before I forget: I am using the newest BP and WP Version

    Thx

Viewing 16 replies - 1 through 16 (of 16 total)

  • shanebp
    Moderator

    @shanebp

    /*
     * Paste in your theme functions.php or in bp-custom.php.
     * Load the site in a browser
     * Then REMOVE this function from your theme functions.php or bp-custom.php.
    */
    
    function buddypress_add_last_activity() {
    
      $members =  get_users( 'fields=ID' );
      // $members =  get_users( 'fields=ID&role=subscriber' );
      
      foreach ( $members as $user_id ) {
            bp_update_user_last_activity( $user_id, bp_core_current_time() );
      }
    
    }
    add_action('bp_init', 'buddypress_add_last_activity' );

    EvilBen
    Participant

    @evilben

    Hey thanks for replying so quick.

    I do not find this file or function. I don’t have a bp-custom.php and in the functions.php, there is no function like the one above.


    shanebp
    Moderator

    @shanebp

    Did you try following the instructions?

    1. Paste in your theme functions.php
    2. Load the site in a browser
    3. Then REMOVE this function from your theme functions.php

    EvilBen
    Participant

    @evilben

    Hi shanebp,

    i guess i do not really understand what you want me to do? Where do I have to paste in functions.php?


    EvilBen
    Participant

    @evilben

    Ah i did understand now, what you meant. I pasted in your code, reload the site, and delete the code. But it changed nothing …

    Maybe i put the users in a wrong table? I added them in the wp_users table?


    shanebp
    Moderator

    @shanebp

    If you go to the all members page on the front end of your site, how many members are listed?


    EvilBen
    Participant

    @evilben

    everyone i imported is listed


    shanebp
    Moderator

    @shanebp

    Great, you’re all set.


    EvilBen
    Participant

    @evilben

    Yes that is right, but in the statistic on my site they aren’t listet. So there isn’t written: total users: xyzzy


    snorklebum
    Participant

    @snorklebum

    Have you tried Dashboard -> Tools -> BuddyPress then run the Repair total members count?


    EvilBen
    Participant

    @evilben

    Wow!!! Yes Sir, that worked – thank you very much 😉


    kerchmcc
    Participant

    @kerchmcc

    WP 5.5.1
    Memberlite (child theme)
    BP 6.3.0
    BP Theme Nouveau

    I put this code in my functions.php file. Refreshed the site. It slowed the load down to 20SECONDS. Then I removed the code… and the number of members still does not reflect the full number of members (whether they ever activated or not).
    Interestingly, I used this code (I think) several months ago and it worked like it should. Then the site crashed and I had to put everything back. Much was updated since that first run.


    shanebp
    Moderator

    @shanebp

    The code is meant to be used ONCE and then removed.
    During that single run, it can be slow depending on the number of members you have.
    After you have removed the code, go to Dashboard -> Tools -> BuddyPress then run the Repair total members count.


    kerchmcc
    Participant

    @kerchmcc

    I WISH I could say that worked.. but it did not. Same number of members as before.
    Tried repair total members and repair last activity.

    When you say “run once” does that mean if I ran it 6 months ago.. and it was fine… that I can’t run it again?


    kerchmcc
    Participant

    @kerchmcc

    Additionally, in the database _bp_activity all members show the last active date of today, just now. PMPro shows membership of 565. The buddypress count is just 301.


    shanebp
    Moderator

    @shanebp

    When you say “run once”

    You can run it whenever you want – just don’t leave it in or it will run on every page load.

    …in the database _bp_activity all members show the last active date of today

    Which is correct if you ran the code above today.
    How many member have a row in the database for last_activity ?
    Is it 301 ?

Viewing 16 replies - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.
Skip to toolbar