Search Results for 'profile fields'
-
AuthorSearch Results
-
October 7, 2013 at 5:36 pm #172411
In reply to: Adding classes to profile fields
applegateian
ParticipantSorry to chase, can anybody help clarify this? Thanks again.
October 7, 2013 at 5:09 pm #172409Henry
MemberYou have to give the field a title when you add new profile fields via WP Admin > Users > Profile Fields. Whatever you’ve chosen as your field title is what you should use
October 7, 2013 at 4:09 pm #172404In reply to: [Resolved] Order Members Loop by Custom Field Value
buddhatunes
ParticipantAny suggestions on how to do with an existing drop-down select box field type in Profile Fields?
October 4, 2013 at 9:07 am #172301In reply to: Adding classes to profile fields
applegateian
ParticipantThanks @modemlooper
So the checkboxes for ‘budget’ fall under a third tab within admin:

Would that need something different?
October 4, 2013 at 7:56 am #172299In reply to: Adding classes to profile fields
modemlooper
ModeratorIf you are referring to what the users see and not the admin like in your screenshot you can just target with CSS no need to use a function.
The CSS is:
#buddypress .standard-form .field_2 div.checkbox label
field_2 could be different depending on where you placed the checkboxes in the admin.
October 3, 2013 at 8:41 pm #172280In reply to: Adding classes to profile fields
applegateian
ParticipantCan anyone help me with this one? I know it’s probably really simple but I’m struggling to get this to work.
Thanks
October 3, 2013 at 6:43 pm #172271In reply to: Add extended profile fields programmatically
modemlooper
Moderator// Insert New Field xprofile_insert_field( array ( 'field_group_id' => 1, 'name' => 'Twitter', 'field_order' => 1, 'is_required' => false, 'type' => 'textbox' ) );October 3, 2013 at 1:33 pm #172254In reply to: Show custom user meta fields on user profile page
pacija
ParticipantThank you for your reply. Unfortunately my knowledge of php and wordpress APIs is not sufficient for this. I was hoping to have something to click on, or at least some code snippet.
Perhaps more people will find this feature useful, and someday it gets included in Buddypress.
October 3, 2013 at 1:07 pm #172252In reply to: Show custom user meta fields on user profile page
Hugo Ashmore
ParticipantYou would need to build a script to map the usermeta over to bp profile fields, then they will display automatically in the profile screens.
October 3, 2013 at 12:09 am #172225In reply to: How to change the font color of Profile Fields.
bp-help
Participant@serie3369
You really should still make a child theme and add that that to it. Otherwise if you update your theme it is likely that it will be overwritten.October 2, 2013 at 11:41 pm #172223In reply to: How to change the font color of Profile Fields.
serie3369
ParticipantFIX: I downloaded the firefox addon FireBug. I clicked on the label box for one of the Profile fields that were all showing up white text and were not able to see. This addon allows you to see where the source of the code lies. I found mine in my themes Bootstrap.min.css file. For an easier way to read your code or search for the text color, use your bootstrap.css file. But all final code changes need to be in bootstrap.min.css. My code looks like below:
.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#000;text-shadow:0I already changed the color to black, before it would’ve been #fff
October 2, 2013 at 12:21 pm #172192In reply to: Search page to search custom user fields
shanebp
ModeratorYou could use this or study it to write your own:
https://wordpress.org/plugins/bp-profile-search/October 2, 2013 at 11:10 am #172186In reply to: displaying bp_has_members by profile fields
yasser_148
ParticipantOctober 2, 2013 at 10:57 am #172185In reply to: Search page to search custom user fields
KS Web Designer
ParticipantSo I’m trying to figure this out on my own and I got as far as finding out that since BuddyPress 1.7 there’s a new class: BP_User_Query – which should be similar to the standard wordpress WP_User_Query
However the official BuddyPress documentation page for the class is just a holding page (argh!) – https://codex.buddypress.org/developer/class-reference/bp_user_query/
Does anyone have a basic ‘Hello World’ example they could give me for pulling in a list of users based on a custom profile field?
I’d really appreciate it.
ThanksOctober 2, 2013 at 4:57 am #172169In reply to: registration form with minimum age
bp-help
Participant@randygootjes
This would be easy using just BuddyPress Xprofile fields:
https://codex.buddypress.org/user/buddypress-components-and-features/extended-profiles/
You could create a dropdown menu and make it required and only allow the selection from say 21 to 120 years of age (“Not like most of us will live that long anyway unfortunately”) But also have a check box that is required that all information entered to join the site is true etc.October 2, 2013 at 2:33 am #172163In reply to: How to change the font color of Profile Fields.
bp-help
Participant@serie3369
The codex is your Buddy:
https://codex.buddypress.org/legacy/building-a-buddypress-child-theme/October 2, 2013 at 2:11 am #172161In reply to: How to change the font color of Profile Fields.
serie3369
Participantokay first, how do you create a child theme?
Second, how do you make the child theme to only change the color of the profile fields from white to black.
I would love some step-by-step here since I know little about editing code and what not.
P.S. I do have my themes original style.css posted above for convenience.
PLEASE HELP!
October 1, 2013 at 3:32 pm #172116Paul Wong-Gibbs
KeymasterGood idea, though you’d want the code to look like this:
id="<?php echo esc_attr( bp_get_the_profile_field_name() ); ?>" ...This ensures the output is correctly escaped to avoid XSS attacks.
October 1, 2013 at 10:56 am #172096In reply to: How to change the font color of Profile Fields.
Rishikant
Participant@amareshsingh
Hi, you should first make a child theme for your theme, then paste code to child theme’s style.css.
That is the best way of making changes.October 1, 2013 at 9:24 am #172090nileshkul
ParticipantI figured out the way to do this..just add in the markup of template file
<?php echo sanitize_title( bp_get_the_profile_field_name()); ?>October 1, 2013 at 1:59 am #172074In reply to: Function to update databse fields
xKroniK13x
ParticipantWell if you have access to a database, you can easily change the values. The coding would look something like this, I wrote it but didn’t test it. You’d need BP global enabled to fetch the User ID, and you’d also have to set the field ID to change as you needed it to, or just make a loop that iterates through all the available fields. But this will get you on the right path, I think.
<?php if(isset($_POST['update'])) { $dbhost = 'DB_HOST'; //Host of BuddyPress Database $dbuser = 'DB_USER'; //Username of BuddyPress Database $dbpass = 'DB_PASS'; //Password of BuddyPress Database $dbname = 'DB_NAME'; //Name of BuddyPress Database $field_id = '2'; //ID of the field you are updating $user_id = $bp->loggedin_user->userdata->ID; //Must have $bp global enabled, can probably grab the user ID in a different fashion if needed $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $input = $_POST['input']; //This query will update the field set with the ID set above, you could have easily change it via coding, I just made it static for ease $sql = "UPDATE wp_bp_xprofile_data ". "SET value = $input ". "WHERE field_id = $field_id AND user_id = $user_id" ; mysql_select_db($dbname); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not update data: ' . mysql_error()); } echo "Updated data successfully\n"; mysql_close($conn); } else { ?> <form method="post" action="<?php $_PHP_SELF ?>"> <table width="400" border="0" cellspacing="1" cellpadding="2"> <tr> <td width="100">Field data:</td> <td><input name="input" type="text" id="input" value="<?php xprofile_get_field_data($field_id); ?>"></td> </tr> <tr> <tr> <td width="100"> </td> <td> </td> </tr> <tr> <td width="100"> </td> <td> <input name="update" type="submit" id="update" value="Update"> </td> </tr> </table> </form> <?php } ?>October 1, 2013 at 1:48 am #172072bp-help
Participant@whitewolf1988
Here is one way you could add xprofile fields name as well as the value to the members directory! Just remember to replace “Field-Name with the names of your fields in the 5 variables in my code. Also remember it is case sensitive. If you notice the pattern of 5 in my code you can easily see how to add more fields if you need them. Place this code in bp-custom.php:<?php add_action('bp_directory_members_item', 'bphelp_dpioml'); function bphelp_dpioml(){ $bphelp_my_profile_field_1='Field-Name'; $bphelp_my_profile_field_2='Field-Name'; $bphelp_my_profile_field_3='Field-Name'; $bphelp_my_profile_field_4='Field-Name'; $bphelp_my_profile_field_5='Field-Name'; if( is_user_logged_in() && bp_is_members_component() ) { ?> <div class="bph_xprofile_fields" style=" margin-left: 25%;"> <?php echo $bphelp_my_profile_field_1 ?>: <?php echo bp_member_profile_data( 'field='.$bphelp_my_profile_field_1 ); ?><br /> <?php echo $bphelp_my_profile_field_2 ?>: <?php echo bp_member_profile_data( 'field='.$bphelp_my_profile_field_2 ); ?><br /> <?php echo $bphelp_my_profile_field_3 ?>: <?php echo bp_member_profile_data( 'field='.$bphelp_my_profile_field_3 ); ?><br /> <?php echo $bphelp_my_profile_field_4 ?>: <?php echo bp_member_profile_data( 'field='.$bphelp_my_profile_field_4 ); ?><br /> <?php echo $bphelp_my_profile_field_5 ?>: <?php echo bp_member_profile_data( 'field='.$bphelp_my_profile_field_5 ); ?><br /> </div><?php } } ?>September 30, 2013 at 7:30 pm #172054In reply to: Function to update databse fields
xKroniK13x
ParticipantIf you’re planning on hiding all access to the profile, I’d suggest just adding a link somewhere that takes you to the default edit page. It’s going to be much easier than essentially recoding the entire page – why reinvent the wheel?
September 30, 2013 at 2:55 pm #172035In reply to: Function to update databse fields
martinbeaulne
ParticipantIf i hide the bottom tabs and the admin bar, each user can’t modify their profile.
September 30, 2013 at 1:54 pm #172030In reply to: last_updated field in extended profiles
cwjordan
ParticipantI looked into this further, and looks like the “last_updated” field for just the profile fields in the same group gets updated. The “last_updated” field for profile fields in other groups doesn’t get touched. So I should be able to do what I need as long as I create a separate group for each type of information I want to track the update time on separately.
-
AuthorSearch Results