Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 16 replies - 1 through 16 (of 16 total)

  • sx1001
    Participant

    @sx1001

    Why the heck is messages_new_message() so damn slow?
    I can merely send ONE PM per second… even though I already disabled the mail notification.

    There must be an incredible overhead in messages_new_message …. What do you think?


    sx1001
    Participant

    @sx1001

    I think I found it:
    Remocving this hook before calling “messages_new_message”:

    remove_action( 'messages_message_sent', 'messages_notification_new_message', 10 );


    sx1001
    Participant

    @sx1001

    It works. Thanks and bye


    sx1001
    Participant

    @sx1001

    SOMEONE GUYS?


    sx1001
    Participant

    @sx1001

    Just programm it using custom functions. Aint that hard.
    Just temporarly overwriting by using the has_capabilities hook 🙂


    sx1001
    Participant

    @sx1001

    Thank you Mathieu Viet!
    I think it would be even more “reliable” to fix it directly within bp_get_member_type to return an empty array instead of false, so that not every function using bp_get_member_type must add the check “is_array” – what do you think?


    sx1001
    Participant

    @sx1001

    Got it, looks good…
    This codes applies to group 5, i.e. within group 5, a user can only see his own posts AND the posts of admins:

    add_filter('bp_before_activity_get_parse_args', function($r) 
    {
        if(current_user_can('administrator'))
            return $r;
        
        if(@$r['filter']['object'] == 'groups' && @@$r['filter']['primary_id'] == 5) {
            $r['filter']['user_id'] = array_merge(get_users(array('role' => 'administrator', 'fields' => 'ID')), array(bp_loggedin_user_id()));
        }
    
        return $r;
    }, 1, 1);

    sx1001
    Participant

    @sx1001

    Basically to fix this issue if the JS does not work properly, do a check in the Ajax call itself:

    Modify the friend add AJAX call, and add the condition:

    
    $res = BP_Friends_Friendship::check_is_friend(bp_loggedin_user_id(), $_POST['item_id']);
    if(!in_array($res, array(false, 'not_friends'))) 
    {
         wp_send_json_error($response);
    }
    

    sx1001
    Participant

    @sx1001

    Funny, just as I posted, I saw this on github:
    https://github.com/buddyboss/buddyboss-platform/issues/1199

    But this was created only concerning the REST API.
    This happens also directly in the frontend… We have this situation every week once or so … 🙁


    sx1001
    Participant

    @sx1001

    
    add_shortcode('friendship_requests', function() {
        global $bp;
        add_filter('bp_displayed_user_id', function($id) {
            return bp_loggedin_user_id();
        });
        $bp->current_action = 'requests';
        ob_start();
        bp_get_template_part('members/single/friends');
        return ob_get_clean();
    });
    

    This is a shortcode [friendship_requests] which kind of works.
    But not completely.
    For example the buttons to approve the connection request etc are missing.
    Also I have a plugin with extended friendship request message which can be added to a friendship request – it’s also NOT shown / hooked.

    E.g. in the official Loop / URL:
    loop

    With my Shortcode it looks like:
    shorcode


    sx1001
    Participant

    @sx1001

    Okay, but how to use a variable outside a function and pass it to the callback function?

    I think version 1 is cleaner – BUT: unfortunately to use $members_args, unfortunately I have to change members loop – which I’d like to keep to the original one if possible.


    sx1001
    Participant

    @sx1001

    Unfortunately it doesn’t work either 🙁


    sx1001
    Participant

    @sx1001

    I meant this link here: https://wordpress.org/support/topic/buddypress-profile-change-password-skipped/
    Here someone is complaining about it as well.
    So right now, no solution on the internet 🙁


    sx1001
    Participant

    @sx1001

    See, the plugin doesnt work on “password change” for existing users:
    https://wordpress.org/support/plugin/force-strong-passwords/

    🙁


    sx1001
    Participant

    @sx1001

    Thanks, but it seems, that the BP form to change your profile is somehow altered and not the “original” WP form to change user settings, hence theres no check right now 🙁 Also “Force Strong Passwords” doesnt do anything, I can simply submit a weak password…


    sx1001
    Participant

    @sx1001

    Any ideas to add tags? 🙂 Please!!! Any plugin?

Viewing 16 replies - 1 through 16 (of 16 total)
Skip to toolbar