BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 47
    Alex on #53920

    Dont using it but curios if you ve been able to fix the bug already? As said, another live plugin like yours having the same issue…

  • Participant
    Level: Enlightened
    Posts: 47
    Alex on #53919

    Regarding my first question I am using another plugin now so this can be deleted. Secondly the guy who is making the bm plugin pointed me to the block function so I am hopeful to make it work by myself.

    Thanks!

  • Participant
    Level: Enlightened
    Posts: 47
    Alex on #53562

    By the way, there is a problem/bug with the live notfication plugin.

    1.Chose public message on someone’s profile.
    2.Then select friendship from the dropdown on the right side
    3.Write something in the text field and click update
    4.On next page click “see acitiviy”
    Then a button “undefined” occurs which counts up every 10 seconds or so. This happens only if your plugin is installed. Interesting, I tested this behaviour with another live bell plugin and it has the same bug.
    If your or his plugin is deactivated everythings works and no “undefined” occurs.

    Tested with twenty twenty five theme, buddypress, buddypress classic and your plugin on a fresh wordpress installation.

    Here a mp4 video about this (link is just viewable 24 hours)
    https://jumpshare.com/s/7EDAITT7ST9YKQYh9bZS

  • Participant
    Level: Enlightened
    Posts: 47
    Alex on #53300

    By the way. I tried to edit my post because I forgot the code blocks but it says you cannot create new topics??

    
    
    add_filter(‘bp_get_the_members_invitation_property_’,function ($property,$value) {
    if ($property == ‘date_modified’){
    $value= date(‘d.m.Y’,strtotime($value));
    }
    return $value;
    },10,2);
    
    
  • Participant
    Level: Enlightened
    Posts: 47
    Alex on #53290

    I tried to overwrite the message with this filter below but inside the your surrounding filter it is not working. I suppose because the $message variable is unknown by the surrounding filter. But how can I solve this?

    add_filter( ‘bp_user_can’, function ( $retval, $user_id, $capability, $site_id, $args ) {

    if ( ‘bp_members_send_invitation’ !== $capability ) {
    return $retval;
    }

    $count = BP_Invitation::get_total_count( array(
    ‘inviter_id’ => $user_id
    ) );

    $max_allowed = 2;// change it.

    if ( $count >= $max_allowed ) {
    $retval = false;

    // overwrite message
    add_filter(‘members_invitations_form_access_restricted’,’overwrite_message’);
    function overwrite_message ($message) {
    $message = ( ‘You have reached the limit of invitations.’);
    return $message;
    }

    }

    return $retval;

    }, 10, 5 );

  • Participant
    Level: Enlightened
    Posts: 47
    Alex on #53287

    So is there any possibility to change the error message at least?

  • Participant
    Level: Enlightened
    Posts: 47
    Alex on #53283
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 47
    Alex on #53282

    Hi Brajesh,
    it works. Great! Thank you.

    Just two more questions on this.

    1. At the backend on the invitations table you can see that the date is saved under “date modified”. Is it possible to get this date and then add it to your function? To check if the count is more than the max_allowed FOR THE SAME DAY, then set $retval to false?

    2. After the limit is reached the message pops up saying “you dont have the rights to send invitations”.
    Am I able to manipulate this message saying something like “you have reached the daily limit on invitations! Try again later”?

    Regards
    Alex

    PS: I really wonder why nobody has this implemented over the last years. Looks like buddypress core development slows down, which is not good.

  • Participant
    Level: Enlightened
    Posts: 47
    Alex on #53266

    Glad that you were able to fix it! Maybe I need it in the future again. 🙂

  • Participant
    Level: Enlightened
    Posts: 47
    Alex on #53265

    Or alternatively add Recaptche to the form…?