BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on in reply to: BP Deactivate Account – Bugs #53555
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on in reply to: Anonymous plugin – rtMedia issue #53554

    Hello again!

    Sounds great, thank you so much πŸ™‚

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on in reply to: Limit activity in groups to admin/mods only #53536

    Hello Brajesh

    I did manage to get it to work with the following code (if anyone else in here needs it in the future):

    Restrict in single group
    `function restrict_activity_posting_for_specific_group( $can_post, $user_id, $group_id ) {
    // The ID of the group you want to restrict posting in (replace with the actual group ID)
    $restricted_group_id = 123; // Example group ID

    // Only apply the restriction to the specific group
    if ( $group_id == $restricted_group_id ) {
    // Check if the user is an admin or moderator
    if ( !bp_group_is_admin( $user_id, $group_id ) && !bp_group_is_mod( $user_id, $group_id ) ) {
    return false; // Don’t allow posting
    }
    }

    // If not the restricted group, or the user is admin/mod, allow posting
    return $can_post;
    }
    add_filter( ‘bp_activity_can_post’, ‘restrict_activity_posting_for_specific_group’, 10, 3 );`

    Restrict in multiple groups
    `function restrict_activity_posting_for_specific_groups( $can_post, $user_id, $group_id ) {
    // The IDs of the groups you want to restrict posting in (replace with actual group IDs)
    $restricted_group_ids = array( 123, 456, 789 ); // Example group IDs

    // Check if the group ID is in the restricted group IDs array
    if ( in_array( $group_id, $restricted_group_ids ) ) {
    // Only apply the restriction if the user is not an admin or moderator
    if ( !bp_group_is_admin( $user_id, $group_id ) && !bp_group_is_mod( $user_id, $group_id ) ) {
    return false; // Don’t allow posting
    }
    }

    // If not in the restricted groups or the user is an admin/mod, allow posting
    return $can_post;
    }
    add_filter( ‘bp_activity_can_post’, ‘restrict_activity_posting_for_specific_groups’, 10, 3 );`

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on in reply to: Anonymous plugin – rtMedia issue #53535

    Hello Brajesh

    Thank you for looking into this, unfortunately it doesn’t quite work.

    Here is how I’ve tested it so far:

    Scenario 1:
    1. Add text in activity text field
    2. Pick image (image uploader)
    3. Switch to anonymous
    What happens: In this way they’re still able to post the activity.

    Scenario 2:
    1. Switch to anonymous
    2. Add text in activity text field
    3. Try to upload media
    What happens: This returns the error message: “Anonymous media upload is not supported.”
    *This step seems to be working πŸ™‚

    Scenario 3:
    1. Add text in activity text field
    2. Switch to anonymous
    3. Try to upload media
    What happens: This returns the error message: “Anonymous media upload is not supported.”
    *This step seems to be working πŸ™‚

    So, it seems like the issue is if the user uploads media before the “anonymous option” is checked.

    So, we need some sort of check before upload, that if anonymous box is checked then it should also return error before allowing the upload of the activity. πŸ™‚

    Hope it makes sense – please let me know if you need anything else.

    Also, I’m still having issue with compatibility with the deactivate plugin and Global Search that would be nice to investigate after is possible.

    Thank you!

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on in reply to: Multiple plugins – bugs #53494

    Hello again!

    Sorry about the late reply! πŸ™‚

    Yes it seems to have fixed the issue for now – but I’m not using the Activity Link Preview plugin right now, so not sure if they’re going to be compatible if I use it later lol.

    I’m still having issues with the Deactivate Account plugin though. πŸ™‚

    Lock / Unlock works perfect!

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on in reply to: Multiple plugins – bugs #53485

    Hello again

    I just made a temporary fix to the container since I noticed the “inactive” within the class.

    I noticed it had display: none – so I added an !important to that one and it seemed to have fixed the issue for now.

    `/* FIX: Remove inactive media upload container from profile activity page */
    .mpp-upload-container-inactive {
    display: none !important;
    } `

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on in reply to: Multiple plugins – bugs #53484

    Hello again

    I didn’t know that BuddyPress also had oembed support, that’s pretty cool! πŸ™‚

    Thank you for the provided link for oembed, this is very helpful indeed.

    I tried going into troubleshooting mode and only turned on the child theme – including the required plugins + MediaPress and I can confirm that this alone is causing the issue of the stubborn container on the User Profile > Activity page. Whenever I create an activity from the user profiles it shows up with the container (.mpp-media-upload-container).

    So, the conflict seems to be within the MediaPress itself (maybe the theme) and not the Activity Link Preview plugin.

    I’m not sure I’m going to use the Activity Link Preview, since it doesn’t provide anything major that isn’t already supported by MediaPress and/or BuddyPress itself with oembed.

    Here is a image for reference: https://ibb.co/7WJtfMZ

    I really appreciate your help! πŸ™‚

    Thank you! πŸ™‚

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on in reply to: Hiding users on buddypress based site #53477

    In this case I’m working with 3 user roles

    *Basic* This is the one set to hidden with the provided snippet
    User role: pmpro_role_1

    *Standard* This is visible
    User role: pmpro_role_2

    *Premium* This is visible
    User role: pmpro_role_2

    Also using the following setup:
    WordPress: Version 6.6.2
    BuddyPress: Version 14.2.1
    BuddyPress Global Search: Version 1.2.1

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on in reply to: [Resolved] BuddyPress Redirect To Profile #53475

    Hello

    I just remembered that PMP shows the “restricted content”-page, so in this case this would work fine.

  • Participant
    Level: Enlightened
    Posts: 68
    Katrine Spencer on in reply to: Multiple plugins – bugs #53473

    Hello tested some more of the oembeds and not a lot is supported.
    I haven’t been able to make a lot of them work since most use “blocks”.

    The only ones I’ve manged to make work are the following:
    Pinterest
    Flickr
    Youtube