BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 126

    Hello Brajesh
    This poses a real problem for the members!
    Is it difficult or can not you do it?

    Regards

    • This reply was modified 6 years, 7 months ago by Hervé.
  • Participant
    Level: Enlightened
    Posts: 126

    Hello Brajesh
    Sorry! I forgot to say that it is more urgent because there are members who remain in the subscriber state (a little complicated to explain but I think it is due to the change of programming with an existing site).
    This program would allow me to solve this too
    Regards

  • Participant
    Level: Enlightened
    Posts: 126

    Hello Brajesh
    A little reminder if you could help me
    Have a good day
    Regards

  • Participant
    Level: Enlightened
    Posts: 126

    Hello Brajesh,

    cool it works 🙂
    It is therefore quite different from the old method.

    For registration of the match in function buddydev_exclude_activity_types_from_recording( &$activity ) { … I put
    $excluded_types = array( 'friendship_created', 'new_member' );

    Do I have to put too
    $excluded_types = array( 'friendship_accepted,friendship_created' ...
    in function buddydev_remove_activity_filters_from_dropdown( $filters )

    I said my priority to receive the answer for what is most important to me, because I know that you also have priorities for work to make choices.
    Regards

  • Participant
    Level: Enlightened
    Posts: 126

    Hello Brajesh

    I misspoke because it does not work as I thought
    I do not want to record ‘friendship_created’, ‘new_member’, ‘updated_profile’
    Ok with https://buddydev.com/buddypress/disallowing-activity-recording-for-components-or-some-activity-types-in-buddypress/
    It is therefore necessary to hide the term in the selector
    https://screenshots.firefox.com/QPEVCbltOA8Mrpc6/null

    I had a code similar to this one that worked before:

    add_filter( 'bp_after_has_activities_parse_args', 'activites_affiche_infos' );
    function activites_affiche_infos( $retval ) {
     //  if ( bp_is_active( 'activity' ) ) {
       $retval['action'] = array(        
        'activity_comment',
        'activity_update',
        //'created_group',
        //'friendship_created',
        'joined_group',
        'last_activity',
        //'new_avatar',
        'new_blog_comment',
        'new_blog_post',
        //'new_member',
        'updated_profile'        
        );
    	return $retval;	
    //	}
    }

    It does not work anymore.
    I think there have been changes in buddypress !!
    this is not urgent
    I prefer to have help on https://buddydev.com/support/forums/topic/to-the-connection-of-an-existing-member-change-role-plan/

    Regards

  • Participant
    Level: Enlightened
    Posts: 126

    Hello Brajesh

    Ok forget the only line (do_action(‘arm_apply_plan_to_member’, $num_plan_payant_1an, $user_id);) on the armember component (which works in your other code). I have to do a program to solve a role loss problem

    The idea is at the moment of connection (That’s when I can not do it, I think), check if the member has
    * a photo
    * all mandatory fields filled
    * a subscriber role
    * a special value for an xprofile field

    If yes I change the role of the member (member0)

    Regards

  • Participant
    Level: Enlightened
    Posts: 126

    Hello Brajesh
    1/ ok
    2/ ok
    3/ yes
    Thanks

  • Participant
    Level: Enlightened
    Posts: 126

    Hello Brajesh,

    First of all thank you for the answer. I was long because I needed to be clearer.

    1 / it works but what does it mean ” //reset either component or type, both will cause a failure in saving activity”?
    If I understand correctly, it’s a question of not using the 2 snippets at the same time

    2 / actually i want to be very careful using sql.
    I found a plugin https://wordpress.org/plugins/bulk-delete/ which will be able to use me to suppress all the members (and therefore activities) of a test site
    The 2nd solution I found to delete people who register on the site but never finish their registration

    function spammersdeletion() {
        global $wpdb;
        $from = strtotime('-30 day', time());
        $wpdb->query('DELETE FROM wp_users WHERE DATE(user_registered) < "'.date('Y-m-d', $from).'"AND user_status = "2"');
    }
    
    add_action('init','spammersdeletion');

    3 / I do not want to see in the selector
    a) Items deleted from storage $excluded_types = array( 'friendship_created', 'new_member' );
    b) updating the profile “updated_profile”
    Regards

  • Participant
    Level: Enlightened
    Posts: 126

    Hello
    Help me please
    Regards

  • Participant
    Level: Enlightened
    Posts: 126

    Hi Brajesh

    Thank you it works.
    Great 🙂
    If I understand correctly, I can use add_action (‘bp_core_activated_user’, ..) to do any type of action when registering a new member

    and there is another hook for editing data change a profile:
    “xprofile_data_before_save”

    BuddyPress has a lot of HOOKS
    Regards