Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'buddypress'

Viewing 25 results - 401 through 425 (of 69,209 total)
  • Author
    Search Results
  • Renato Alves
    Moderator

    This was fixed and will be released as part of BuddyPress 14.1. https://buddypress.trac.wordpress.org/milestone/14.1.0

    carinacodes
    Participant

    This is how i did it, and it works as i tested it for my site.

    Go to your files:
    public_html/wp-content/plugins/buddypress/bp-templates/bp-nouveau/includes

    wp-content > plugins > buddypress > bp-templates > bp-nouveau > includes

    edit functions.php, go to line 983, or

    keyboard find and search for “Registering for this site is easy. Just fill in the fields below, and we’ll get a new account set up for you in no time.”

    edit and click save

    Pls
    Participant

    After checking, I found that the endpoint did not verify user rights at all, and in fact, it did not handle the user_id mentioned in the handbook at all for creating activities.

    As a patch, I asked AI to help me generate a plug-in. Anyone who needs it can directly store the following code as a PHP and upload it to the plugins:

    Allow administrators to create dynamics for other users through API:

    <?php
    /**
     * Plugin Name: Admin API activity creates privilege
     * Description: Allows administrators to create activities on behalf of other users.
     * Version: 1.0.4
     * Author: Google Gemini Pro
     */
    
    //Allow administrators to create activities on behalf of other users
    add_filter( 'bp_rest_activity_create_item_permissions_check', function( $retval, $request ) {
        if ( current_user_can( 'manage_options' ) ) {
            $retval = true;
        }
        return $retval;
    }, 10, 2 );
    
    //Properly handle the user_id parameter when creating an activity
    add_filter( 'bp_activity_before_save', function( $activity_data ) {
        //Get request body content
        $body = file_get_contents('php://input');
    
        //Parse JSON data
        $data = json_decode( $body, true );
    
        //Check whether the user_id parameter exists
        if ( isset( $data['user_id'] ) && get_userdata( $data['user_id'] ) ) {
            //Modify the user_id property of the $activity_data object
            $activity_data->user_id = $data['user_id']; 
        }
    
        return $activity_data;
    } );

    Allow administrators to obtain other users ‘XProfiles through API:

    <?php
    /**
     * Plugin Name: BuddyPress Admin API read XProfile privilege
     * Description: Allows administrators to read any user's XProfile data regardless of field visibility settings.
     * Version: 1.0.0
     * Author: Google Gemini Pro
     */
    
    //Allow administrators to read all XProfile data
    add_filter( 'bp_rest_xprofile_data_get_item_permissions_check', function( $retval, $request ) {
        if ( current_user_can( 'manage_options' ) ) {
            //Check whether the field exists
            $field = xprofile_get_field( $request->get_param( 'field_id' ) );
            if ( $field ) {
                //Check whether the user exists
                $user = get_userdata( $request->get_param( 'user_id' ) );
                if ( $user ) {
                    $retval = true;
                } else {
                    $retval = new WP_Error(
                        'bp_rest_member_invalid_id',
                        __( 'Invalid member ID.', 'buddypress' ),
                        array( 'status' => 404 )
                    );
                }
            } else {
                $retval = new WP_Error(
                    'bp_rest_invalid_id',
                    __( 'Invalid field ID.', 'buddypress' ),
                    array( 'status' => 404 )
                );
            }
        }
        return $retval;
    }, 10, 2 );

    I am pretty sure this is a bug, or the API handbook has not been maintained for many years. In the long run, maybe someone should fix these issues in the core program rather than using the temporary plugins I provide.

    Pls
    Participant

    I’m trying to get the XProfile of the specified user using the API.
    My endpoint looks like this:
    https://xxxxxxxx/wp-json/buddypress/v1/xprofile/2/data/4

    As expected, it will get Fields #2 with user ID 4, which has enforced visibility and visibility level onlyme (adminsonly in the database).
    But when I used an authentication with admin privileges to get the endpoint, it returned “Sorry, the profile field value is not viewable for this user.”

    After testing,”All Members” is also invalid, only in “Everyone” API can get data properly

    The Buddypress version I am using is 14.0

    #334829
    Venutius
    Moderator

    @martenw

    Hi there, would you like to open a bug report in trac for this?

    https://buddypress.trac.wordpress.org/

    john201502
    Participant

    I created the CDN for the website wechat.nz:
    https://d6476bsmtk1fy.cloudfront.net/
    The activities of the member page are correct when loaded for the first time, but the activities loaded after the second time are not the activities of this user.
    https://d6476bsmtk1fy.cloudfront.net/members/JuneLee/

    The mate of Youzify said that it seems that there is a problem when loading the Ajax of the anti-proxy Buddypress.

    Does anybody have any technical suggestions about this?

    Thanks.

    Best regards

    #334803

    @emaralive @vapvarun thank you for the information, I can try editing and looking into other solutions when I get a chance but this one seems like a warranted challenge for the BuddyPress Programming team.


    @thinlizzie
    it might be a waste of time at this point until the code is revised to take into account other CONSTANTS and the issue with high resolution avatars, cover photos and group profile photos getting discarded after upload. On one hand, that is nice to save server resources, but on the other hand, it’s frustrating because the images look lousy. It cheapens the look of BuddyPress to be honest.

    The BuddyPress also needs more design customization options especially the social feed, it’s convenient to have it generate the “Social Feed” page automatically but that is causing me trouble. I’d love to be able to put that Social Feed as a WordPress Widget or in a shortcode to embed on any page template I want. This way, I can customize the background, add a custom title or whatever else I want. BuddyPress has a lot of Widgets available but I want the Social Feed as well with customization options.

    #334800
    emaralive
    Moderator

    @vapvarun I’m not recognizing any of the filters containing resize_args from the posted code snippet, do they ring a bell with you? Also, I think there is some misunderstanding about Avatars and Cover Images, i.e., the process thereof. I’m also thinking instead of all this coding requirement for end users, maybe a configuration screen would help facilitate the setting of the various parameters.

    Furthermore, we (BP Team) should revisit this process because it is not possible to regenerate the Avatars or Cover Images because, I believe, the original images are deleted. Thoughts?


    @whyknott
    There are no CONSTANTS specific to Group Avatars; meaning an Avatar is an Avatar, regardless if it is used as a User Avatar or a Group Avatar, they just reside in different directories/folders. Additionally, there are 11 CONSTANTS that are associated with Avatar (if my count is accurate), you may find them in a list, along with other BP related CONSTANTS at the following URL:

    BuddyPress Constants

    As to setting the “quality” level for when a resize is triggered, I’ll have to get back to you after I confirm that the filter you should be using for resize ‘quality’, does what it should. However, I need to build a tool to grab the resized image before it gets deleted, so that I can verify the ‘quality” level.

    #334792
    ladypersonal11
    Participant

    To validate file type fields before saving to the database, ensure you are using the correct hook and validation logic. The xprofile_data_before_save hook is intended for profile data in BuddyPress, but your issue might be with the validation function itself. Verify that your validate_required_unshared_fields function is properly defined and hooked. Additionally, check that you are correctly accessing and validating the file type fields within this function. Ensure your function looks something like this:

    php
    Copy code
    function validate_required_unshared_fields($field) {
    // Add your validation logic here
    if (/* validation fails */) {
    // Handle validation failure
    }
    }
    add_action(‘xprofile_data_before_save’, ‘validate_required_unshared_fields’);
    Make sure to replace the placeholder comments with your actual validation logic.

    Renato Alves
    Moderator
    #334787
    emaralive
    Moderator

    Currently, there isn’t any updated documentation regarding Avatar’s. There is some outdated info/documentation which is missing some information and is inaccurate with other information. A goal of the BuddyPress Team (BP) is to make documentation available that is current and accurate. That stated this will be on my TODO list to release documentation regarding Avatars, although what I’m covering here would be considered a “developer” handbook chapter.

    In the meantime, there are a number of CONSTANTS that define the size (Width x Height) of various aspects of an Avatar, some of which you already know. There are other parameters that specify the “quality” during a resize and/or cropping process and these processes utilize WordPress to accomplish these tasks.

    For example the CONSTANT – BP_AVATAR_ORIGINAL_MAX_WIDTH – default set to 450 – triggers a resize of an uploaded image that exceeds the size defined by this CONSTANT at a “quality” level of 90 (default). In your case, the 610 x 610 image is resized to 450 x 450 at a “quality” level of 90. Assuming defaults for thumb (50) and full (150) the image (450 x 450 @ 90) is cropped based on the cropping boundary box to the sizes for thumb and full at a “quality” level of 82 (default). In this example, your 610 x 610 image has undergone 2 processes that has reduced the “quality” twice.

    To mitigate the degradation process, you could set BP_AVATAR_ORIGINAL_MAX_WIDTH equal to or greater than 610. The point being this would be the max width size before triggering a resize. This now leaves the cropping process at a “quality” level of 82, of which, you could mitigate by setting the JPEG “quality” level to something greater than 82 (max would be 100), assuming that you are uploading a jpg/jpeg image. This is defined at the following URL:

    jpeg_quality

    I’ll assume you know how to create a filter with a callback to return the desired “quality” level. Whether what I’ve outlined will satisfy your requirements for not being “horribly blurry” is yet to be determined because there may be another reason for “horribly blurry” and this just represents another “process of elimination” step/stage.

    #334782

    What I mean is, I’m uploading a perfectly crisp image that is 610×610 pixels in size and BuddyPress optimizes it and/or scales it down to fit the predefined image size, which is fine, however, in the process makes it look bad/blurry. I want the profile images to look better. Plain and simple.

    I don’t want the images to be 610×610 because they are profile images but at the same time I don’t want them looking low res. I think if BuddyPress is setting them as ‘thumbnail’ size then it’s using WordPress built-in optimized image which those are typically horribly blurry.

    Mike Witt
    Participant

    @venutius, yes that does appear to fix it. I guess I was reading the line wrong. This seems like a simple change. I can certainly patch it temporarily, but is there any chance of getting it fixed in the next release?


    @espellcaste
    , actually I’m running different versions of BP on different sites. But I don’t think that file has change recently (it is legacy after all). The exact error depends on what PHP you’re running. Older PHPs give:

    Warning: printf(): Too few arguments ... plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/index.php on line 164

    Newer PHPs give:

    PHP Fatal error: Uncaught ArgumentCountError: 2 arguments are required, 1 given in ... plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/index.php:164

    and then a stack trace.

    #334779
    emaralive
    Moderator

    Hi @whyknott,

    I’m a bit confused because I’m not sure what you mean by:

    I need to change the quality of the images to 100%

    Is this in reference to the JPG compression value? Additionally, I find this confusing, as well:

    How do I tell BuddyPress to use the full image size and just scale it down to fit the image size vs. using the thumbnail size

    As your code snippet indicates, there are 2 (two) image sizes (full & thumb) for Avatars and the default sizes are 50 x 50 for thumb and 150 x 150 for full, both are in pixels. So, if you wish to change the sizes, then you need to change the numeric values to something other than the default values. These are the sizes after a crop of the original image.

    To help clarify some things, what is the size (width x height) of the original image that you are using to upload as an Avatar? Let’s start here and see if we can find a solution to your “quality” issue.

    Renato Alves
    Moderator

    Can you share the error and which version of BuddyPress you are using?

    #334767
    TheSupercargo
    Participant

    On our buddypress site @mentions work for some but not all our members. However, there doesn’t seem to be a pattern. Sometimes you type @name and it activates a link, sometimes it doesn’t. Sometimes, in the same forum post, one @name works while another does not. I’m advising members to send e-mail notes to people if they want to be sure they see they’ve been @name tagged. Not ideal.

    I can’t seem to find anyone else having this issue, so I guess it’s to do with our set-up, but can anyone offer some pointers where I can start to try an fix it?

    Thanks,
    John

    WP version v6.6.1
    Buddy Press v14.0.0
    Asaros Forums v2.9.0

    Pens Around The World

    #334766
    capexpe
    Participant

    Hello BP-developers,

    I also want to thank you for maintaining and developing Buddypress!
    We have been using it for almost 10 years and never had issues when updating to a new version.

    Passing to 14.0.0 was different. Thanks for the BP Classic that fixes many issues for us but as Lars we still cannot have the translation working yet.

    We used to use the buddypress-fr_FR.mo file to change the by default translation of “groupe” (French word for group) in “Expé” for expédition on our site. But changing the buddypress-fr_FR and re-uploading to wp-content/languages/plugins as we were used to do at each update, does not seem to work.

    Here is a link to our website with both public and registered users : where the blue button close to the title should be “Créer une Expé” instead of “Créer un groupe” and the other blue buttons next to each group “Rejoindre l’Expé” instead of “Rejoindre le groupe”.

    Thanks for your help.

    WP 6.6.1
    BP 14.0.0
    Theme : a minimally customed child version of Boss

    #334762
    Venutius
    Moderator

    This is something I’m working on in the plugin I’m building as a result of this thread: https://buddypress.org/support/topic/disable-rss/

    I already have the code to remove stuff from wp search in another plugin I have, I just need to put that into this new plugin and update it specifically for this task.

    I should have some code in the next week.

    #334759
    lmstearn
    Participant

    WP: 6.6.1, BBClassic & BuddyPress: 14.0, Stearnvault.com
    This enquiry is regarding excerpts from private posts displayed in the search hit results of the in-built Site Search. Looking for repro before filing at Trac.
    Because of the privacy concerns, the code from this SO thread is used to disable all search at the site at this time.
    Thanks.

    #334753
    Lars Henriksen
    Participant

    Hello BP-developers

    Thank you for maintaining and developing Buddypress!

    I have an issue with translating some site messages and labels, i.e. ‘members-only area’ + ‘This community area is accessible to logged-in members only.’ , text in buttons like ‘view group’ and some time stamps like ‘a month ago’

    I use Loco Translate, and I update the strings, but the translations don’t show.

    Here is a link to a group, which redirects to ‘private community’

    WP 6.6.1
    BP 14.0.0

    #334750
    locker17
    Participant

    I want to make users able to add bullet or numeric lists to their profile page. Doesn’t matter if I chose wp user meta bio field or multiline xprofile field, both display lists in user profile as words with linebreaks (br). How can I avoid that and show it like it is saved in db?

    Same question here 3 years ago, unanswered.

    weird formatting with bulleted lists in user meta fields?

    #334734

    In reply to: disable rss

    Will do! That sounds great. I feel like BuddyPress has so many features and is great but lacks more UI and setting options so web designers/developers can customize easier to help clients.

    #334732

    In reply to: disable rss

    Perhaps I need to create a new post for this or find the relevant one, but the Avatar and Cover images are showing blurry. I tried adding this code to my functions file (via snippets plugin) and it did nothing. I need to change the quality of the images to 100% not be so blurry. How do I tell BuddyPress to use the full image and just scale it down to fit the image size vs. using the thumbnail size, since typically in WordPress those images are horribly blurry.

    Here’s the code I added which only alters the image sizes not QUALITY.

    <?php
    
    // Define Buddypress Avatars Dimensions.
    if ( ! defined( 'BP_AVATAR_THUMB_WIDTH' ) ) {
        define( 'BP_AVATAR_THUMB_WIDTH', 50 );
    }
    
    if ( ! defined( 'BP_AVATAR_THUMB_HEIGHT' ) ) {
        define( 'BP_AVATAR_THUMB_HEIGHT', 50 );
    }
    
    if ( ! defined( 'BP_AVATAR_FULL_WIDTH' ) ) {
        define( 'BP_AVATAR_FULL_WIDTH', 150 );
    }
    
    if ( ! defined( 'BP_AVATAR_FULL_HEIGHT' ) ) {
        define( 'BP_AVATAR_FULL_HEIGHT', 150 );
    }
    @whynotadv
    Comment
    
    #334731

    In reply to: disable rss

    Thanks Venutius, I spent some time using your code along with ChatGPT and this seems to have worked for me, all the feeds are gone….maybe this will help someone else!

    function disable_all_rss_feeds() {
        // Disable all WordPress feeds
        function disable_all_feeds() {
            wp_die(__('No feed available, please visit the <a href="'. get_bloginfo('url') .'">homepage</a>!'));
        }
    
        add_action('do_feed', 'disable_all_feeds', 1);
        add_action('do_feed_rdf', 'disable_all_feeds', 1);
        add_action('do_feed_rss', 'disable_all_feeds', 1);
        add_action('do_feed_rss2', 'disable_all_feeds', 1);
        add_action('do_feed_atom', 'disable_all_feeds', 1);
        add_action('do_feed_rss2_comments', 'disable_all_feeds', 1);
        add_action('do_feed_atom_comments', 'disable_all_feeds', 1);
    
        // Remove RSS feed links from the header
        remove_action('wp_head', 'feed_links', 2);
        remove_action('wp_head', 'feed_links_extra', 3);
    
        // Disable BuddyPress feeds
        remove_action('bp_activity_feed', 'bp_activity_action_sitewide_feed');
        remove_action('bp_activity_sitewide_feed', 'bp_activity_action_sitewide_feed');
        remove_action('bp_member_activity_feed', 'bp_activity_action_sitewide_feed');
        remove_action('bp_group_activity_feed', 'bp_activity_action_sitewide_feed');
        remove_action('bp_member_feed', 'bp_dtheme_activity_feed');
        remove_action('bp_group_feed', 'bp_dtheme_group_activity_feed');
    
        // BuddyPress Nouveau template pack feed removals
        remove_action('bp_nouveau_group_header_meta', 'bp_nouveau_group_meta', 50);
        remove_action('bp_nouveau_group_header_meta', 'bp_nouveau_group_meta', 50);
        remove_action('bp_nouveau_action_activity_content', 'bp_nouveau_activity_feed', 5);
    
        // Disable BuddyPress members feeds
        remove_action('bp_members_directory_members_feed', 'bp_members_feed');
    
        // Disable BuddyPress groups feeds
        remove_action('bp_groups_directory_groups_feed', 'bp_groups_feed');
        remove_action('bp_group_activity_feed', 'bp_group_activity_custom_feed');
    
        // Disable BuddyPress blogs feeds
        remove_action('bp_blogs_directory_blogs_feed', 'bp_blogs_feed');
        remove_action('bp_blog_comments_feed', 'bp_blog_comments_custom_feed');
    
        // Disable BuddyPress forums feeds
        remove_action('bp_forums_directory_topics_feed', 'bp_forums_feed');
        remove_action('bp_forums_topic_feed', 'bp_forum_topic_custom_feed');
    }
    add_action('bp_init', 'disable_all_rss_feeds', 1);
    
    // Disable BuddyPress Nouveau feeds
    function disable_buddypress_nouveau_feeds() {
        remove_action('bp_nouveau_activity_feed', 'bp_nouveau_activity_feed');
        remove_action('bp_nouveau_group_feed', 'bp_nouveau_group_feed');
    }
    add_action('bp_init', 'disable_buddypress_nouveau_feeds', 1);
    
    // Disable pingbacks and trackbacks for privacy
    add_filter('xmlrpc_methods', function($methods) {
        unset($methods['pingback.ping']);
        return $methods;
    });
    
    add_filter('wp_headers', function($headers) {
        unset($headers['X-Pingback']);
        return $headers;
    });
    
    add_filter('pings_open', '__return_false', 10, 2);
    
    // Remove RSS feed div by ID and class using jQuery
    function remove_rss_feed_div() {
        if (is_buddypress()) {
            ?>
            <script type="text/javascript">
            jQuery(document).ready(function($) {
                $('#activity-rss-feed.feed').remove();
            });
            </script>
            <?php
        }
    }
    add_action('wp_footer', 'remove_rss_feed_div');
    
    add_filter( 'bp_rest_api_is_available', '__return_false' );
    #334728

    In reply to: URL page is blank

    kelly80
    Participant

    ok, I just tried that on my staging site and same issue occurs. It still sees the Group I created before. It’s like it’s somehow still connecting with an existing BuddyPress account, only I have no way to clear that out or select to create a new account.

Viewing 25 results - 401 through 425 (of 69,209 total)
Skip to toolbar