BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on #38876

    Thanks Brajesh! so, this is not the way…
    Excuse, if possible i ask the last question.. why does google index this url “xx.com/activity/p/4/” and not this xx.com/members/brajesh/activity/4? is it possible that be the first link on the activity?
    im thinking about generate a url and redirect to xx.com/members/brajesh/activity/4

    regards!

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on #38821

    Hi!!

    It is for example:

    Brajesh has updated an entry in the group Fashion<a href="xx.com/activity/p/4/">1 hour ago</a>

    this url redirect to:

    xx.com/members/brajesh/activity/4/

    Im working in the SEO of the page, when i see the activity on Google, i see this url <a href="xx.com/activity/p/4/">
    For it, I need change the activity_id 4 (and /p if it is possible) with the content of my activity (this is short) or a custom meta_key.

    Could this be possible?
    Thanks!!

    • This reply was modified 3 years, 4 months ago by Jennifer.
    • This reply was modified 3 years, 4 months ago by Jennifer.
  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on #38770

    Hi Ravi!!
    Im using Buddypress.I m looking for a way to modify this link:
    https://ibb.co/ysbVf1x

    This is: title of activity post in google search (in my page appear like the “Admin- Activity with yoast)
    and the description (for each activity post)
    Can you understand me?

    Thanks very much!
    regards,
    Jennifer

    • This reply was modified 3 years, 4 months ago by Jennifer.
  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on #35333

    Hi Brajesh.
    Thank you for your reply.
    Yes, *title* and *descr* are meta key and i would like search if any word match. But i cant found how do it =(

    Regards,
    Jennifer

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on #35240

    Hi Brajesh, if i use the search of buddypress, should i replace the search.php? Because i tried this code (search in meta_key “descr” and “titulo”) but i cant do it work
    And in the example, the user is using noveau theme.

     function buddydev_filter_activities_query_args( $r ) {
    
    	$searched_category = empty( $r[ 'search_terms' ] ) ? false : $r[ 'search_terms' ];
    
    	if ( ! $searched_category ) {
    		return $r;
    	}
    
    	$r['search_terms'] = false;
    
    	if ( empty( $r['meta_query'] ) ) {
    		$r['meta_query'] = array(
    			array(
    				'key'     => 'descr',
    				'value'   => $searched_category,
    			)
    		);
    	} else {
    		array_push( $r['meta_query'], array(
    			'key'     => 'titulo',
    			'value'   => $searched_category,
    		) );
    	}
    
    	return $r;
    }
    add_filter( 'bp_after_has_activities_parse_args', 'buddydev_filter_activities_query_args' );
    

    Thanks!!

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on #34542

    Hi Brajesh!
    The theme is Kleo with plugin Youzer.
    thanks!!

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on #27038
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on #27033

    Hi Brajesh
    The user answers the form and automatically connects to his profile. I had not thought about this :(.. there is no activation .. can I use another hook?
    Thanks very much

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on #27030

    Hi Brajesh
    I’m trying differently, it dont works ..a validation with a xprofile field

    
    add_action( 'quform_post_process_7', function ( array $result, Quform_Form $form ) {
    	if ( ! function_exists( 'bp_core_signup_user' ) ) {
    		return;
    	}
    	$username = $form->getValueText( 'quform_7_6' );
    	$email    = $form->getValueText( 'quform_7_6' );
    	$password = $form->getValueText( 'quform_7_7' );
    
    	// XProfile fields
    	$usermeta = array(
    	                //name
                 'field_1' => $form->getValueText('quform_7_28'),
    		'field_43' => $form->getValueText( 'quform_7_6' ),
                                  'field_59' => 'Inmobiliaria',
                  
    	);
    
    	$usermeta['profile_field_ids'] = '1,43,44,59';
    $usermeta['password']          = wp_hash_password( $password );
    	$user_id =    bp_core_signup_user($username, $password, $email, $usermeta);
    
    	return $result;
    }, 10, 2 );
    
    function after_bp_activated_user( $user_id, $key, $user ) {
    global $bp;
    
    $user = get_userdata( $user_id );
    $role='shop_manager';
    $profile_stage = xprofile_get_field_data('59');
    if ('Inmobiliaria' == $profile_stage){
    		$user->set_role( $role );
    	}
    }
    add_action( 'bp_core_activated_user', 'after_bp_activated_user', 30, 2 );
    
    • This reply was modified 4 years, 10 months ago by Jennifer.
  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on #27027

    Hi! i used your code, but I can’t change the user’s role.
    the current default role is *subscriber* and the one that has to be is * shop_manager *
    i tried with a priority different like:

    add_action( 'bp_core_activated_user', 'after_bp_activated_user', 10, 2 );
    and replace in the code
    $user->set_role( $role );

    for this:

    `$user = new WP_User( $user_id );
    $user->remove_role( ‘subscriber’ );
    $user->add_role( ‘shop_manager’ );`

    but I couldn’t do it yet.
    do u have any suggestions?
    Thanks very much!

    • This reply was modified 4 years, 10 months ago by Jennifer.
    • This reply was modified 4 years, 10 months ago by Jennifer.