Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1,751 through 1,775 (of 3,820 total)
  • @shanebp

    Moderator

    The name of the field: xprofile_get_field_id_from_name( 'Address' )

    @shanebp

    Moderator

    Are you 100% certain that the cpt is called ‘namaste_lesson’ ?

    @shanebp

    Moderator

    Currently, you are using the bp_init hook to set the member type.
    That won’t work because you are getting the member id from bp_displayed_user_id() which is only available on profile pages. And that’s why you get an error.
    And even if it worked – it’s very bad to set a member type on every page load.

    The example you linked to uses a specific hook to call the function that sets the member type.
    You need to find or create a hook for your situation – probably from wherever the _wcv_custom_settings_vendortype field is set.
    And then use the same approach as used in the example you linked to.

    @shanebp

    Moderator

    @agnesmeil – Try:

    function agnes_customize_lesson_tracking_args() {
    
        if ( ! bp_is_active( 'activity' ) ) 
            return;
     
        add_post_type_support( 'namaste_lesson', 'buddypress-activity' );
     
        bp_activity_set_post_type_tracking_args( 'namaste_lesson', array(
            'action_id'                         => 'new_namaste_lesson',
            'bp_activity_admin_filter'          => __( 'Published a new Lesson', 'custom-textdomain' ),
            'bp_activity_front_filter'          => __( 'Lessons', 'custom-textdomain' ),
            'bp_activity_new_post'              => __( '%1$s posted a new <a href="%2$s">Lesson</a>', 'custom-textdomain' ),
            'bp_activity_new_post_ms'           => __( '%1$s posted a new <a href="%2$s">Lesson</a>, on the site %3$s', 'custom-textdomain' ),
            'contexts'                          => array( 'activity', 'member' ),
            'comment_action_id'                 => 'new_namaste_lesson_comment',
            'bp_activity_comments_admin_filter' => __( 'Commented a Lesson', 'custom-textdomain' ),
            'bp_activity_comments_front_filter' => __( 'Lessons Comments', 'custom-textdomain' ),
            'bp_activity_new_comment'           => __( '%1$s commented on the <a href="%2$s">Lesson</a>', 'custom-textdomain' ),
            'bp_activity_new_comment_ms'        => __( '%1$s commented on the <a href="%2$s">Lesson</a>, on the site %3$s', 'custom-textdomain' ),
            'position'                          => 100,
        ) );
    }
    add_action( 'bp_init', 'agnes_customize_lesson_tracking_args' );

    @shanebp

    Moderator

    Formatting for all devices is tough.

    Re debug, maybe try running this version as a plugin:
    https://gist.github.com/shanebp/4270480b6afcb179ed77

    @shanebp

    Moderator

    Did you create the phone & address fields via wp-admin > Users > Profile Fields?

    BP stores profile data in a table called {your table prefix as set in wp-config}_bp_xprofile_data.
    So you need to write those fields to that table.

    Unless somebody here has used Form Maker, it is doubtful that you will get a detailed answer.

    @shanebp

    Moderator

    And $field_value = 'Woman'; to $value = 'Woman';

    @shanebp

    Moderator

    I wrote the class BP_Custom_User_Ids example.

    But for what you want, bp_parse_args is much more appropriate.

    Change the $query to this:

    $query = "SELECT user_id FROM " . $wpdb->prefix . "bp_xprofile_data WHERE field_id = " . $field_id . " AND value = '" . $value . "'";

    @shanebp

    Moderator

    I had to tweak your bp-email-debug-2.php so that the $email object is not overwritten.

    function pg_bp25_email_debug_failure( $status, $email ) {
    	$email_admin = bp_get_option( 'admin_email' );
    
    	if ( is_wp_error( $status ) ) {
    		$message = $status->get_error_message() . PHP_EOL . PHP_EOL . print_r( $email, true );
    	} else {
    		$message = 'Failure but not WP_Error.';
    	}
    
    	wp_mail( $email_admin, 'BuddyPress 2.5 email -- debug', $message );
    }
    

    I’ve sent you an email with the$email object.

    @shanebp

    Moderator

    Is PHP Safe Mode enabled?

    No, afaik.
    Host is running php 5.4 in which, I believe, safe_mode was removed.

    @shanebp

    Moderator

    retval['include'] = $woman_ids;
    should be
    $retval['include'] = $woman_ids;

    @shanebp

    Moderator

    Please use the code button when sharing code.

    The fields field_id and field_value do not exist in the function you are attempting to filter.
    See this for accepted fields:
    https://buddypress.trac.wordpress.org/browser/tags/2.2.1/src/bp-members/bp-members-template.php#L453

    I think you want this field retval['include'].

    Something like:

    function see_woman_gender( $retval ) {
    	global $wpdb;
    
    	$field_id = 3;
    	$field_value = 'Woman';
    	
    	$query = "SELECT user_id FROM " . $wpdb->prefix . "bp_xprofile_data WHERE field_id = " . $field_id . ' AND field_value = ' . $field_value;
    
    	$woman_ids = $wpdb->get_col( $query );
      
    	if ( !empty( $woman_ids ) ) 
    		$retval['include'] = $woman_ids;
    
    	return $retval;
    }
    add_filter( 'bp_after_has_members_parse_args', 'see_woman_gender' );

    There are field re meta data; I don’t think they work with profile data.
    But you could try this and let us know if it works:

    function see_woman_gender( $retval ) {
         $retval['meta_key'] = '3';
         $retval['meta_value'] = 'Woman';
     
        return $retval;
    }
    add_filter( 'bp_after_has_members_parse_args', 'see_woman_gender' );

    @shanebp

    Moderator

    Is there a private method to provide a user/pw?

    There is no PMing for this site.

    But Dan has confirmed the issue with WP 2015, so it will be looked at.

    Perhaps you could confirm that it does not occur with another WP theme, maybe try 2013?
    And state which theme you are using?

    @shanebp

    Moderator

    Perhaps this is due to the new BP Email API?
    If so, try this for BP emails:

    add_action( 'bp_email', function( $email_type, $email_obj ) {
    	$email_obj->set_from( "custom@example.com", "Custom Website Name" );
    }, 10, 2 );

    And use Dan’s functions to handle WP emails.

    In reply to: BuddyPress Sub Nav

    @shanebp

    Moderator

    @shanebp

    Moderator

    In order to filter activity entries re posts, you’ll need to use an existing plugin that allows front-end posting and create activity items. I’ll already provided the google terms to search on.

    @shanebp

    Moderator

    BP does not provide the ability to create WP posts on the front end.
    You could give each member the Editor role and then they could create posts via wp-admin.
    You will need to write some code to filter out various kinds of post-related activity entries.

    @shanebp

    Moderator

    You mean when viewing a single conversation / thread on your site?

    Paragraph breaks are shown properly when viewed in WP themes like 2013.
    Try switching momentarily to a WP theme to see if your issue is related to your theme.

    @shanebp

    Moderator

    What you want is the ability for members to create posts in the front end.
    And have filterable activity items created for those posts.

    Both items are very doable – via other plugins or custom code.

    To see the current offerings, Google: buddypress front end post

    @shanebp

    Moderator

    You need to provide a user / pw if you want someone to look at your forums.

    Make sure your issue is not related to your theme; switch momentarily to a WP theme like 2013.

    In reply to: Visible profile fields

    @shanebp

    Moderator

    You can get a profile field value like so:

    $child = xprofile_get_field_data( 'child', $user_id );
    
    if ( ! empty( $child ) ) 
        echo $child; 

    Getting the $user_id and changing the layout are both questions specific to bbPress and best asked on their forums.

    In reply to: BuddyPress Sub Nav

    @shanebp

    Moderator

    @shanebp

    Moderator

    Please use the code button when sharing code or error-log entries.

    Thanks for your report.

    Re #3: See https://buddypress.trac.wordpress.org/ticket/6937

    Re #2: Use the new BP filters.
    See: https://buddypress.org/support/topic/bp-2-4-x-to-2-5-wp_mail_from-not-working-with-new-emails-in-bp/#post-250532

    Re #1: You can open an enhancement ticket here..
    Use the same user / pw you use on these forums.
    The new BP Mail API is generating a lot of tickets – per usual for a new API.

    @shanebp

    Moderator

    You’ll need to be able to write and debug code.

    You can create a template overload of this file:
    buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\profile-loop.php

    Set a variable with the current user role. Google how to get that value.

    Then create an array of profile field ids for a role.
    For example :

    if ( $current_role == 'model' )
        $show_fields = array( 1, 5, 23 ); 
    elseif( $current_role == 'photographer' ) 
        $show_fields = array( 1, 7, 12, 35 );

    Then check if the current profile field is in that array.
    Something like:

    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    
    	<?php if ( in_array( bp_get_the_profile_field_id(), $show_fields ) ) : ?>
    	
    		<?php if ( bp_field_has_data() ) : ?>
    	
    			<tr<?php bp_field_css_class(); ?>>
    	
    				<td class="label"><?php bp_the_profile_field_name(); ?></td>
    	
    				<td class="data"><?php bp_the_profile_field_value(); ?></td>
    	
    			</tr>
    	
    		<?php endif; ?>
    		
    	<?php endif; ?>

    Avoid setting any fields to ‘required’ if you’re only going to show them based on role.

    @shanebp

    Moderator

    For private messages, auto-complete only shows your friends.

    To access everyone, put this in your theme/functions.php or in plugins/bp-custom.php

    define( 'BP_MESSAGES_AUTOCOMPLETE_ALL', true );

Viewing 25 replies - 1,751 through 1,775 (of 3,820 total)
Skip to toolbar