This topic has 4 replies, 1 voice, and was last updated 6 years by chrisburrc.

  • Author
  • #186041
     chrisburrc
    Participant

    Hello,

    My members are not required to login after activating their account, but I would like to display on my landing page the last 12 registered users with the masonery widget. I understood that buddypress do not consider a member active unless he logsin at leat once, is that correct? I also found your snippet here: https://seventhqueen.com/blog/buddypress/show-users-members-directory-right-account-activation.html that I added to my kleo-child template’s function.php file.

    After uploading the file to my host, I tried to sign-up (from the landing page, the big blue section), but my user are not showing up in the directory (displayed below with masonery).

    It would be great if you could help me. I tried to look in the db where to see if the user had an updated activity (ie if your snippet worked), but I don’t know where to check.

    Best,

    #186042
     chrisburrc
    Participant

    Update, I can see that there is a member activity added to the table bp_activity. What looks strange for me is that:

    1. I created an account twice, the first time, the line was written, for the second account, the line was updated (not one line per account)
    2. User id of this activity is 1, I guess 1 is my admin, I would expect here to see another user id.

    Attachments:
    You must be logged in to view attached files.
    #186045
     chrisburrc
    Participant

    Update here, is that possible that the user id of the activity is always 1, because when this function is triggered, my user is not logged in, he just activated his account.

    #186073
     chrisburrc
    Participant

    Hello,

    I’m moving forward with solving the issue. I can see now that indeed the entry last_activity is added to the table wp_usermeta and it corresponds to the correct recently activated user. But unfortunately, this user do not appear on the kleo masonery member widget when set to show newest members.

    I can see that with a newly activated user, if I log in, he does indeed appear in the list. Any direction where I should search?

    Best,
    C.

    #186079
     chrisburrc
    Participant

    I made it. Sorry for the spamming 😉 But I suggest you update your blog post mentionned above with this code:

    COPY CODE
    add_action('bp_core_activated_user', 'kleo_add_member_activity');
    function kleo_add_member_activity($user_id)
    {
      bp_update_user_last_activity( $user_id, bp_core_current_time() );
    
    }

    Best

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?