Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'buddypress'

Viewing 25 results - 1,751 through 1,775 (of 69,121 total)
  • Author
    Search Results
  • #324253
    kobusjfk
    Participant

    Wordpress v. 5.9.3
    Buddypress v. 10.2.0
    Theme. BuddyX

    In Private Messages – the message body part ‘shows’ at the top that you can attach a file or a link,
    the link option works, but when you click on the image attachment, it gives a popup that asks for the ‘source’ of the image. It doesn’t open a normal file explorer window to select the image.
    Please, how do I FIX this?

    #324243
    shanebp
    Moderator

    You can filter bp_current_user_can.
    See the function in buddypress\bp-core\bp-core-caps.php.

    #324241
    myveryownwebsite
    Participant

    Any update on this issue with pages being assigned to BuddyPress and then not being editable with Elementor? There is a work around, nu-assigning the page to BuddyPress, edit and then reassigning, but its an unnecessary process.

    I see the last reply to this topic was 12 months ago, so there should be a fix by now…

    maustingraphics82
    Participant

    I use gravity forms to create a new user from a groups tab and assign them to a group, based on the group that the group admin is adding them from. This was working just fine in BuddyPress version 8.0 but since upgrading to 10 it is no longer working. What am I missing?

    /**
     *  Add member form handler. This form is currently located under the Group Information tab
     */
    add_action( 'gform_after_submission', 'add_member_gform_handle', 10, 2 );
    function add_member_gform_handle( $entry, $form ) {
    	if ( $form['title'] === 'Add Member' ) {
    		$fields     = $form['fields'];
    		$first_name = rgar( $entry, '1' );
    		$last_name  = rgar( $entry, '2' );
    		$login      = rgar( $entry, '3' );
    		$password   = rgar( $entry, '4' );
    		$email 	    = rgar( $entry, '5' );
    		$group_id   = rgar( $entry, '6' );
    		$role       = rgar( $entry, '11' );
    		$notification = rgar( $entry, '9.1' );
    		$birthdate = rgar( $entry, '10' );
    
    		$userdata = array(
    			'user_login' => $login,
    			'user_pass' => $password,
    		);
    
    		if ( ! empty( $first_name ) ) {
    			$userdata['first_name'] = $first_name;
    		}
    		if ( ! empty( $last_name ) ) {
    			$userdata['last_name'] = $last_name;
    		}
    		if ( ! empty( $email ) ) {
    			$userdata['user_email'] = $email;
    		}
    		if ( ! empty( $role ) ) {
    			$userdata['role'] = $role;
    		}
    
    		// Create a new user
    		$new_user_id = wp_insert_user( $userdata );
    
    		// GFCommon::log_debug( __METHOD__ . '(): form => ' . print_r( $birthdate, true ) );
    
    		if ( ! is_wp_error( $new_user_id ) ) {
    			groups_join_group( $group_id, $new_user_id );
    
    			// Make the user displayed as a staff on a clubhouse page
    			if ( $role === 'staff' ) {
    				$group_ids =  groups_get_user_groups( $new_user_id );
    				$group = groups_get_group( array( 'group_id' => $group_ids['groups'][0]) );
    				$group_id = $group->id;
    				groups_promote_member( $new_user_id, $group_id, 'admin' );
    			} else {
    				groups_demote_member( $new_user_id, $group_id );
    			}
    
    			if ( ! empty( $notification ) ) {
    				tml_send_new_user_notifications( $new_user_id, 'both' );
    			}
    
    			if ( ! empty( $birthdate ) ) {
    				$date = DateTime::createFromFormat('Y-m-d', $birthdate);
    				$date = $date->format('Ymd');
    
    				update_field('user_birthdate', $date, 'user_' . $new_user_id);
    			}
    		}
    
    		// Delete form entry
    		// GFAPI::delete_entry( $entry['id'] );
    	}
    }
    
    /**
     * Add Member form validation
     */
    add_filter( "gform_validation_$clubnet_add_member_form_id", 'add_member_form_validation' );
    function add_member_form_validation( $validation_result ) {
    	$form = $validation_result['form'];
    	$login = rgpost( 'input_3' );
    	$email = rgpost( 'input_5' );
    	$send_notificaton = rgpost( 'input_9_1' );
     
        if ( ! empty( $login ) && get_user_by( 'login', $login ) ) {
            $validation_result['is_valid'] = false;
     
            //finding Field with ID and marking it as failed validation
            foreach( $form['fields'] as &$field ) {
                if ( $field->id == '3' ) {
                    $field->failed_validation = true;
                    $field->validation_message = 'The user with this login already exists.';
                    break;
                }
            } // foreach
        }
    
    	if ( ! empty( $email ) && get_user_by( 'email', $email ) ) {
            $validation_result['is_valid'] = false;
     
            //finding Field with ID and marking it as failed validation
            foreach( $form['fields'] as &$field ) {
                if ( $field->id == '5' ) {
                    $field->failed_validation = true;
                    $field->validation_message = 'The user with this email already exists.';
                    break;
                }
            } // foreach
        }
    
    	// GFCommon::log_debug( 'VALIDATION' . __METHOD__ . '(): form => ' . print_r( 'Empty', true ) );
    	// Email is required if we requested to send a email about user's account
    	if ( ! empty( $send_notificaton ) && empty( $email ) ) {
    		$validation_result['is_valid'] = false;
            //finding Field with ID and marking it as failed validation
            foreach( $form['fields'] as &$field ) {
    			if ( $field->id == '5' ) {
                    $field->failed_validation = true;
                    $field->validation_message = 'Email is required since you requested to send an email.';
                    break;
                }
            } // foreach
    	}
     
        //Assign modified $form object back to the validation result
        $validation_result['form'] = $form;
        return $validation_result;
    }
    
    /**
     * Role field
     */
    add_action( 'init', 'clubnet_add_role_field' );
    function clubnet_add_role_field( $form ) {
    	global $wp_roles;
    	global $clubnet_add_member_form_id;
    
        $all_roles = $wp_roles->roles;
        // $editable_roles = apply_filters('editable_roles', $all_roles);
    	// $roles_to_skip = array( 'administrator' );
    	$editable_roles = $all_roles;
    	$roles_to_display = array( 'mentor', 'member', 'youth_leader', 'alumni', 'staff' );
    	$choices = array();
    
    	foreach ( $editable_roles as $role => $role_data ) {
    		if ( ! in_array( $role, $roles_to_display ) ) {
    			continue;
    		}
    
    		$choice = array(
    			'text' => $role_data['name'],
    			'value' => $role
    		);
    
    		array_push( $choices, $choice );
    	}
    
    	// Reorder to make member role first
    	usort( $choices, function( $choice ) {
    		if ( $choice['text'] === 'Member' ) {
    			return -1;
    		}
    
    		return 1;
    	} );
    
    	$form = GFAPI::get_form( $clubnet_add_member_form_id );
    	
    	if ( ! $form ) {
    		return;
    	}
    
    	$label = 'User Role';
    	$field_idx = -1;
    	$field_id = -1;
    
    	foreach ($form['fields'] as $idx => $field) {
    		if ( $field->label === $label ) {
    			$field_idx = $idx;
    			$field_id  = $field->id;
    		}
    	}
    
    	if ( $field_idx === -1 ) {
    		$field_id = GFFormsModel::get_next_field_id( $form['fields'] );
    	}
    
    	$props = array( 
    		'id' => $field_id,
    		'label' => $label,
    		'type' => 'select',
    		'choices' => $choices,
    	); 
    
    	if ( $field_idx === -1 ) {
    		$field = GF_Fields::create( $props );
    		$form['fields'][] = $field;
    		GFAPI::update_form( $form );
    	} else if ( $form['fields'][$field_idx]->choices !== $choices ) {
    		$field = GF_Fields::create( $props );
    		$form['fields'][$field_idx] = $field;
    		GFAPI::update_form( $form );
    	}
    }
    
    #324230

    In reply to: NSFW site =

    shanebp
    Moderator

    You need to look in the code for ‘membership-account’ which is not a BuddyPress page.
    Perhaps you are using a membership plugin – contact the plugin creators.

    #324216
    oumz99
    Participant

    This is for group activity. Is this from BuddyPress core ? Are you using any plugin which claims to make activity load “live” ?

    personally, I have always hated any code which makes periodic calls to your server.

    yesbutmaybeno
    Participant

    Hi!
    Trying to find the source of sudden weird lag on my large Buddypress website. I noticed this query running very frequently:

    # Time: 220408 21:41:46
    # User@Host: [removed] @ localhost []
    # Thread_id: 337208  Schema: [removed] QC_hit: No
    # Query_time: 1.645619  Lock_time: 0.000068  Rows_sent: 0  Rows_examined: 0
    # Rows_affected: 0  Bytes_sent: 77
    SET timestamp=1649454106;
    SELECT DISTINCT a.id  FROM wp_bp_activity a  WHERE  
    ( 
    	( 
    		( 
    			a.component = 'groups' 
    			AND 
    			a.item_id IN ( 0 )
    		)
     
    		AND 
    		a.hide_sitewide = 0
    	)
    
    )
     AND a.is_spam = 0 AND a.type NOT IN ('activity_comment', 'last_activity') ORDER BY a.date_recorded DESC, a.id DESC LIMIT 0, 16;

    Query_time: 1.645619

    It always results in nothing. So, where is it coming from and how can I stop it?
    Any idea what function is triggering this, I’d be able to even edit the core file just to have it check “if certain params are true, don’t even run this query”

    I think it’s killing my site’s performance

    #324200

    In reply to: Activate user in PHP

    uyousaf60
    Participant

    Automatically follow everyone in buddypress. Can Anyone Help?

    tmuc
    Participant

    Hi, I installed BuddyPress on my site earlier today and now I can’t log in to my administrative account from the frontend of my site. When I try to login, I get sent to a page requesting an activation key. Unfortunately, I don’t have an activation key, nor was I ever sent one (I checked my emails and SPAM), so I can no longer sign in.

    I use the Paid Memberships Pro plugin to handle registration and membership levels on my site. Normally this works well. I also installed and activated bbPress and the PM Pro add-ons to integrate with BuddyPress and bbPress respectively.

    Any advice on how to fix this?

    #324190
    alexcitos19
    Participant

    Hello!

    I have the Elearni template which has this buddypress plugin for signup among other options.

    I want customers who want to register not to activate via email, but automatically.

    Another option would be to disable this account activation but I don’t see any options within the plugin that allow me to do so.

    How could I do this?

    devjordanw
    Participant

    For our intranet, we use BuddyPress extended profiles as well as WPO365 to sync data from Microsoft active directory. We don’t allow users to edit their avatars or user information as everything is synced from Microsoft.

    After the last update, our “Recently active users” widget is showing old (and sometimes no) avatar for users. When you click through to the profile however the newer images load correctly.

    It almost looks like the avatars stored for BuddyPress are different from the BuddyPress extended profile avatar.

    Is there a simple fix for this or do we need to stop using the recently active widget all together?

    mackey1
    Participant

    Thanks for the quick reply!

    A new defect bug ticket #8678 has been created to track the code change.

    Also, thanks for the suggestion to use bp_get_group_avatar() in the meantime. I’ll look into that idea.

    This support ticket can be closed.

    #324182
    bpauljr
    Participant

    I am experiencing an issue with Smash Balloon YouTube Feed when loading more of the videos. If I disable BuddyPress the “Load More” button works normally.

    When displaying the feed (say about 6 videos) there is a button to “Load More” below the videos. When the button is clicked a new browser tab will open and display in the url “about:blank#blocked”. When I go back to the website page, it does “Load More” however I need to prevent this new blank tab from opening.

    Wordpress v. 5.9.2 with Olympus Theme
    BuddyPress V. 10.2.0
    Smash Balloon YouTube Feed V 1.4.4

    shanebp
    Moderator

    You are correct. A parameter for $html is missing and defaults to true.
    Please open a new ticket and refer to this thread.

    You could call bp_get_group_avatar() instead and set that parameter.
    Find the function in this file and review the params:
    buddypress\bp-groups\bp-groups-template.php

    mackey1
    Participant

    The output format for text returning from function bp-groups-bp_get_group_avatar_url appears to have changed between 9.2.0 and 10.0.0. The output used to produce a raw URL but now it produces HTML.

    I noticed the change when I tried to upgrade from 9.2.0 to 10.2.0. It breaks my code which was expecting the raw URL.

    Was the output format changed intentionally?

    It seems to me the name of the original function was accurate for raw URL, but the new version inadvertently switches the nature of the group avatar url function.

    It would be nice to clarify whether the return format change for the bp_get_group_avatar_url was intentional or not. If it was intentional and there’s no plan to revert to the old function version then the work around for anyone who wishes to strip the raw url out of the img text is …


    // Hack for Buddypress v10.0.0+
    // Pull raw url from the full HTML element
    $group_image_url = bp_get_group_avatar_url( $group, 'full' );
    preg_match('/<img(.*)src(.*)=(.*)"(.*)"/U', $group_image_url, $result);
    $raw_image_url = array_pop($result);

    It may be better to introduce a new function called bp_get_group_avatar_img which returns the img html and keep the original function, bp_get_group_avatar_url, returning the raw url.

    Please advise on whether the change to the function bp_get_group_avatar_img in v10.0.0+ will remain permanent or whether there are plans to revert the function to the previous 9.2.0 behaviour.

    My preference, if it makes sense, is to stick with the original 9.2.0 version, but I can adapt to the 10.0.0+ version if required. The raw url gives me more flexibility to code my preferred img element.

    Thanks!

    #324176
    bchdan
    Participant

    Did you ever figure solve this? I just started using Mailgun and am having the same problem. Mailgun says they need the API that Buddypress is calling. I don’t know how to get that. Would love to know if you have a fix.

    #324173

    In reply to: Database Errors

    Mike Witt
    Participant

    OK. I’ve never created a track ticket before, so I hope I’ve done this right:
    https://buddypress.trac.wordpress.org/ticket/8676

    #324172

    In reply to: Database Errors

    shanebp
    Moderator

    You could try opening a ticket. Reference this thread.

    #324170
    danielasanhueza
    Participant

    Hey, so i am trying to add a filter in the members search to only show the profiles that have a certain role in an Xprofile field, doing some research i came across the next code

    if ( !defined( 'ABSPATH' ) ) exit;
     
    class BP_Loop_Filters {
     
        /**
         * Constructor
         */
        public function __construct() {
            $this->setup_actions();
        }
     
    
        private function setup_actions() {
    
            add_action( 'bp_members_directory_order_options', array( $this, 'random_order' ) );
     
    
            if( bp_is_active( 'groups' ) )
                add_action( 'bp_groups_directory_order_options',  array( $this, 'random_order' ) );
     
    
            if( is_multisite() && bp_is_active( 'blogs' ) )
                add_action( 'bp_blogs_directory_order_options',   array( $this, 'random_order' ) );
        }
     
    
        public function random_order() {
            ?>
            <option value="random"><?php _e( 'Random', 'buddypress' ); ?></option>
            <?php
        }
     
    }
     
    function bp_loop_filters() {
        return new BP_Loop_Filters();
    }
     
    add_action( 'bp_include', 'bp_loop_filters' );

    i tried adjusting it to call the Xprofile fields i want but it caused a complete error on the website, any help?

    #324135
    epgb101
    Participant

    Hi..
    I have had the fantastic Buddypress working perfectly for a year on a folder install of WP (not multisite) like; http://www.mysite.com/wordpressandbuddypressinstall/register/.

    But I discovered for the last week people are no longer able to register (it just returns you to /register page). I disabled ALL plugins did not fix /register – HOWEVER disabling Buddypress plugin (and all other plugins) does allow registration on plain WordPress. I tried registering on Buddypress on different browsers / different PCs / using 20-19 theme etc but nothing fixes it.

    Q: does anyone have any suggestion as why /register may have stopped or how to fix?

    ps – I have Settings > Anyone can register [x] on and permalinks set to Post name

    Thank you in advance.

    tabarlyy
    Participant

    Hi,
    here is the my code. tab is created,
    but if user not member this private group redirect to wp-login page. how to open everyone this tab?

    function custom_members_tab() {
    if ( bp_is_groups_component() && bp_is_single_item() ) {
    global $bp;
    $group_link = bp_get_group_permalink( $bp->groups->current_group );
    $tab_args = array(
    ‘name’ => esc_html__( ‘destination’, ‘default’ ),
    ‘slug’ => ‘destination-members’,
    ‘screen_function’ => ‘destination_members_screen’,
    ‘position’ => 60,
    ‘parent_url’ => $group_link,
    ‘parent_slug’ => $bp->groups->current_group->slug,
    ‘default_subnav_slug’ => ‘destination-members’,
    ‘item_css_id’ => ‘destination-members’,
    ‘access’ => ‘anyone’,
    ‘show_tab’ => ‘anyone’,
    ‘show_for_displayed_user’ => true
    );
    bp_core_new_subnav_item( $tab_args, ‘groups’ );
    }
    }
    add_action( ‘bp_setup_nav’, ‘custom_members_tab’ );

    function destination_members_screen() {
    add_action( ‘bp_template_content’, ‘custom_group_tab_content’ );
    bp_core_load_template( ‘buddypress/members/single/plugins’ );
    }
    function custom_group_tab_content() {
    echo “show non group members, guests, everyone”
    }

    I read this ticket, but I couldn’t understand how to use it.
    https://buddypress.trac.wordpress.org/ticket/4785

    #324113

    In reply to: Database Errors

    Mike Witt
    Participant

    @shanebp – OK, I deactivated every other plugin, and I switched from 2022 to 2020 as you suggested.

    Getting the same error when clicking on one of multiple PM notifications.

    The only things active are BuddyPress and the 2020 theme. No 2020 child.

    #324110

    In reply to: Database Errors

    Mike Witt
    Participant

    @shanebp – OK, I finally figured out how to replicate the error.

    Wordpress 5.9.2
    Twenty Twenty-Two Version: 1.1
    BuddyPress 10.2.0 (Nouveau)
    And some other plug-ins, including MemberPress and bbPress

    (1) Send two private messages to someone.
    (2) That person clicks on one of the notification, and the error happens
    Sometimes it happens if the recipient just refreshes their profile (and hence the notifications)

    Note: There need to be multiple private message notifications. If there’s just one notification the error doesn’t appear to happen.

    The error looks a bit different with BP Nouveau:

    [31-Mar-2022 17:41:07 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND user_id = 2 AND component_name = 'messages' AND component_action = 'new...' at line 1 for query UPDATE wp_bp_notifications SET is_new = 0 WHERE item_id IN () AND user_id = 2 AND component_name = 'messages' AND component_action = 'new_message' made by do_action('wp_ajax_messages_get_thread_messages'), WP_Hook->do_action, WP_Hook->apply_filters, bp_nouveau_ajax_get_thread_messages, bp_thread_the_message, BP_Messages_Thread_Template->the_message, do_action('thread_loop_start'), WP_Hook->do_action, WP_Hook->apply_filters, bp_messages_screen_conversation_mark_notifications, bp_notifications_mark_notifications_by_item_ids, BP_Notifications_Notification::update_id_list

    #324098
    havealookhere
    Participant

    yes, its working with 2.7.

    what you do is using wp roll back plugin. install and activate it. Go to plugins and scroll to the bp activity plugin. You can click roll back or something there. Then click 2.7 and install and activate.

    Then go to general settings of bp activity and first press submit/save. Then the error is gone and it will work.

    I did write a lot of emails before the developer admitted it was a bug 🙂 but i did not get answer also about when next version is ready. On my website it works with the newest wordpress and buddypress.

    good luck

    #324097
    carasse64
    Participant

    Hi

    I installed the Buddypress activity filter plugin and I noticed the bug that’s why I tryed to find an other PHP code writing solution. I contacted WBcom and they confirmed me the bug and that it would be corrected in the next version. But when ? No response from them at the moment.

    You confirm me the past version 2.7 works well with the last WP an buddypress versions ?

    Thanks a lot for your help.

    Fabien

Viewing 25 results - 1,751 through 1,775 (of 69,121 total)
Skip to toolbar