Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 1 through 25 (of 3,862 total)
  • Author
    Search Results
  • Avatar of Hardeep Asrani
    Hardeep Asrani
    Participant

    I’m using following snippet to create xProfile fields in a custom plugin:

    `
    add_action(‘bp_init’, ‘field_xprofile_twitter’);

    function field_xprofile_twitter()
    {
    global $wpdb;
    xprofile_insert_field(
    array (
    field_group_id => 1,
    name => ‘WWWYKI’,
    can_delete => false, // Doesn’t work *
    field_order => 1,
    is_required => false,
    description => ‘Woo Woo Woo You Know it, bro!’,
    type => ‘textbox’
    )
    );
    }
    `

    But it’s creating a new field every time the script runs. Is there a way to prevent that from happening?

    #188334
    Avatar of ichigo_roukia
    ichigo_roukia
    Participant

    Hi All,
    I wonder if there is a way to make customized user filed in buddypress users’ profiles depending on a specific type of the user or its role. All I can find now is a one-type registraton fields for all users. However, for my website (which integrates buddypress) i have different profiles, so i need to find a way to show customized registration fields depeding on the profile user ?! thank you.

    Avatar of ww2boy
    ww2boy
    Participant

    Hi,

    Again thanks for your quick reply.
    Yes, I used the snippet ‘as is’, and then tried to use the field name instead of the ID.
    Field name obviously didn’t work, although you could use it too, according to this page:

    http://codex.buddypress.org/getting-started/guides/displaying-extended-profile-fields-on-member-profiles/

    But I found the profile field ID, and now it works!

    Thank you so much :D.

    (Yes, KLEO has premium support. But they are very, very slow. I opened a few tickets 1-2 weeks ago, still no replies. Found the answer in the meantime though :P ).

    Avatar of danbp
    danbp
    Moderator

    I use the KLEO theme (BuddyPress is integrated), could it be because of that?
    Normally, no.

    But as you use a premium theme, don’t except much help here. You also payed for support. If the snippet doesn’t work for you ( i tested it successfully with Twentythirteen before publishing), you have to get in contact with the theme author or read his doc about customization (if exist).

    To get the field ID, see it from where the field is created, in xprofile admin. If you hover the delete button, you can see it at the bottom left corner of your browser.

    You can also go into the DB and check for it in the bp_xprofile_fields table.

    NOTE:
    When you get a snippet, the first thing to do is to use it “as is” to test it – this means also “understanding how it works”, not to apply what you think is better. :roll:

    And only when the test is ok, you can modify it or try to do so. ;-)

    Avatar of ww2boy
    ww2boy
    Participant

    Hey,

    Thank you for your quick reply! :)

    I added the code to my theme’s functions.php, and replaced ’54′ with the name of the field (I can’t find the ID number anywhere), but that specific field still shows up in profiles/edit fields.

    I use the KLEO theme (BuddyPress is integrated), could it be because of that?
    Or is there a different way to find the field’s ID number? :)

    I really appreciate your help, I didn’t expect such a fast and detailed reply! :D

    Avatar of danbp
    danbp
    Moderator

    Hi @ww2boy,

    Yes ! ;-) Give this a try. Add it to child theme’s functions.php or bp-custom.php

    function bpfr_hide_profile_edit( $retval ) {	
    	// remove field from edit tab
    	if(  bp_is_profile_edit() ) {		
    		$retval['exclude_fields'] = '54'; // ID's separated by comma
    	}	
    	// allow field on registration page     
    	if ( bp_is_register_page() ) {
    		$retval['include_fields'] = '54'; // ID's separated by comma
    		}		
    	
    	// hide the filed on profile view tab
    	if ( $data = bp_get_profile_field_data( 'field=54' ) ) : 
    		$retval['exclude_fields'] = '54'; // ID's separated by comma	
    	endif;	
    	
    	return $retval;	
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_edit' );

    Codex reference:

    http://codex.buddypress.org/plugindev/using-bp_parse_args-to-filter-buddypress-template-loops/

    Avatar of ww2boy
    ww2boy
    Participant

    Hello,

    I’ve added an extra required field to the registration form.
    But I need to customize it a little bit further:

    - Users should not be able to change the value of this profile field after registration
    (disable editing of this field)

    +

    - This field should be hidden from users after registration.

    So the only time users can submit a ‘value’ to this specific field, and view this field, is when they sign up. After successful registration, they can not view what they submitted anymore, and they can’t change it either.

    Is this possible?

    Avatar of noise
    noise
    Participant

    Hi

    Got an interesting challenge here. I’m creating a site for a race-club. What we’d like to have is a listing of the members standings in the various races over the year (12 each year).

    Ideally, the admin would enter in the results for each user for each race.

    Each member would see just his results on his profile page, but the total membership could see everyones stats in a grid on the front page (which would be sorted).

    I was thinking about futzing about with the Advanced Custom Fields plugin, but thought someone might have cracked this egg already.

    Thanks!

    #188267
    Avatar of mmadden
    mmadden
    Participant

    Yes, I’ve already edited the input fields within the basic-details-section div. I want to edit the input field in the profile-details-section div to match, but there is no input field in the register.php for that section. Instead there’s this:

    <div class="register-section" id="profile-details-section">
    
    					<h4><?php _e( 'Profile Details', 'buddypress' ); ?></h4>
    
    					<?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
    					<?php if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( array( 'profile_group_id' => 1, 'fetch_field_data' => false ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>

    Is there any way to get at the input tag that gets output to the profile-details-section?

    #188236
    Avatar of danbp
    danbp
    Moderator
    #187770
    Avatar of danbp
    danbp
    Moderator

    Hi @mmadden,

    not sure i understand what you want to achieve. Are you creating a register page from scratch ?
    Anyway….
    Open the original BP register file (/buddypress/bp-templates/bp-legacy/buddypress/members/register.php). It contains many placeholders and conditionnals

    So, for the mandatory NAME xprofile group (the only one you use), you have line 65

    if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( array( 'profile_group_id' => 1, 'fetch_field_data' => false ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group();
    
    --- blah---

    Line 75 sit this placeholder do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); where you can hook your additionnal information.

    Line 98 there’s another one: do_action( 'bp_custom_profile_edit_fields' ); just above this function:

    <p class="description"><?php bp_the_profile_field_description(); ?></p>

    In register.php, the section you speak about goes from line 50 to 112
    From /***** Extra Profile Details ******/ to </div><!-- #profile-details-section -->

    Of course, you can also add your own placeholder to your register template.

    Sorry if i’m wrong.

    Avatar of mmadden
    mmadden
    Participant

    I’m using WordPress 3.9.2 with BuddyPress 2.0.2. I’m building a new theme and on the registration page I’d like to use the placeholder attribute instead of a label to guide users through the setup. It was easy enough to move the php into a new placeholder attribute for the input fields in the basic-details-section, but since the profile-details-section is different, there is no input field to add a placeholder attribute. How might I accomplish the same thing in the profile field (I only have the default one) that I did with the others?

    #187708
    Avatar of aces
    aces
    Participant

    @elshobokshy

    Using firefox on http://animalsfunnypictures.com/members/sanaa/ I can see entry-content img { which has a width: 510px if i disable it in firefox it becomes the ‘normal’ size.

    This is coming from Marla theme’s style.css on line 1464 – see for yourself

    Avatar of Saurabh Jain
    Saurabh Jain
    Participant

    Thanks @1a-spielwiese,

    Is there any way to search users using xprofile fields.
    E.g. In my xprofile field i have named “Skills” i want to search all user having the Skill = I.T.
    I made Skills as checkbox.

    Avatar of Saurabh Jain
    Saurabh Jain
    Participant

    Thanks @1a-spielwiese and @danbp,
    I created new fields and didn’t updated profile that was the reason of not showing.

    Is there any way i can access the data in the fields. I created field named Skill i want to access the data in that field and use in other pages/post.

    #187184
    Avatar of poundsixzeros
    poundsixzeros
    Participant

    Hi,
    Is there a way users that have hidden fields can be excluded from member search results?
    It seems that if a user hides a field, their profile still shows in the search results when someone searches for whatever was hidden.

    For example, if a user #1 sets the visibility of an xprofile field “State” to “only me”. Then user #2 searches for the state that User #1 hid, then User #1′s profile should not show up on the search results. But it does. This kind of defeats the purpose of hiding a field so I’m hoping there is a way to exclude those results from searches. Any advice or insight is much appreciated!

    I am using WP 3.9.2 and BP 2.0.2.
    Thanks in advance!

    Avatar of mrapino
    mrapino
    Participant

    Okay, this is my first piece: http://pastebin.com/pyz8XaaP

    This first link is some code findings that might continue the conversation toward an elegant solution.

    And then I came up with another possible solution here, which is actually partially working, but might be a bit clunky: http://pastebin.com/3JBCuZrx

    Basically, the first link is not working, but may give us more food for thought. The second link is working, but there are a few caveats. What I am doing in the second link is finding out what user role the logged in user is attached to. Then I create a conditional that states that if the user is under a certain role, it hides the profile group tabs from being seen, which essentially prevent them from adding content to them, and if there is no content for any of the fields in the group, it won’t show on the front end.

    CAVEAT: if you go directly to the profile group URL, you can still edit. I need to figure out how to actually prevent the URL from working, as opposed to/ or in addition to hiding it.

    Either way, I think there’s a bunch of good stuff to talk about here.

    Let me know what you think.

    NOTE: I am using some code found on this post:

    http://buddypress.org/support/topic/conditional-exclusion-of-a-xprofile-fields-group-from-editing/

    Avatar of mrapino
    mrapino
    Participant

    Thanks for the links.

    Defining a role doesn’t necessarily require previous input from the people using your site … you simply define the roles of your users based on what you want those users to be. Custom user roles allow you to have more granular control over what your users can do and see when registered on your site. Regarding Buddypress … I think that having a way to pre-define user types/roles and assigning custom profiles to those various user types is something to be desired.

    I am using Gravity Forms to create a custom registration form that allows a registrant to pick the type of user they are and when the user type is chosen, I am conditionally displaying custom fields that are associated to the specific user type.

    The problem is that after the user registers, and the fields are filled out, if they go to their profile to edit the information, they see ALL FIELDS regardless of the user role they chose during registration. The reason is that although Gravity Forms allows you to map certain fields on the form to profile fields in Buddypress, you still have to edit Buddypress to HIDE the fields you don’t want those users to see.

    That is why I am posting this question … I am trying to get code together to alter the profile section of Buddypress to allow you to associate specific profile fields to a user role, so when the user of a specific role finally goes to their profile to make edits, they do see, and are not allowed to edit fields that are not associated to their specific role.

    IMHO this type of control is very useful, as it can help you create some fairly interesting communities.

    Thanks for your assistance. I hope I have clarified things further for you. If anyone can help, great … if not, I am still moving forward on this and when I come up with a solution, I will post it here. If anyone can help me get to that solution faster, I’d be very appreciative. If not, I hope I can help those of you who are looking for the same results.

    Avatar of mrapino
    mrapino
    Participant

    I appreciate your response! I will take a look at this plugin. I am always hesitant to use plugins that are so out of date, but perhaps there is some code within the plugin files that will be useful.

    Also, is there any resource that details the functions available within Buddypress. I have looked at the Codex, but I can’t seem to find a nice definitive resource. The WP Codex has all of the actions, filters, functions, etc… I was trying to find something similar within the Buddypress website, but can’t seem to find documentation that has everything detailed out. Is there a lot of documentation that hasn’t been written yet, or am I just looking in the wrong place?

    Please keep me posted if you have any other suggestions about what functions, or code snippets I might use to gather the correct information to alter the profile section based on user roles.

    Basically, I need to know where you might place the custom code (is it within the bp_custom file?) And if I use bp_custom, I am guessing I would have to hook my code into the correct location, so Buddypress knows to enact my code correctly (Is there an action hook that hooks into the Profile section specifically?) I also would need to know where to find the functions I need to edit the profile section (all xprofile functions, any functions that might help me attach user roles to profile fields, any functions that pull data relevant to the connection between profiles and users, etc…)

    Regarding the connection between user/user role and profile, would I be calling these functions separately … meaning, would I first use a conditional to see what user role the user is, and then within that conditional be using general xprofile functions to display only the fields I want to display for the user role that the conditional is specifying?

    I think if we all start to spitball ideas, this post can be a sounding board for the code that can build this functionality out. In my research over the past week, I have found so many incomplete conversations about how to make this functionality a reality. So, I know there are many people looking to do exactly what I am attempting. And the beauty is that we all have bits and pieces of this idea and how it might fit together. Perhaps we can all start posting our code snippets here to build this out together?

    If we can make it work, I bet this post can be the beginning of a core Buddypress code update that can integrate this into the actual Buddypress Core.

    What do you all think?

    I’ll be continuing my research and posting my findings here. Let’s make this happen!

    Avatar of 1a-spielwiese
    1a-spielwiese
    Participant

    Do you have inserted text (information) into the fields and profiles at issue?

    If you have old profiles and create later new fields, this fields are of course empty. So you have to update the profile information at first.

    Avatar of Saurabh Jain
    Saurabh Jain
    Participant

    Hello all,
    How should i show xprofile fields from newly created xprofile groups into user profile.
    I added new fields in Base group and the fields shown in signup but i can’t find any way to show fields which i created in new group.
    Wordpress version : 3.9.2
    BuddyPress version : 2.0.2

    Thanks in advance

    #187103
    Avatar of danbp
    danbp
    Moderator

    @greataussiepie

    did you noticed that profile field datas are clickable ?
    This default behaviour is intended to be use as a filter.

    Member A filled the Contractor field
    If any visitor goes to member’s A profile and click on the Contractor field value, BP will show a list of all other members who also filled in this field.

    So what you want to get already exist !

    http://codex.buddypress.org/developer/function-examples/bp_get_the_profile_field_value/

    http://codex.buddypress.org/getting-started/guides/displaying-extended-profile-fields-on-member-profiles/

    Avatar of greataussiepie
    Julian Fox
    Participant

    Hi,

    I am new to BuddyPress and i have been looking for a tutorial that will show me how to add a custom profile field to the order by drop down menu on the members page.

    What i have is a organisation with different members, i have created custom profile fields for each user to select which type of member they are. they can select Contractor or Training organisation. I want users to be able to filter the members page by Contractor or Training organisation so they can easily see all the contractors.

    So far the only thing iv been able to do is add a member loop in my child theme to make my custom profile fields show up on the members page, after reading add custom filters to loops, im totally lost as to how to achieve this because i can only just kind of understand what this tutorial is trying to do, but i dont think it helps me.

    If anyone could link me to a tutorial on how to just give users the ability to filter members by member profile field using a drop down menu or something that would be awesome thanks :)

    (I actually have 4 member types, but used 2 here for simplicity sake.)

    #187041
    Avatar of danbp
    danbp
    Moderator

    Would it matter that I have my group_order (i.e., the order in which my field groups are displayed) arranged in a specific order?

    No !
    Anyway, i was wrong myself. Apologize. My snippet hides groups from viewing, not from editing. But you can get another trick on this post. And this one works realy. ;-)

    #187039
    Avatar of 1a-spielwiese
    1a-spielwiese
    Participant

    “remove all xprofile fields to get only the default name field.”

    When I posted the comment:

    http://buddypress.org/support/topic/no-button-for-finishing-registration/#post-187032

    non xprofile field was created.

    “Also download a fresh copy of wordpress and upload the twenty twelve theme folder to your site. Maybe your’s is corrupted somewhere.”

    That’s really unlikely, because both copies worked without problems, before I installed the BuddyPress-Plugin. And I tried never to make any major change of twenty twelve theme or WordPress itself.

Viewing 25 results - 1 through 25 (of 3,862 total)