Search Results for 'profile fields'
-
AuthorSearch Results
-
August 19, 2014 at 4:31 am #187185
Saurabh Jain
ParticipantThanks @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.
August 18, 2014 at 9:35 pm #187166mrapino
ParticipantOkay, 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:
https://buddypress.org/support/topic/conditional-exclusion-of-a-xprofile-fields-group-from-editing/August 18, 2014 at 4:58 pm #187141mrapino
ParticipantThanks 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.
August 18, 2014 at 4:14 pm #187138mrapino
ParticipantI 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!
August 18, 2014 at 10:40 am #1871181a-spielwiese
ParticipantDo 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.
August 18, 2014 at 2:29 am #187103In reply to: Add profile field to 'Order By' drop down menu
danbp
Participantdid 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 !
August 16, 2014 at 11:46 pm #187041danbp
ParticipantWould 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. 😉August 16, 2014 at 10:29 pm #187039In reply to: [Resolved] No button for finishing registration
1a-spielwiese
Participant“remove all xprofile fields to get only the default name field.”
When I posted the comment:
https://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.
August 16, 2014 at 9:58 pm #187037In reply to: [Resolved] No button for finishing registration
danbp
ParticipantDo you use a wordpress copy provided by your host ?
Do you use a child-theme ?
Do you use any shortcode on the register page ?Disallow blog creation for the moment and remove all xprofile fields to get only the default name field.
Also download a fresh copy of wordpress and upload the twenty twelve theme folder to your site. Maybe your’s is corrupted somewhere.August 16, 2014 at 3:43 pm #187012In reply to: Modifying The Member List
danbp
ParticipantYes, by creating a custom function.
Add custom filters to loops and enjoy them within your plugin
https://codex.buddypress.org/plugindev/using-bp_parse_args-to-filter-buddypress-template-loops/How to
https://wordpress.org/support/topic/display-profile-fields-in-the-members-directory-all-members
(2nd topic gives a technique you can use)August 16, 2014 at 10:08 am #186999In reply to: [Resolved] No button for finishing registration
1a-spielwiese
ParticipantAmendment:
I guess, connected with the above described problem is another problem.
In the meantime I have activated “Extended Profiles” and I created three profile field groups.
But only the fields of the first group are displayed – the fields of the field groups 2 und 3 not.
August 13, 2014 at 9:30 am #186516danbp
ParticipantHi @simpleone,
you can actually only hide xprofile fields. Hiding field groups is not possible, due to a bug.
But it is corrected for 2.1 and you’ll find a patch on the trac.You can already apply the patch to 2.0.2 bp-xprofile-classes.php and the above snippet will work. Add it to bp-custom.php or theme’s functions.php
To hide an xprofile group, use bp_parse_args like this:
function bpfr_make_profile_tab_members_only( $retval ) { // hide to non members if( !is_user_logged_in() ) { // exlude groups, separated by comma $retval['exclude_groups'] = '4,5'; // exclude fields, separated by comma $retval['exclude_fields'] = '1,39'; } return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'bpfr_make_profile_tab_members_only' );August 13, 2014 at 12:19 am #186506shanebp
ModeratorTry this:
<?php /*** * If you want to show specific profile fields here you can, * but it'll add an extra query for each member in the loop * (only one regardless of the number of fields you show): * bp_member_profile_data( 'field=the field name' ); */ $data = bp_get_member_profile_data( 'field=Current Location' ); if( $data != false ) echo $data; ?>August 12, 2014 at 11:29 pm #186492shanebp
ModeratorAre you putting this code in the members-loop.php template?
Are you putting it in the designated area?
Look for this text: ‘If you want to show specific profile fields here you can,…’August 12, 2014 at 10:34 pm #186489alscott99
ParticipantThanks for your response, @shanebp.
That code still has the fields repeating, but perhaps I entered it wrong? Since you didn’t include the php tags I’m not sure where they go; I did it this way:
<?php $data = bp_member_profile_data( 'field=Current Location' ); ?> <?php if( $data != false ) ?> <?php echo $data; ?>August 12, 2014 at 8:03 pm #186484Joe
Participantwell i pasted the following code into the member-header.php file in buddypress where it says to add code and still no luck.
<div id="member_profile"> <div class="profile_fields">Position <span><?php bp_member_profile_data( 'field=Position' );?></span></div> </div> <?php /*** * If you'd like to show specific profile fields here use: * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field */ do_action( 'bp_profile_header_meta' ); ?> Any ideas?August 11, 2014 at 6:05 pm #186437Joe
Participant@butlerweb that’s a good call on the plugin Code Snippets — sounds like a really useful plugin.
Okay, so using the code from the link you gave me (which should be added to the buddypress member header file):
<div id=”member_profile”>
<div class=”profile_fields”>Category: <span><?php bp_profile_field_data( ‘field=Category’ );?></span></div>If the Category Field was an array (a multicheck boxes), would this code be different, do you know? Maybe this is the issue I’m running into to.
Thanks. –Joe
August 11, 2014 at 5:56 pm #186436ButlerWeb
ParticipantWhere are you putting your code? Directly in the template file or elsewhere?
And mine were Multiselect boxes, rather than checkboxes, but it should give you the same array output. For those, I had to parse the strings into something a bit more readable.
Again, I use xprofile fields, but this is what my code looks like:
<h4><strong>Arts Subcategories:</strong> <?php echo (implode( ', ', (array) xprofile_get_field_data ('Arts Subcategories'))); ?></h4>I did not want to edit template files so I used a plugin called ‘Code Snippets’ which allows me to write code without editing the theme’s functions.php file or, like I said, the BP template files. However, to add them to the pages I had to use the “add_action()” hook.
August 11, 2014 at 5:29 pm #186434ButlerWeb
ParticipantHaha I have about 47 different plugins installed into my site and it runs fairly smoothly. The only thing is my geolocation plugin causes my page to refresh the first time you view it.
Aside from that, I found this article: http://bp-tricks.com/snippets/displaying-certain-profile-fields-on-your-members-profile-page/
In step 2 it shows PHP code to grab profile field data. You’ll have to either edit the template you want or create your own tab if you want it on a new page besides one of the pages you already have up on your site.
As far as adding social icons, I used this tutorial: https://buddypress.org/support/topic/display-users-social-follow-buttons-in-profile/
But that one requires xprofile fields.Hope that helps some! 🙂
August 11, 2014 at 5:11 pm #186431ButlerWeb
ParticipantPossibly! what ‘current profile extension fields’ do you have or are you working with.
I only recommend xProfile Fields because I know how to use the hooks! Haha 🙂
August 11, 2014 at 5:08 pm #186430Joe
ParticipantHi @butlerweb thanks for the response!
I’m not using xprofile fields because I didn’t want to add a birthdate field and whatnot, just wanted to display my current profile extension fields. Is that not possible without the install of xProfile Fields?
Thanks.
August 11, 2014 at 5:05 pm #186429In reply to: Create a special profile section?
ButlerWeb
ParticipantDoes the area you want your users to write need to be like many different blog posts? Or just like a single biography section?
I can help you with code for a biography section. For that you need Xprofile Fields installed.For blog posts, the answer I’ve gotten for that is to activate a Multisite network and then get the plugin for front-end blog posting (look for one that is compatible with BuddyPress).
August 11, 2014 at 4:49 pm #186426ButlerWeb
ParticipantI did something similar to you, I made a whole new profile page though, for my users.
First off, do you have xProfile Fields installed and active? You’ll need that.Take a look at the page I’m working on currently: http://ishocase.net/members/chiherah/
August 11, 2014 at 4:42 pm #186424In reply to: Current way to Edit Profile Page Template
bluemuse
ParticipantI think this is what i’m looking for:
August 10, 2014 at 8:53 pm #186399Hudson Atwell
ParticipantSo far this is as close as I have gotten:
public static function get_extended_fields( $user_id ) { $fields = array(); /* Get User Extended Data */ $r = bp_parse_args( $args['args'], array( 'profile_group_id' => 0, 'user_id' => $user_id ), 'bp_xprofile_user_admin_profile_loop_args' ); $i = 0; if ( bp_has_profile( $r ) ) { while ( bp_profile_groups() ) { bp_the_profile_group(); while ( bp_profile_fields() ) { bp_the_profile_field(); $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() ); $fields[ $i ]['name'] = bp_get_the_profile_field_name(); $fields[ $i ]['id'] = bp_get_the_profile_field_input_name(); $fields[ $i ]['value'] = bp_get_the_profile_field_edit_value(); $i++; } } } return $fields; } -
AuthorSearch Results