Search Results for 'profile fields'
-
AuthorSearch Results
-
October 1, 2013 at 3:32 pm #172116
Paul 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.
September 30, 2013 at 8:06 am #172013In reply to: Function to update databse fields
danbp
ParticipantGloabally, each BP member can, by default, modify his profile. So why do you want to add a form for doing this ?
If you speak french, ask on bp-fr.net, i’ll answer you there.
September 30, 2013 at 3:12 am #172005In reply to: Function to update databse fields
martinbeaulne
ParticipantBy “easy”, I meant “There must be simple functions for posting things to the database; but I don’t know them”. I often see people answering to questions with pages and pages of code from outer space, so I thought my little question would be a very simple one….
Well.. Let’s make my question “less general”.
I want to get rid of the bottom tabs of the member profile page. Still, I want the members to be able to edit their profile. I want to style that directly in the member-header.php page.
I want that kind of thing:
<div><?php if ( bp_is_my_profile() ) echo "Hi there, since it's your profile, you can edit the value of field number 46"; echo '<form id="formtochangefield46" name="updatefield46" onSubmit=" " action=" " method="post" > <div>New value</p></div> <div><input type="text" id="updatefield46" name="field46" size="20" style="width:150px;" maxlength="150" value=""> </div> <div><input type="submit" name="submit" value="Submit"></div> </form>'; endif; $embed = wp_oembed_get( xprofile_get_field_data('46'), array( ‘width’ => 400 ) ); echo $embed; ?><br></div>I guess there must already exist wp functions to… call the database and update a field from a form’s submitted values… I mean, how does one creates a custom register page ? It must be the same functions after all…
I hope my question is more precise… And sorry for my english, I don’t really speak it.
September 30, 2013 at 3:10 am #172004In reply to: How to change the font color of Profile Fields.
serie3369
ParticipantThanks for that, but still searching for a solution to this problem…
September 30, 2013 at 2:47 am #172002In reply to: How to change the font color of Profile Fields.
Paul Wong-Gibbs
KeymasterI moved the inline CSS into the pastebin link because it made this thread massively long.
September 30, 2013 at 1:13 am #171987In reply to: How to change the font color of Profile Fields.
serie3369
ParticipantCouldn’t find anything in my style sheet… The color of the text is white and I want to change it to Black or dark grey.
Here is the code: http://pastebin.com/n0YAb8P3
September 30, 2013 at 12:17 am #171986In reply to: Registration + Extended Profiles question
@mercime
Participant@ranebo You can disable registration by going to Settings > General and making sure registration is not enabled.
The users can only fill out whatever Extended Profile Fields the Site/Super Admin created in the backend via Users > Profile Fields, users cannot create new profile fields. These profile fields can only be edited by the user in the front end via Member Profile Screens and not in the back end via User > Your Profie
September 29, 2013 at 2:56 am #171950In reply to: considering BuddyPress
modemlooper
Moderator1. members are searched by profile fields
2. you can create unlimited profile fields
3. there may be an events plugin
4. BP has invite only private groups
5. there was a geo plugin, not sure its up to date
6. members are unlimitedSeptember 28, 2013 at 2:57 pm #171933In reply to: How to change the font color of Profile Fields.
wp_lover_4ever
ParticipantYou should look into the style.css of your theme, and edit the profile field div, and change the html color code from white to black.
You can edit your style.css of your theme either from the dashboard by going to editing, or through FTP access.Good luck!
September 28, 2013 at 2:23 pm #171932In reply to: How to change the font color of Profile Fields.
serie3369
ParticipantI would love to know this too. I cannot see my profile field label. Its white on white. How do I change the text color of that?
September 27, 2013 at 3:29 pm #171902In reply to: Adding classes to profile fields
applegateian
ParticipantThanks for the advice @danbp – I have given this a go but really can’t get the code correct.
Sorry to ask again, but with my four check boxes being as follows, can you let me know what to put in that snipped of code for functions.php? These are the checkboxes I have with the title Budget:
- £0-£100k
- £100k-£500k
- £500k-£2m
- £2m+
Thanks,
Ian
September 26, 2013 at 5:17 pm #171860Hugo Ashmore
Participant@haykayltduk check through tickets if you haven’t as there was one a while back on issues with setting default select options or something to do with that aspect of profile fields.
September 25, 2013 at 2:39 pm #171782In reply to: Disallow HTML tags in profile fields
Henry
Memberfound it
bp_get_profile_field_dataSeptember 24, 2013 at 5:12 pm #171755In reply to: Xprofile check if user can view field
Remco Beugels
ParticipantThanks guys. bp_xprofile_get_hidden_fields_for_user() was the thing that I needed! This is my code:
<?php $hidden_fields = bp_xprofile_get_hidden_fields_for_user(); ?> <?php if(xprofile_get_field_data('field_name') && !in_array(xprofile_get_field_id_from_name('field_name'), $hidden_fields)) : ?> <p><?php echo xprofile_get_field_data ('field_name'); ?></p> <?php endif; ?>September 23, 2013 at 11:28 pm #171735In reply to: Xprofile check if user can view field
September 20, 2013 at 6:55 pm #171596In reply to: Adding classes to profile fields
danbp
ParticipantTry first and ask after when you receive some help ! 🙄
in the example, simply replace Amount by Budget and give it a try
The function checks for “Budget” and the “foreach” looks for the checked box. So you will finally only see the checked box value. This data can be styled by using this:
div.checkit span {your css stuff}September 20, 2013 at 3:09 pm #171591In reply to: Adding classes to profile fields
applegateian
ParticipantHi @chouf1
Thanks for this, but I don’t really follow. The moneytizer example has really confused me, can you let me know how I could do this if the title of my field is Budget and the four checkboxes are
- £0-£100k
- £100k-£500k
- £500k-£2m
- £2m+
thanks,
Ian
September 20, 2013 at 10:55 am #171580In reply to: Geting input values in Edit Profile page
rchiriac
ParticipantI re-added this in the edit.php inside the while ( bp_profile_fields() )
do_action( 'xprofile_updated_profile', bp_displayed_user_id(), bp_get_the_profile_field_id(), trim(strip_tags(bp_get_the_profile_field_value())) );Now… Do you know what is the hook do to upon user registration?
-
AuthorSearch Results