Search Results for 'profile fields'
-
Search Results
-
This may not be the most elegant solution but perhaps it will be useful to others. I use WP=2.9.2 & BP 1.2.1 and a simplistic child theme based on the BuddyPress Default 1.2.1 theme.
I want to have certain xProfile fields that are visible to others but could only be administered by the site administrator (e.g. is their membership payment up-to-date). I decided the easiest strategy would be to prevent a user from having access to the “SAVE CHANGES” button on the admin page of a specific xProfile group named “Admin-only”.
1) i copied a file from the default theme: BLOG_BASE/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile
2) I placed the file into my child theme: BLOG_BASE/wp-content/themes/MY_CHILD_THEME/members/single/profile/edit.php
3) Within the file, I replaced these lines (from around line #104):
<?php do_action( ‘bp_after_profile_field_content’ ) ?>
<div class=”submit”>
<input type=”submit” name=”profile-group-edit-submit” id=”profile-group-edit-submit” value=”<?php _e( ‘Save Changes’, ‘buddypress’ ) ?> ” />
</div>
with the following lines:
<?php do_action( ‘bp_after_profile_field_content’ ) ?>
<!–
****** RESTRICT ADMINISTRATION OF ADMIN-ONLY XPROFILE GROUP TO ADMINISTRATORS
****** BY REMOVING THE “SAVE CHANGES” BUTTON UNLESS USER IS A SITE ADMINISTRATOR
–>
<?php if ( bp_get_the_profile_group_name() == “Admin-only” && !is_site_admin() ) : ?>
<h4>
<?php printf( __( “Only Administrators can save changes in this Profile Group”, “buddypress” ) ); ?></h4><?php else: ?>
<div class=”submit”>
<input type=”submit” name=”profile-group-edit-submit” id=”profile-group-edit-submit” value=”<?php _e(
‘Save Changes’, ‘buddypress’ ) ?> ” />
</div>
<?php endif; ?>
<!– ****** END OF ADMIN-ONLY RESTRICTION –>
4) From the Dashboard: BuddyPress –> Profile Field Setup create a new Field Group called “Admin-only”
Now, any field added into this group will have the restriction that its value can only be changed by a site-administrator.
As I said, not elegant, but i hope it helps.
Hi,
I’m building a BP/WP single install site for a local organization and the extra profile fields are divided in 4 sections:
Group 1- Full Name (base group)
Group 2- General Info (location, age, gender, occupation)
Group 3 – Personal Info (bio, interests, etc.)
Group 4 – Contact (messengers ID’s, Twitter, etc.)
What I’m trying to accomplish is to hide groups 3 and 4 on the registration page not to overwhelm the user with a bunch of fields to fill out during sign-up, those fields can be filled out once the user has activated her/his account via “edit profile”.
Thanks,
Gene
I’d like to pre-populate some BuddyPress profile fields with certain information.
Where would I go to add the information/code that I want to appear in a specific profile field?
I’d like to add some information from the various profile fields to the Members directory. I can pull the info from the profile fields, but the challenge is figuring out how to format it so that it shows up in multiple columns (instead of one giant column) next to the basic member entries.
Any thoughts on how I can do this? I know enough CSS to use the float properties, but the multiple columns is giving me a bit of trouble.
Thanks.
Hello,
I’m using BP 1.2.3 on a WordPress 2.9.2 install with the WP-FB-AutoConnect plugin.
On registration, WP-FB-AutoConnect automatically set the user first_name and last_name and I like that. However, once registred users can not change these first_name and last_name when editing their BP profile.
Is it possible to let members change the WP user data in adition the the BP profile fields ?
Hello. I added the code below in wp-content/plugins/buddypress/bp-themes/bp-default/members/members-loop.php, to display additional profile fields in the member directory and to display the member’s role (either ‘Subscriber’ or ‘Provider’). I only have 2 types of roles – Subscribers cannot edit posts and Providers can edit posts. In the code below, I specifically checked for the user’s role to determine whether I need to display ‘Subscriber’ or ‘Provider’.
Questions:
– is there a way to check for the capability instead – i.e., if the user can ‘edit posts’ then I will display ‘Subscriber’, otherwise I will display ‘Provider’? If so, can you please let me know how to do that as I have not been able to figure it out.
– is there a way to display a newline so that ‘Subscriber’ or ‘Provider’ will display on the next line, below the member’s title and company name. I tried to echo “\n” but it’s not outputting a newline and I have no idea why.
Thank you for the help.
<?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 regadless of the number of fields you show):
*
* bp_member_profile_data( ‘field=the field name’ );
*/
if( bp_get_member_profile_data ( ‘field=Title’ ) )
echo bp_member_profile_data( ‘field=Title’ ), ‘ (‘, bp_member_profile_data( ‘field=Company’ ), ‘)’, ‘ – ‘;
$user = new WP_User( bp_get_member_user_id() );
if ( $user->roles[0] == ‘subscriber’ )
echo ‘Subscriber’;
else
echo ‘Provider’;
?>