BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 907

    This is example code for classifying user inactive for a year

     function check_inactive_users_and_assign_role() {
        $users = get_users(); // Get all users
    
        foreach ( $users as $user ) {
            $last_activity = bp_get_user_last_activity( $user->ID ); // Get the last activity timestamp
    
            if ( ! empty( $last_activity ) ) {
                $inactive_time = time() - strtotime( $last_activity ); // Calculate the time difference in seconds
    
                // Check if the user has been inactive for a year (31536000 seconds)
                if ( $inactive_time >= 31536000 ) {
                    $ghost_member_role = 'ghost_member'; // The role slug for Ghost Member
    
                    // Add the user to the Ghost Member role
                    $user_obj = new WP_User( $user->ID );
                    $user_obj->add_role( $ghost_member_role );
                }
            }
        }
    }
    add_action( 'bp_loaded', 'check_inactive_users_and_assign_role' );
     
  • Participant
    Level: Guru
    Posts: 907
    Tosin on in reply to: BuddyBlog Pro upload video field #49499

    Hi Brajesh,

    I really like this idea, I was wondering if you can also include a field for uploading Audio files

    Thanks

  • Participant
    Level: Guru
    Posts: 907
    Tosin on in reply to: [Resolved] Branded login script #49477

    This is now resolved there was another popup login form in the same page with similar form ID

  • Participant
    Level: Guru
    Posts: 907

    Thanks for the feedback Brajesh

    You got the suggestion right

    I want a settings in the product section to also enable users to mark old posts or unpaid posts and expired paid posts as sticky.

    So when user edits an old post they can select a product price and promote/feature old unpaid post as sticky

    NEW WORKFLOW ON POST EDIT
    Clicking the (update) button will now redirect the user to cart or checkout page, after successful payment the post will now be updated and also become sticky

    NOTE – this new workflow will only take effect if a price option was selected in the pay per post field while updating an old post.

    Thanks

    Thanks

  • Participant
    Level: Guru
    Posts: 907
    Tosin on in reply to: [Resolved] Branded login script #49431

    please note that I changed the button ID from wp-submit to bl-login-submit in my child theme

  • Participant
    Level: Guru
    Posts: 907
    Tosin on in reply to: Tweak and disable buddypress notifications #49278

    Alternatively how can I disable all internal recording of notifications in database while leaving the notification component enabled, so now all email notifications settings would be enabled

  • Participant
    Level: Guru
    Posts: 907
    Tosin on in reply to: Tweak and disable buddypress notifications #49277

    I want to disable the notification component from the settings but still enable email notifications for the following

    ENABLE EMAIL NOTIFICATIONS FOR
    1. Private messages
    2. Activity – @mentions
    3. Activity – A member replies to an update or comment you’ve posted

    Please note that I still want users to have access to the email notification settings. I noticed that disabling the notification component would also remove the email notification settings for the 3 items stated above

  • Participant
    Level: Guru
    Posts: 907
    Tosin on in reply to: Buddyblog reorganise form fields #49050

    Gentle reminder

  • Participant
    Level: Guru
    Posts: 907

    Thank you Brajesh

    this is now resolved

  • Participant
    Level: Guru
    Posts: 907
    Tosin on in reply to: Buddyblog text change on edit #48865

    ok thanks Brajesh,

    I have disabled it, please kindly let me know if there will ever be a replacement or update for the medium editor.