This topic has 2 replies, 3 voices, and was last updated 6 years by Radu.

  • Author
  • #206565
     lydiabaril
    Participant

    Hi,

    I am writing about the issue of profiles not being visible after registration until the registrered user signs in.

    One way to get around this is to populate wp_bp_activity table with all the user ids and a value of last_activity for the field “type”.

    Could you please provide a code for that ? I have found code to insert in function.php but it is for a previous version of buddypress.

    Also, it would be so much better even to find a way to not populate this table and just show all the users without checking if they have last_activity. Is there a way to do that ?

    thanks

    #206614
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #206716
     Radu
    Moderator

    Hi,

    Use the next function for the new users that only register

    COPY CODE
    
    
    //!!!!!This function should run only one time.
    add_action( 'wp_loaded', 'sq_retroactive_user_fix' );
    function sq_retroactive_user_fix() {
    	$users = get_users( array(
    		'fields' => 'ID',
    		'number' => 2000	
    	) );
    	foreach( $users as $user_id ) {
    		// Check to see if the user has activity
    		if ( bp_get_user_last_activity( $user_id ) ) {
    			continue;
    		}
    		
    		// Inactive so lets activate
    		bp_update_user_last_activity( $user_id, bp_core_current_time() );
    	}
    	
    	// Clean transient cache
    	delete_transient( 'bp_active_member_count' );			
    }
    //END !!!!!This function should run only one time.
    
    

    This function should run only one time.

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?