Search Results for 'profile fields'
-
AuthorSearch Results
-
October 15, 2013 at 5:29 am #172822
bp-help
Participant@shaungreen
I am not sure I am following you but if you deactivated that plugin and a new user can register and activate an account and login successfully then this is not a BP or bbPress issue. It needs to be taken up on that plugins support forum if you insist on using this plugin. Otherwise you may want to look into alternatives! I have used:
https://wordpress.org/plugins/bp-force-profile/
It forces a user to complete the required xprofile fields before they can interact with the site and seem like a good deterrent against spam registrations.October 12, 2013 at 9:43 pm #172749In reply to: 'Survey' Project
@mercime
ParticipantI would like to create a section where people can sign in and answer questions and add their image and then have people see their answers.
@cortttt Sure. Use BuddyPress Extended Profile Fields to highlight the best of your community https://codex.buddypress.org/buddypress-components-and-features/extended-profiles/
Make sure that Extended Profiles is checked in wp-admin Settings > BuddyPress > ComponentsAt the top of the sections would be a running total…total years lost to illness
Check out https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/ and then customize the plugin to include the running total years lost to illness or use/rename birthday field
October 11, 2013 at 5:48 pm #172702In reply to: Adding classes to profile fields
October 11, 2013 at 5:44 pm #172701In reply to: Adding classes to profile fields
applegateian
ParticipantThanks @henrywright-1 and @shanebp
Works a treat 🙂
October 11, 2013 at 5:30 pm #172700In reply to: Adding classes to profile fields
shanebp
ModeratorDon’t initialize $i as a string if you’re going to use it as an integer.
if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) { $i = 0; foreach ( $items as $item ) { ?> <div id="size-<?php echo ++$i; ?>"> <?php echo $item; ?> </div> <?php } }October 11, 2013 at 5:16 pm #172696In reply to: Adding classes to profile fields
Henry
MemberAh I see what you’re trying to do.
$i = '1'; if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) { foreach ( $items as $item ) { ?> <div id="<?php echo 'size-' . $i; ?>"> <?php echo $item; ?> </div> <?php $i++; ?> <?php } }October 11, 2013 at 5:01 pm #172692In reply to: Adding classes to profile fields
applegateian
ParticipantHmm ok thanks @henrywright-1
On the front end I get:
item-1 £500k-£2m
item-2 £2m+The HTML generated is –
<div id="size500"> item-1 £500k-£2m </div> <div id="size500"> item-2 £2m+ </div>How can I make those divs unique?
October 11, 2013 at 4:49 pm #172691In reply to: Adding classes to profile fields
Henry
MemberA unique ID is easy enough, just use the loop to output a unique value. e.g.
$i = '1'; if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) { foreach ( $items as $item ) { ?> <!-- put what you want here --> <?php echo 'item-' . $i; ?> <?php echo $item; ?> <?php $i++; ?> <!-- put what you want here --> <?php } }October 11, 2013 at 4:43 pm #172690In reply to: Adding classes to profile fields
applegateian
ParticipantQuick question @henrywright-1 – any way to give each of those that are spat out a unique id?
Or do they have to have the same HTML around them?
Ideally, each of the items are wrapped different id – e.g.
<div id="size500">£500K</div>October 11, 2013 at 4:40 pm #172688In reply to: Adding classes to profile fields
applegateian
Participant@henrywright-1 it’s added in /wp-admin/users.php?page=bp-profile-setup – Profile Fields under the Users menu in WP Admin.
Your code works, thanks..!
So I can add html into those spaces, and each item is now separated by html…I think that should do it. Thanks so much for the support Team Buddypress 🙂
October 11, 2013 at 4:35 pm #172687In reply to: Adding classes to profile fields
Henry
MemberIs budget a field that you’ve set up under WP Admin > Profile Fields? and is it of type ‘checkbox’? also are you displaying the values on the user’s profile page? if yes to all of these then this should work:
if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) { foreach ( $items as $item ) { ?> <!-- put what you want here --> <?php echo $item; ?> <!-- put what you want here --> <?php } }Note: I’ve amended the code so you can insert HTML a bit easier
October 11, 2013 at 4:24 pm #172685In reply to: Adding classes to profile fields
applegateian
ParticipantThanks for the idea.
Pasting that in (exactly as it is) doesn’t return anything for Budget.
How do I add the HTML I want into:
// put whatever you want hereCheers
Ian
October 11, 2013 at 4:14 pm #172683In reply to: Adding classes to profile fields
Henry
MemberHi @applegateian – I think the problem might be the snippet you’re using to output the data string.
try doing something like this:
if ( $items = bp_get_member_profile_data( array( 'field' => 'Budget' ) ) ) { foreach ( $items as $item ) { // put whatever you want here echo $item; // put what you want here } }Note: I haven’t tested.
October 11, 2013 at 1:58 pm #172679In reply to: Adding classes to profile fields
applegateian
ParticipantNot sure it’s a custom hack…
In WordPress admin, I go to Profile Fields
Then, I have three profile groups in there. The third one is where this budget field sits.
It’s only available to certain user types, which is why it’s in a separate profile group.
However, as far as I know @bphelp – none of this is custom or a hack, this is standard BP functionality? Then using this snippet to show the output on the front end:
<div id="profileProjectSize"> <?php $data=bp_get_member_profile_data(array('field'=>'Budget')); echo $data; ?> </div>October 11, 2013 at 1:53 pm #172678In reply to: Adding classes to profile fields
bp-help
Participant@applegateian
Maybe I am missing something here! Did you add those fields in the dashboard, or was it some custom hack?October 11, 2013 at 1:50 pm #172677In reply to: Adding classes to profile fields
applegateian
ParticipantThat’s what is strange @bphelp – when I inspect element in Chrome, there are simply no tags around the checkboxes on view profile:
October 11, 2013 at 1:47 pm #172676In reply to: Adding classes to profile fields
bp-help
Participant@applegateian
If your on the view profile page and you are inspecting with dev tools you should see a tr class with the field_ID followed by td class label and td class data. You should be able to use those to your advantage.October 11, 2013 at 1:31 pm #172675In reply to: Adding classes to profile fields
applegateian
ParticipantSorry, meant to put @bphelp
October 11, 2013 at 1:20 pm #172674In reply to: Adding classes to profile fields
applegateian
ParticipantHi there
Thanks @bp-help for the response. I’m not inspecting on the edit profile page, no, because I am displaying the ‘budget’ information for site visitors.
It’s on the view profile page ( /profile) that I am showing this field using:
<div id="profileProjectSize"> <?php $data=bp_get_member_profile_data(array('field'=>'Budget')); echo $data; ?> </div>If I go to edit profile page, I can see the following for a checkbox:
<label><input type="checkbox" name="field_229[]" id="field_758_0" value="£0-£100k"> £0-£100k</label>How would I get that unique id to show on the view profile page where I am using it?
October 11, 2013 at 1:00 pm #172673In reply to: Adding classes to profile fields
bp-help
Participant@applegateian
I just created a checkbox called “Sign up for our newsletter” and this is what is return when I inspect the element:<div class="editfield field_21 field_sign-up-for-our-newsletter"> <div class="checkbox"> <span class="label">Sign up for our newsletter </span> <label><input checked="checked" type="checkbox" name="field_21[]" id="field_22_0" value="Yes"> Yes</label> </div> <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-21"> This field can be seen by: <span class="current-visibility-level">Anyone</span> <a href="#" class="visibility-toggle-link">Change</a> </p> <div class="field-visibility-settings" id="field-visibility-settings-21" style="display: none;"> <fieldset> <legend>Who can see this field?</legend> <ul class="radio"><li><label for="see-field_public"><input type="radio" id="see-field_public" name="field_21_visibility" value="public" checked="checked"> Anyone</label></li><li><label for="see-field_loggedin"><input type="radio" id="see-field_loggedin" name="field_21_visibility" value="loggedin"> Logged In Users</label></li><li><label for="see-field_adminsonly"><input type="radio" id="see-field_adminsonly" name="field_21_visibility" value="adminsonly"> Admins Only</label></li><li><label for="see-field_friends"><input type="radio" id="see-field_friends" name="field_21_visibility" value="friends"> My Friends</label></li></ul> </fieldset> <a class="field-visibility-settings-close" href="#">Close</a> </div> <p class="description"></p> </div>I could see how this could be targeted. Are you inspecting on the edit profile page that has the checkbox’s?
October 11, 2013 at 12:42 pm #172671In reply to: Adding classes to profile fields
applegateian
ParticipantHi @bp-help yes I have, there is no id coming through on the checkboxes, they are coming out without any html wrapped around them, eg:
<div id="profileProjectSize"> £0-£100k, £100k-£500k, £500k-£2m, £2m+ </div>I can’t see how to give each one an ID
ThanksOctober 11, 2013 at 12:09 pm #172670In reply to: Adding classes to profile fields
bp-help
Participant@applegateian
Have you tried using firefox in conjunction with firebug to target those elements? You could also use google chromes or IE’s dev tools.October 11, 2013 at 12:04 pm #172668In reply to: Adding classes to profile fields
applegateian
ParticipantThe site is behind a password, anywhere I can DM you?
I just can’t see how to add a unique id to each checkbox.
Thanks,
Ian
October 8, 2013 at 2:54 am #1724463rdaxis
ParticipantI really appreciate your help. Thats the first bit of code that has worked to display the xprofile fields and iv tried allot.
Im not sure if you could help me with this one aspect. I would like to also call something like google+, twitter or facebook links that I created in the xprofile fields.
I can call those fields with the code posted here, but im wondering if @henrywright-1 or anybody stopping by this post could help with the code needed to make the called data as a link with alt text so it looks like Twitter, Google +, Facebook.
Thanks for any help or pointers
October 7, 2013 at 6:35 pm #172414In reply to: Adding classes to profile fields
Henry
Member@applegateian each checkbox should have a unique ‘id’ which you can use to target specific checkboxes.
Do you have a link to your page with the checkboxes on it?
-
AuthorSearch Results