Search Results for 'profile fields'
-
AuthorSearch Results
-
April 13, 2010 at 11:18 am #73280
jivany
ParticipantNope, I don’t think so. I was thinking you could remove the ‘profile_group_id=1’ arg from bp_has_profile but that doesn’t seem to allow the registration page to show more groups. I guess it appears that the only “required” fields for registration are the required ones in the Base group.
Might be worth opening a ticket on this one to see if that is the expect behaviour. Alternatively, ping R-a-y or DJPaul and see if they know.
April 13, 2010 at 2:24 am #73233Gene53
ParticipantNope, only getting group 1. I wonder if:
<?php if ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>can be modified to fetch group 2 also.
LOL, this is driving me nuts…
April 13, 2010 at 2:09 am #73229jivany
ParticipantNo worries. The code I gave should display everything except group 3 & 4. Sorry, I think I said it backwards in the previous post.
That said, even without the code, I’m only getting group 1 showing up on the registration page so I’m not really sure what’s going on in register.php now.
April 13, 2010 at 2:04 am #73228Gene53
ParticipantDarn, you’re right, I restored an original version of register.php and only group 1 shows. I’ll go and try your code to see if I can get group 2 to load.
Sorry about that…
April 13, 2010 at 1:33 am #73218jivany
ParticipantWell, you should be able to create pretty much everything you need in your theme’s functions.php file.
First you need to decide at what point you want to populate the fields. Find a hook in the code to attach to by looking for do_action(‘some_action_hook_name’) calls. In your functions.php file, make a new function and call something like:
add_action('some_action_hook_name','my_nifty_auto_pop_function');Then create your nifty_auto_pop_function that fills in the xprofile fields you want to populate.
Look in the bp-xprofile directory for all of the different files/functions to help fill in and read profile fields.
April 13, 2010 at 1:24 am #73217jivany
ParticipantOK, now I’m scratching my head.
When I create a second group, even if I tag the fields in the second group as “required”, they don’t show up on the register page (the bp-default version). The second group only shows up on the user’s profile page where they can edit the fields. They are tagged as “required” but nothing seems to force the user to fill them out.
I’m confused now as to what you’re seeing and/or trying to do.
April 13, 2010 at 1:14 am #73216jfcarter
ParticipantAfter registration. These are not required fields.
April 13, 2010 at 12:39 am #73210Gene53
ParticipantOops,sorry, I think there was a misunderstanding, bp-register loads all groups by default, what I’m trying to accomplish is to hide (or not load) groups 3 and 4 so the user can fill those optional field groups once they’ve activated their accounts..
April 12, 2010 at 10:54 pm #73202jivany
ParticipantOK. I’m thinking you can do something like this. Find this part of the file in register.php:
<?php /***** Extra Profile Details ******/ ?>
<?php if ( bp_is_active( 'xprofile' ) ) : ?>
<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 ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>At this point, add in a line like:
if( (bp_the_profile_group != "3") || (bp_the_profile_group != "4") ) :Then go down to this part of the file:
<?php endwhile; ?>
<input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids() ?>" />
<?php endwhile; endif; endif; ?>
</div><!-- #profile-details-section -->Before the first endwhile line, insert this:
<?php endif; ?>I *think* that should spit out groups 3 & 4 (assuming you have groups 3 & 4 defined in your profile groups). You might need to add in group “1” also to get the Base. The only part I’m not sure about right now is if the number need to be in double quotes or just bare. So it might be:
if( (bp_the_profile_group != 3) || (bp_the_profile_group != 4) ) :I think.
April 12, 2010 at 9:59 pm #73193Gene53
Participant@jivany, I’ve been playing around with this all afternoon but to no avail (learning PHP as I go along), either group no. 2 shows up but group 1 (name) doesn’t, or group 1 and only 1 field out of 6 from group 2 or neither groups 1 and 2.
I give up, LOL
Thanks,
Gene
April 12, 2010 at 5:30 pm #73024newbie999
ParticipantHello again. I posted this question on a new topic, no responses. I’ll try asking the question here since I have received responses on this thread. Thank you. Here goes:
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’). 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’;
?>
April 12, 2010 at 5:30 pm #73124newbie999
ParticipantHello again. I posted this question on a new topic, no responses. I’ll try asking the question here since I have received responses on this thread. Thank you. Here goes:
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’). 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’;
?>
April 12, 2010 at 10:51 am #72833In reply to: Anyone else working on integrating Gigya?
rsqst
ParticipantI agree with @dennis_h,
Gigya has some great (stable) plugins it would be nice to see this adjusted for BP. It sort of works. It will get them logged in, but its setup for WP so everything goes to the WP profile pages and not BP. I would say moding this would be ,much easier than try to make a stable version from scratch.
If this plugin would let you map FB profile info into xprofile fields, it would be exceedingly useful.
April 12, 2010 at 10:51 am #72933In reply to: Anyone else working on integrating Gigya?
rsqst
ParticipantI agree with @dennis_h,
Gigya has some great (stable) plugins it would be nice to see this adjusted for BP. It sort of works. It will get them logged in, but its setup for WP so everything goes to the WP profile pages and not BP. I would say moding this would be ,much easier than try to make a stable version from scratch.
If this plugin would let you map FB profile info into xprofile fields, it would be exceedingly useful.
April 12, 2010 at 6:01 am #72818stwc
ParticipantIf it’s on registration, work with a child theme as described in this thread: https://buddypress.org/forums/topic/adding-some-text-to-the-signup-form
Then just prepopulate the fields (assuming it’s static info for all registrants) using standard forms HTML stuff.
If it’s dynamic info, well, same first step, but after that, I’m out of my depth!
April 12, 2010 at 6:01 am #72918stwc
ParticipantIf it’s on registration, work with a child theme as described in this thread: https://buddypress.org/forums/topic/adding-some-text-to-the-signup-form
Then just prepopulate the fields (assuming it’s static info for all registrants) using standard forms HTML stuff.
If it’s dynamic info, well, same first step, but after that, I’m out of my depth!
April 12, 2010 at 3:00 am #72806Gene53
ParticipantThanks, I’ll give it a whirl tomorrow.
April 12, 2010 at 3:00 am #72906Gene53
ParticipantThanks, I’ll give it a whirl tomorrow.
April 12, 2010 at 2:54 am #72803jivany
ParticipantYou would probably have to do something like:
if( bp_the_profile_group != "3" || bp_the_profile_group != "4" ) {
//display the profile stuff in register.php
}You should be able to just toss that check near the top of that while loop and then remember your closing brace at the bottom.
April 12, 2010 at 2:54 am #72903jivany
ParticipantYou would probably have to do something like:
if( bp_the_profile_group != "3" || bp_the_profile_group != "4" ) {
//display the profile stuff in register.php
}You should be able to just toss that check near the top of that while loop and then remember your closing brace at the bottom.
April 12, 2010 at 2:40 am #72800Gene53
ParticipantThanks jivany, if I want to filter out groups 3 and 4, do I simply need to replace your above code’s “group number” with “3, 4”?
Thanks again
April 12, 2010 at 2:40 am #72900Gene53
ParticipantThanks jivany, if I want to filter out groups 3 and 4, do I simply need to replace your above code’s “group number” with “3, 4”?
Thanks again
April 12, 2010 at 2:31 am #72797jivany
ParticipantBasically, check your register.php main loop and only show the groups you want to show.
You’re looking for the while loop after the bp_is_active( ‘xprofile’ ) call.
Within the loop, you can filter out groups by doing a simple if check using
if (bp_the_profile_group() == "group number")where group number is the number of the group you want to show.Similar sort of idea in this thread: https://buddypress.org/forums/topic/profile-fields-questions
April 12, 2010 at 2:31 am #72897jivany
ParticipantBasically, check your register.php main loop and only show the groups you want to show.
You’re looking for the while loop after the bp_is_active( ‘xprofile’ ) call.
Within the loop, you can filter out groups by doing a simple if check using
if (bp_the_profile_group() == "group number")where group number is the number of the group you want to show.Similar sort of idea in this thread: https://buddypress.org/forums/topic/profile-fields-questions
April 10, 2010 at 9:05 pm #72667rsqst
ParticipantI found a solution here: http://www.code-zen.net/2009/using-custom-profile-field-data-in-buddypress-templates/
What I needed did in fact exist in the members loop already; just needed some help identifying it.
Line 36:
<?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' );
*/
?>
-
AuthorSearch Results