Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 1,051 through 1,075 (of 5,755 total)
  • Author
    Search Results
  • #262165

    In reply to: Forms from Buddypress

    danbp
    Participant

    BuddyPress comes with his own form on xprofile component.

    In 99% of cases, you haven’t to use an external form plugin. For the remaining 1%, you need good php knowledge to accomplish some custom work.

    Everything you need to know about xprofile fields is explained here:

    User Extended Profiles

    #262157
    bcanr2d2
    Participant

    I seem to have lost the template message that shows if the profile has been successfully saved.

    I have a custom function that runs on the following:

    add_action( ‘xprofile_updated_profile’, ‘syncbuddypresstoacf’ ); would this be making my saved and any custom errors not display when it is being saved?

    There is no priority on this action.
    I’m able to see the error messages relating to missing required fields, but that is all

    thattuneuk
    Participant

    Hi can anyone help I have a problem with the extended base group profile fields on 2 profiles the profile field boxes are fine and display full length but on the newest members profile fields seem to be displaying in a small box and aligned over to the right of the page not as wide as my admin profile fields or one of the other user profiles iv’e tried a search and found a code to over ride the CSS but it hasn’t worked i’m using the latest version of BuddyPress and my website is http://thattuneuk.com I hope someone knows how to fix this problem as iv’e been racking my brains for a couple of days trying to sort it out.

    bcanr2d2
    Participant

    My Scenario:

    I only have one profile group, and two member types.

    Each of them has some shared required fields, which I have set as required, but I would like some additional fields to be made required for each member type.

    IE

    Shared Member Fields: Name, Age

    Separate for Member Type A: XProfile Field A

    Separate for Member Type B: Xprofile Field B

    Currently, I am showing this fields conditionally using the Conditional Profile Fields for BuddyPress plugin as they select a Member Type, and at this stage I’d consider them mandatory, although I can’t have both XProfile Field A and B both marked as required in BuddyPress.

    I’ve looked up a couple of solutions, and mine is mainly based on the following: buddypress bp_core_add_message() doesn’t fire why?

    For a required field, it shows the error message, but not so for the custom error message I want to display, could someone give me a pointer as to why?

     //Validate and force values for items that are NOT required
    function validate_required_unshared_fields($data) {
            global $bp;
    //check for member type
    $member_type_field_id = xprofile_get_field_id_from_name('Member Type');
    $member_type = $_POST['field_'.$member_type_field_id];
    switch($member_type){
    case "babysitterornanny":
    $cost_per_hour_field_id = xprofile_get_field_id_from_name('Cost Per Hour');
    $cost_per_hour = $_POST['field_'.$cost_per_hour_field_id];
    
    if ($cost_per_hour ==''){
    
    bp_core_add_message( __( 'You need to fill out your Cost Per Hour.', 'buddypress' ), 'error' );
              wp_redirect( $bp->loggedin_user->domain . 'profile/edit/group/1/' );
    
           exit();
    }
    
    }
    
    return $data;
    }
    
    add_action( 'xprofile_data_before_save', 'validate_required_unshared_fields');

    I’ve changed to a default Twenty12 theme, still doesn’t display, what is causing it not to display??

    #262072
    danbp
    Participant

    Hi @darrenllrgmailcom, @adjunkten,

    i had the same issue with a custom theme: fields didn’t wrap properly on small screens…
    To solve it, i simply copied the concerned form rules from Twenty Sixteen into my child theme css and all went OK after that.

    The 2016 rules of the register page:

    #buddypress #signup_form.standard-form #profile-details-section,
    #buddypress #signup_form.standard-form #basic-details-section,
    #buddypress #signup_form.standard-form #blog-details-section {
    	float: none;
    	width: 100%;
    }
    
    @media screen and (min-width: 38.75em) {
    	#buddypress #signup_form.standard-form #profile-details-section,
    	#buddypress #signup_form.standard-form #basic-details-section,
    	#buddypress #signup_form.standard-form #blog-details-section {
    		width: 48%;
    	}
    }
    
    @media screen and (min-width: 38.75em) {
    	#buddypress #signup_form.standard-form #profile-details-section {
    		float: right;
    	}
    	#buddypress #signup_form.standard-form #basic-details-section {
    		float: left;
    	}
    }
    dzturtleshell
    Participant

    I’m creating a custom page that shows all members of a specific group.
    I need to make a box for each member that includes their avatar, name, and the data from one of the custom xProfile fields I’ve created for the community.

    I used the group_members loop and I have the avatar and name working.

    ‘<?php if ( bp_group_has_members(‘group_id=1’) ) : ?>
    <ul id=”member-list” class=”item-list”>
    <?php while ( bp_group_members() ) : bp_group_the_member(); ?>

  • <?php bp_group_member_avatar_mini($width = 50, $height = 50) ?>
    <?php bp_group_member_link() ?>
  • <?php endwhile; ?>

    <?php else: ?>
    <div id=”message” class=”info”>
    <p>Something went wrong!</p>
    </div>
    <?php endif;?>’

    I don’t know how to access the xProfile field I want so I can add it to the loop. I know the profile group_id=1 and the profile field_id=9, but I can’t find anywhere how the profile field_id is linked to a members user_id, so I can’t figure out how to add it to the group_members loop. I think it should look something like this:

    ‘<?php
    function bp_group_member_location() {
    echo bp_get_group_member_location();
    }

    function bp_get_group_member_location() {
    global $members_template;
    // Write code here to return the value of profile group_id=1&field_id=9 for member
    }
    ?>’

    But I don’t know if I should even be looking for the custom profile fields data in the $member_template (which I can’t actually find to see what it does contain)

    Any advice or suggestions would be greatly appreciated, even if it’s just to let me know I’m completely off… I am a beginner and this is my first post here. Please comment if you need more info to be able to answer my question. (I am using BP 2.7.2 and WP 4.6.something)

    Thanks in advance!

    #261863
    tergra
    Participant

    Found the source of the issue. I had put the field (First name (Base)) in another group of fields, because it only makes the registration process longer and doesn’t bring anything valuable to the site. But when yo do so, it breaks the registration process for some reason. It no longers makes the required verifications.. I’m now implementing the solution of changing is_required described here by ModemLooper : https://buddypress.trac.wordpress.org/ticket/5373?cversion=0&cnum_hist=3
    It seems to work, I only have a issue with the css (I put a big div with display none before xprofile fields and I’m closing it at the end, just before the submit button, but it puts the submit button on the right as if the xprofile field was there, weirdly/

    Buddypress should really have that in core as this required Xprofile field is really not user-friendly AT ALL. 😉

    Thanks everyone ! 🙂

    #261852
    mrizwanghuman
    Participant

    We are hosting our blog in a subdirectory (https://domain.com/blog/), not a subdomain (https://blog.domain.com). We are fetching content behind reverse proxy from server B.

    Users cannot upload their buddy-press profile avatar.

    Here is header

    Request URL:http://www.example.com/wp-admin/admin-ajax.php
    Request Method:POST
    Status Code:302 Moved Temporarily.
    I tried following code

    $.ajaxPrefilter(function(options){
    options.xhrFields={
    withCredentials: true
    };
    });
    Your help will be greatly helpful. I already setup header for other ajax call to

    headers[‘Access-Control-Allow-Origin’] = “*”

    mkricard
    Participant

    Can anymore provide some guidance on hiding BuddyPress user profile fields and custom tabs from non-logged in users?

    I’ve been trying to figure out how to prevent non-logged in users from viewing my BuddyPress pages, but I can’t seem to quite make everything work. So far, I’ve been able to figure out how to restrict access to the Members page and redirect non-logged in users to the login page. I put the following code in my bp-custom.php file, which is in my plugins folder. I got the code from this BuddyPress forum page (https://buddypress.org/support/topic/hiding-groups-activity-members-list-to-non-members/).

    <?php
    
    /**
     * Change BuddyPress default Members landing tab.
     */
    define('BP_DEFAULT_COMPONENT', 'profile' );
    
    /* Prevent logged out users from accessing bp activity page */
    function nonreg_visitor_redirect() {
    global $bp;
    if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bp_is_page( BP_MEMBERS_SLUG ) ) {
    if(!is_user_logged_in()) { //just a visitor and not logged in
    wp_redirect( get_option('siteurl') . '/wp-login.php' );
    }
    }
    }
    add_filter('get_header','nonreg_visitor_redirect',1);
    
    ?>
    

    However, non-logged in users can still view each user’s page and their profile tabs. How can I restrict access to those pages as well? I’d rather not use another plugin.

    #261790
    danbp
    Participant

    Is “xprofile component” the feature exposed in “Settings > BuddyPress” named “Extended Profiles” (at the very top of the config page)? (It probably is, but I just want to be sure, thanks.)

    Yes it is !

    it is possible […] to effect the change of either the email or password fields?

    Yes it is ! from here: your-site.abc/members/USERNAME/settings/ – the link can be found under the top right usermenu on wp’s toolbar: username > settings > general OR/AND on the buddymenu, when you’re on your profile: Settings ! And that’s it !

    null

    For all other BP related questions, please read through the codex, i really have no time to (re)write all explanations. Sorry, hope you uderstand.

    Jay
    Participant

    Thanks for the background info about WP, @danbp. It certainly is interesting to see how the little old single-user blog platform called “WordPress” has mushroomed into the gargantuan that it is today, following the old adage, “Man expands to fill the available space.”

    Obviously I’m a bit of a noobie to WordPress (I’ll admit, so feel free to flame away ;)), but I’d like to ask about your reference to the clause “When BP is activated, and if you use the xprofile component…” I am a bit confused about “the xprofile component” and was wondering if you can help me understand it a bit better.

    Is “xprofile component” the feature exposed in “Settings > BuddyPress” named “Extended Profiles” (at the very top of the config page)? (It probably is, but I just want to be sure, thanks.)

    I am fully cognizant of the fact that one can preclude access to the WP Dashboard in a number ways, including by Role, etc., and I plan to do that. However, that causes me to provide exposure to the standard WP Profile fields (or as many of thsoe fields that I want to expose, that is) so that the user can modify them. This includes the critical email and password fields.

    Relating to this situation, you didn’t quite address my key question as to whether it is possible (without serious WP core hacking — something I would NEVER do, btw) to effect the change of either the email or password fields?

    Now listen, I realize that probably sounds like a shameless noobie question, but it really begs the question of whether modifying the email/password fields outside of the WP dashboard is considered “bad form” in some way.

    Thanks in advance for your advice and insights.

    #261756
    danbp
    Participant

    Hi,

    BuddyPress use templates to show his stuff.
    The registration is part of WP and BP’s xprofile component add only some additionnal fields to the original register form.

    If you open a template file you will see a lot of code and many lines starting by do_action( ‘something’ );

    These files are all stored in bp-templates/bp-legacy/buddypress/

    Now you have already the where and the what. here’s the how.

    To show some text on the register page you have two options:
    1) altering the whole template file bp-templates/bp-legacy/buddypress/members/register.php
    2) add what you want by using an action hook

    The second method is the fasted and the easiest. You just need to write a function and you’re done.

    
    function valeriemanne() {
       echo 'Here i am !';
    }
    add_action( 'bp_before_register_page', 'valeriemanne' );

    Add this to your child theme functions.php file or into bp-custom.php

    WordPress codex references
    add_action
    Child theme

    #261686

    In reply to: show random profile

    mrblade
    Participant

    Hi! Thank you for your answer!
    But I need a page showing the profile (and not a list) of a random user.
    I was thinking of using the standard loop with type = random and limit of one. And use the filter fields, as described here
    is this the correct way?

    #261682
    sweeneytodd94
    Participant

    (Latest version of WP/BP; non-bundled custom theme, using child theme.)

    When adding a custom index & members-loop to /members/ in my child-theme, to make some adjustments to the members directory layout, individual profile pages break completely, I think defaulting to the pages.php but loaded without any content.

    childtheme/members/members-loop.php

    <?php 
    //global $members_template;
    //$reset_members_template = $members_template;
    
    do_action( 'bp_before_members_loop' ); ?>
    
    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) . '&per_page=21&type=alphabetical' ) ) : ?>
    
    	<div id="pag-top" class="pagination">
    		<div class="pag-count" id="member-dir-count-top"><?php bp_members_pagination_count(); ?></div>
    		<div class="pagination-links" id="member-dir-pag-top"><?php bp_members_pagination_links(); ?></div>
    	</div>
    
    	<?php do_action( 'bp_before_directory_members_list' ); ?>
    
    	<ul id="members-list" class="item-list" role="main">
    
    	<?php while ( bp_members() ) : bp_the_member(); ?>
    
    		<li>
    			<div class="item-avatar">
    				<a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar('type=full&width=80&height=80'); ?></a>
    			</div>
    			<div class="item">
    				<div class="item-title"><a href="<?php bp_member_permalink(); ?>"><?php bp_member_name(); ?></a></div>
    				<div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
    				<?php do_action( 'bp_directory_members_item' ); ?>
    			</div>
    			<div class="action">
    				<?php do_action( 'bp_directory_members_actions' ); ?>
    			</div>
    			<div class="clear"></div>
    		</li>
    
    	<?php endwhile; ?>
    
    	</ul>
    
    	<?php do_action( 'bp_after_directory_members_list' ); ?>
    
    	<?php bp_member_hidden_fields(); ?>
    
    	<div id="pag-bottom" class="pagination">
    		<div class="pag-count" id="member-dir-count-bottom"><?php bp_members_pagination_count(); ?></div>
    		<div class="pagination-links" id="member-dir-pag-bottom"><?php bp_members_pagination_links(); ?></div>
    	</div>
    
    <?php else: ?>
    	<div id="message" class="info"><p><?php _e( "Sorry, no members were found.", 'buddypress' ); ?></p></div>
    <?php endif; 
    
    //$members_template = $reset_members_template;
    ?>
    
    <?php do_action( 'bp_after_members_loop' ); ?>

    childtheme/members/index.php

    <?php
    
    /**
     * BuddyPress - Members Directory
     *
     * @package BuddyPress
     * @subpackage bp-default - SSSMG
     */
    
    get_header( 'buddypress' ); ?>
    
    	<?php do_action( 'bp_before_directory_members_page' ); ?>
    
    <div class="container">
    <div class="row">
    <div id="primary" class="col-md-10">
    
    	<div id="content" role="main" class="<?php do_action( 'content_class' ); ?>">
    		<div class="padder">
    		<div class="buddypress">
    
    		<?php do_action( 'bp_before_directory_members' ); ?>
    		
    	<form action="" method="post" id="members-directory-form" class="dir-form">
    	
    	<?php do_action( 'bp_before_directory_members_content' ); ?>
    
    	<div id="members-dir-search" class="dir-search" role="search">
    		<?php bp_directory_members_search_form(); ?>
    	</div><!-- #members-dir-search -->
    
    	<?php do_action( 'bp_before_directory_members_tabs' ); ?>
    
    		<div class="item-list-tabs" role="navigation">
    			<ul>
    				<li class="selected" id="members-all"><a href="<?php bp_members_directory_permalink(); ?>"><?php printf( __( 'All Members %s', 'buddypress' ), '<span>' . bp_core_get_total_member_count() . '</span>' ); ?></a></li>
    
    				<?php if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
    					<li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/'; ?>"><?php printf( __( 'My Friends %s', 'buddypress' ), '<span>' . bp_get_total_friend_count( bp_loggedin_user_id() ) . '</span>' ); ?></a></li>
    				<?php endif; ?>
    
    				<?php do_action( 'bp_members_directory_member_types' ); ?>
    
    			</ul>
    		</div><!-- .item-list-tabs -->
    
    		<div id="members-dir-list" class="members dir-list">
    			<?php //bp_get_template_part( 'members/members-loop' );
    				locate_template( array( 'members/members-loop.php' ), true );
    			?>
    		</div><!-- #members-dir-list -->
    
    		<?php do_action( 'bp_directory_members_content' ); ?>
    
    		<?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ); ?>
    
    		<?php do_action( 'bp_after_directory_members_content' ); ?>
    
    	</form><!-- #members-directory-form -->
    
    	<?php do_action( 'bp_after_directory_members' ); ?>
    
    </div><!-- #buddypress -->
    </div><!-- .padder -->
    	</div><!-- #content -->
    
    </div><!-- primary -->
    <?php get_sidebar( 'buddypress' ); ?>
    </div><!-- row -->
    </div><!-- container -->
    
    	<?php do_action( 'bp_after_directory_members_page' ); ?>
    
    <?php get_footer( 'buddypress' ); ?>

    bp-custom.php

    <?php
    // bp-custom.php - BP hacks and mods will go here
    /**
     * Include bbPress 'topic' custom post type in WordPress' search results */
     
    function ntwb_bbp_topic_cpt_search( $topic_search ) {
    	$topic_search['exclude_from_search'] = false;
    	return $topic_search;
    }
    add_filter( 'bbp_register_topic_post_type', 'ntwb_bbp_topic_cpt_search' );
    
    /**
     * Include bbPress 'forum' custom post type in WordPress' search results */
    
    function ntwb_bbp_forum_cpt_search( $forum_search ) {
    	$forum_search['exclude_from_search'] = false;
    	return $forum_search;
    }
    add_filter( 'bbp_register_forum_post_type', 'ntwb_bbp_forum_cpt_search' );
    
    /**
     * Include bbPress 'reply' custom post type in WordPress' search results  */
    
    function ntwb_bbp_reply_cpt_search( $reply_search ) {
    	$reply_search['exclude_from_search'] = false;
    	return $reply_search;
    }
    add_filter( 'bbp_register_reply_post_type', 'ntwb_bbp_reply_cpt_search' );
    
    /**
     * Ensure that multiselect boxes have trailing brackets in their 'id' and 'name' attributes.
     *
     * These brackets are required for an array of values to be sent in the POST
     * request. Previously, bp_get_the_profile_field_input_name() contained the
     * necessary logic, but since BP 2.0 that logic has been moved into
     * BP_XProfile_Field_Type_Multiselectbox. Since bp-default does not use the
     * BP_XProfile_Field_Type classes to build its markup, it did not inherit
     * the brackets from their new location. Thus this workaround.
     */
    function bp_dtheme_add_brackets_to_multiselectbox_attributes( $name ) {
    	global $field;
    
    	if ( 'multiselectbox' === $field->type ) {
    		$name .= '[]';
    	}
    
    	return $name;
    }
    add_filter( 'bp_get_the_profile_field_input_name', 'bp_dtheme_add_brackets_to_multiselectbox_attributes' );
    
    // add the custom column headers to BP manage signups
    function philopress_modify_user_columns($column_headers) {
            $column_headers['extended'] = 'Extended';
            return $column_headers;
    }
    add_action('manage_users_page_bp-signups_columns','philopress_modify_user_columns');
    
    // dump all the pending user's meta data in the custom column
    function philopress_signup_custom_column( $str, $column_name, $signup_object ) {
    	if ( $column_name == 'extended' ) 
                 return print_r( $signup_object->meta, true );
            return $str;
    }
    add_filter( 'bp_members_signup_custom_column', 'philopress_signup_custom_column', 1, 3 );
    
    //* Redirect WordPress Logout to Home Page
    add_action('wp_logout',create_function('','wp_redirect(home_url());exit();'));
    
    //add @mentions to bbpress forum
    function custom_bbpress_maybe_load_mentions_scripts( $retval = false ) {
    	if ( function_exists( 'bbpress' ) && is_bbpress() ) {
    		$retval = true;
    	}
    	return $retval;
    }
    add_filter( 'bp_activity_maybe_load_mentions_scripts', 'custom_bbpress_maybe_load_mentions_scripts' );
    
    function bphelp_dpioml(){
    	$bphelp_my_profile_field_1='Profession';
    	$bphelp_my_profile_field_2='Primary Institution';
           if( is_user_logged_in() && bp_is_members_component() ) { ?>
            <div class="bph_xprofile_fields">
                              <?php if(bphelp_my_profile_field_1<>"") echo bp_member_profile_data( 'field='.$bphelp_my_profile_field_1 );  ?><br />
    						  <?php if(bphelp_my_profile_field_2<>"") echo bp_member_profile_data( 'field='.$bphelp_my_profile_field_2 );  ?><br />
                    </div><?php
           }
    }
    add_action('bp_directory_members_item', 'bphelp_dpioml');
    
    ?>

    I’ve tried all sorts of different combinations but whatever I do, the only way to get both the profile pages and the members directory to display is to remove the index and members-loop customizations. Then everything works fine, but without the adjustments to the members directory that I want (removing recent updates, for instance). Any pointers would be brilliant!

    #261539
    #261513
    shanebp
    Moderator

    Did you see this?
    https://buddypress.org/support/topic/how-to-view-pending-signup-profile-fields/

    For a single field, follow the directions in the code.

    #261504
    fleminglabs
    Participant

    Is there any progress on this?

    My client needs people to input a product number to sign up for the website.

    There are lots of “pending” users but I cannot see the custom Profile fields to review what the new user has put in.

    There is no other way of looking at that?

    The clients needs to be able to do it and lots of them, the url trick will be too hard.

    #261497
    Lars Henriksen
    Participant

    One solution might be to simply display the xprofile fields, that you want to be searcable in the member directory.
    Then you can simply use the member search form to search for xprofile content.

    My members have a field with ‘school’ http://historielaerer.dk/medlemmer/

    This snippet adds two profile fields to the members loop – add the code to your bp-custom.php:

    <?php
    function add_info_to_members_loop() {
        $field_content = bp_get_member_profile_data( 'field=(Xprofile Field name)' );
        if( $field_content != false )
          echo "(label for xprofile field content): " . $field_content;
        $field_content = bp_get_member_profile_data( 'field=(Xprofile field name #2' );
        if( $field_content != false )
          echo "<br/>" . $field_content;
    }
    add_action( 'bp_directory_members_item', 'add_info_to_members_loop' );
    
    ?>

    Just an idea.

    Kind regards, Lars

    #261479

    In reply to: bbp-register layout

    Venutius
    Moderator

    The basic layout of the items on the right side of the registration screen can be affected by moving the fields around in Dashboard>>User>>Profile Fields.

    You can drag and drop them and that will affect the order that they are displayed.

    An alternative might be to install BP Better Registration, which creates a different type of registration process.

    You might benefit from visiting my website http://buddyuser.com It’s aimed at newbies looking to get the most out of BuddyPress.

    #261447
    shanebp
    Moderator
    #261403

    In reply to: Profile Page and Bio

    Venutius
    Moderator

    Hi there,

    You might like to check out my page on setting up users

    http://buddyuser.com/setting-up-site-members-with-buddypress

    This includes details of adding additional profile fields to the users profile. Also check out the section “Installing BP” in my site, I’m sure it will give you a lot of useful information.

    #261402
    mthant
    Participant

    Hello
    I have buddyPress 2.7.2 installed. I notice that in the profile section it does not have fields to fill other information except name and photo. When I press the edit tab it allows only to change name and there is a tab to change the photo.
    I notice that in demos on other wordpress themes that have buddyPress, it shows fields such as Age, Bio. Are these fields deleted?
    I am a newbie to WordPress and BuddyPress

    conmurray
    Participant

    Using BP2.7.1

    My BP installation for some reason has two Base Primary tabs under Profile Fields. The First tab shows two Name (Primary) (Required) Fields and both of these show on my signup forms. The second tab has nothing on it.

    I can’t see what is causing the issue but how do I get rid of them?

    Thanks in anticipation.

    #261285

    In reply to: User WYSIWYG Editor

    Venutius
    Moderator

    For profile fields you can enable a rich text editor with http://buddyuser.com/plugin-review-buddypress-xprofile-rich-text-field

    #261229
Viewing 25 results - 1,051 through 1,075 (of 5,755 total)
Skip to toolbar