Black Friday: Grab all our memberships, plugins and themes at the biggest-ever 30% discount. Use coupon BLACKFRIDAY2025 before December 1st

BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 55
    Alex on in reply to: How to implement live notification from plugin into header? #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: 55

    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: 55
    Alex on in reply to: [Resolved] Limit invitations to avoid beeing spammed #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: 55
    Alex on in reply to: [Resolved] Limit invitations to avoid beeing spammed #53287

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

  • Participant
    Level: Enlightened
    Posts: 55
    Alex on in reply to: [Resolved] Limit invitations to avoid beeing spammed #53283
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 55
    Alex on in reply to: [Resolved] Limit invitations to avoid beeing spammed #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: 55

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

  • Participant
    Level: Enlightened
    Posts: 55
    Alex on in reply to: [Resolved] Limit invitations to avoid beeing spammed #53265

    Or alternatively add Recaptche to the form…?

  • Participant
    Level: Enlightened
    Posts: 55

    By the way I was using BP nouveau template pack. Because you were asking.

    • This reply was modified 1 year, 2 months ago by Alex.
  • Participant
    Level: Enlightened
    Posts: 55

    Hello Brajesh,

    I made another test to reproduce the error. On localhost I didn’t have this error yet.

    Its the same procedure what I wrote above.
    Plugins activated: Your data control plugin (current version), bp classic and buddypress (both current version).
    Themes tested with: Astra and twenty twenty four.

    The name field is the only field on xfields section which you cannot delete. Make the changes at your plugin which I made the screenshot from (switch “who can edit” from Adminstrator to Subscriber).
    Then you get the warning. This time with debug on I got a more detailled warning. I also attach these image here. Hope this helps.

    This is all what I can do to help to fix that issue.

    Meanwhile I programmed my own plugin for my needs with the advantage that I know whats going on.

    So I don’t need this plugin anymore. If you want you can mark this thread as solved.

    https://postimg.cc/xXfFtdB5

    Error message
    https://postimg.cc/JDVF3Q8D