Search Results for 'profile fields'
-
AuthorSearch Results
-
August 20, 2010 at 10:32 pm #89873
Roger Coathup
Participant@drwebstein – this thread might might help you: https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/adding-more-fields-to-groups/
August 15, 2010 at 7:21 pm #89206In reply to: Need to check if bp_profile_field_data() has data
Roger Coathup
ParticipantI’m not really sure what you are trying to do with your code. Whereabouts are you trying to hide fields with no data? In the default theme profile-loop.php, fields without values are already not displayed.
As for quick fixes: You’ll need to replace ‘your-field-id’ with a variable that’s got the field id in it. You’ll also need to write valid PHP e.g. closing the PHP code before beginning your html. I’d steer clear of inline style definitions as well; the default BuddyPress theme comes with a comprehensive set of CSS files, and you’d be better augmenting these with style definitions.
Unfortunately, this forum isn’t really the appropriate place for PHP coding tutorials – You might be better reading up on PHP before attempting to modify the theme templates in any depth.
August 15, 2010 at 2:45 pm #89176In reply to: Need to check if bp_profile_field_data() has data
Roger Coathup
Participantin your child theme, wherever you want to hide fields that have no data, you can put a simple if statement, something like:
if (bp_get_profile_field_data(‘field=your-field-id’) === “”) :
// don’t display code
else:
// display code
endif;Which file to edit, all depends where it is you are wanting to display / hide the profile field. The most likely file for displaying profile fields is profile-loop.php in members/single/profile, but that already skips blank fields (using a call to bp_field_has_data(); that function has to be used inside the profile field loop).
August 14, 2010 at 5:34 am #89046In reply to: Using user fields for tags
pcwriter
ParticipantHere’s an option:
https://buddypress.org/community/groups/custom-profile-filters-for-buddypress/It turns any profile field into a clickable search term that brings up directory of all profiles matching that term. Could be useful… depends on how you want to use it.
August 13, 2010 at 6:24 pm #89001In reply to: Hide profile field
nickmy
ParticipantAugust 13, 2010 at 6:08 pm #88998In reply to: Hide profile field
r-a-y
KeymasterTested just now, works for me.
You need to use the profile id #.Go to your profile field setup and check the ID by putting your mouse over the “Edit” field. The ID # is field_id.
For example, “Name” is 1.Either that or go to your DB and manually look up the profile field id in the wp_bp_xprofile_fields table.
You can also use any profile template tag and do your conditional.
If you wanted to use the profile name, use bp_get_the_profile_field_name() instead.
August 12, 2010 at 6:31 pm #88868In reply to: Hide profile field
r-a-y
KeymasterYou have to ask 1000 and 1 times!

You have to modify the profile loop (/members/single/profile/profile-loop.php)
Change this line:
while ( bp_profile_fields() ) : bp_the_profile_field();to:
while ( bp_profile_fields() ) : bp_the_profile_field(); if ( bp_get_the_profile_field_id() != 'ID # YOU WANT TO SKIP' ) :then change the corresponding endwhile; line to:
endif; endwhile;—
That’s one way of doing it.
August 12, 2010 at 3:10 pm #88840In reply to: Hide profile field
nickmy
ParticipantAugust 12, 2010 at 1:54 pm #88834In reply to: dynamically create new sets of profile fields
Roger Coathup
Participant@arxpoetica – we haven’t implemented any code yet, as we may now be moving all profile field handling out of BuddyPress on this client project.
If we do end up cutting BP code this, I’ll remember to post a snippet.
August 9, 2010 at 8:57 pm #88580In reply to: User Pages?
nickmy
Participantyeah but maybe you want to have somethink like nickpage
….and it would be cool if you could show fields/categories in a new tab on profile homepage
August 9, 2010 at 8:16 pm #88575In reply to: User Pages?
Beck B
ParticipantWait, I’m confused. You want it to show up in their profile, right? So why not just create a profile group and relevant fields?
Although…hmm….that might get tricky in terms of multiple Living/Deceased. Or you just allow a max number of pets (say, 5 in each category) and create that many profile fields. Anything left blank won’t show up in the profile.
That wouldn’t let you upload photos natively, although I wouldn’t be surprised if we already have a plugin for that.
Then again, you also wouldn’t have anything compiling everybody’s tributes. Is that what you want? Have to admit, I’m not super-clear on what you’re looking for.Hm.. Not my most helpful reply, sorry.
Another thought: maybe you can mix a form you create with one of the front-end blog post plugins. So whatever interface they’d normally have to post an entry to the blog (your listing of everybody’s tributes) would be heavily locked down to just the info you want. I’m thinking BuddyPress would automatically include a link to the generated tribute post somewhere in their activity feed. (I know you said you don’t want a blog type page, but here I’m assuming you meant that you didn’t want the submission page to be part of a blog, not that you don’t want the submitted tributes to be incorporated in a blog.)
August 9, 2010 at 2:31 am #88504In reply to: dynamically create new sets of profile fields
Arx Poetica
ParticipantJust following up on this — what might some code look like? Say, to just even simply create a new profile field type and populate it once?
August 7, 2010 at 7:43 pm #88376lorenzo
Memberi’m not sure if i’m posting in the wrong place, if i’m asking the wrong questions or both?
does anyone have a clue about the above and where the code which does the update of the profile fields actually is? some guidance/suggestion (any) will be very helpful to put me in the right direction! thanks
August 3, 2010 at 6:03 pm #87887In reply to: bettercodes.org
gottowik
Participant@Anton Some of the first bp releases came with an option to insert all countries in wp-admin by direct sql insertion. Someday it was removed because it was not implemented well…. I am not sure who thought it would be better to type in all these countries manually…

If you really need all of these countries, just write a short sql script and take this data: http://pokerexistence.com/wp-content/plugins/buddypress/bp-xprofile/prebuilt-fields/?DD
August 2, 2010 at 11:42 pm #87794In reply to: Getting User’s Full Name from user_id
techguy
ParticipantI found this little function:
$user_test = new BP_Core_User( $referring_user_id );Has the full name, but you still have to go through all the xprofile fields. Plus, is it ok to call the user info this way? Will it have problems down the line.
Another option is to sync the display_name with the name in the BP profile field, but I’m not sure the best way to do that and that could be problematic if they make changes to the name later.
Anyone else run into this issue?
July 30, 2010 at 5:44 am #87458techguy
ParticipantThe beta release of the BP oembed plugin I think will allow pictures to be embedded from outside sources in profile fields. It’s not an upload, but might be better than an upload depending on what you’re doing.
July 28, 2010 at 4:40 am #87232In reply to: Registration Page
dlmfisher
MemberFixed! I went back to the database, searched on the pre-propagated terms, and found them in user “0” fields for all x-profile table rows, and deleted the responses. Everything’s now blank as it should be.
July 26, 2010 at 3:51 pm #87069In reply to: Hide some profile fields
nickmy
Participantno I just need a little hack… It must be visible when I use this:
/***
* If you’d like to show specific profile fields here use:
* bp_profile_field_data( ‘field=About Me’ ); — Pass the name of the field
*/July 26, 2010 at 12:33 pm #87042nickmy
ParticipantHello
can someone tell me how I can just remove a created Profile Category? I want to use it somewhere else and not unter the profile tab.
I’ve created a new category with fields in the Profile Field Setup and now I dont want to have it under the profile. Please I’m notgood with php. Just a special category not all of them
July 25, 2010 at 11:47 pm #86978In reply to: Signup Usermeta in Single User Environment Issues
hardlyneutral
ParticipantUPDATE: It looks like $usermeta is getting the string that should go in ‘meta_key’ and the array of data that would go in ‘meta_value’, but it is not actually doing the insert. Is this something goofy with a validation against xprofile fields?
July 25, 2010 at 2:04 pm #86939In reply to: User Pages?
nickmy
Participantthere is no plugin but I’ve got an idea how to do that but my php isnt that good I hope php-programmers will help us.
1. You go to Profile Field Setup and create a new Category called pages and add then you add some fields.
2. You create a new tab and you’ll need to add this code:
/***
* If you’d like to show specific profile fields here use:
* bp_profile_field_data( ‘field=About Me’ ); — Pass the name of the field
*/Change About Me with your specific field
3. NOW
one php-programmer here must tell us how we can “delete” the created category in the profile pageJuly 25, 2010 at 1:32 pm #86934Ali Erkurt
ParticipantI think it’s about “onchange” event, right? But how can I integrate this to the fields?
July 24, 2010 at 7:38 pm #86897In reply to: dynamically create new sets of profile fields
Roger Coathup
Participant@boonebgorges – Great that you think it can be done with the existing tables (I was considering adding some additional tables keyed on the user profile id). The hook into xprofile at the right place is what I was looking for.
We are going to filter out profile fields where the user hasn’t input a value anyway (and not display them). I take it this is as simple as checking whether the field value is an empty string. Although, as you point out, you would still want these displayed on the edit page.
So, it’s check for NULL and check for standard field (vs. extended field) name as well.
July 24, 2010 at 6:13 pm #86878In reply to: dynamically create new sets of profile fields
Boone Gorges
KeymasterThis could be done, but it would take some custom coding. Here’s how I would structure it.
1) Write some JS for the Edit Profile page that inserts a new set of fields based on user input (say, a button that says “Add another employer”). This wouldn’t really require any BP code in and of itself.
2) Hook a function to ‘xprofile_updated_profile’, which is a do_action hook called right after all of the xprofile fields are saved. Grab the $_POST data, and see if there are any items in that array for which no profile fields yet exist. Use xprofile_insert_field() to create the new fields (it might be like employer_2_employer_address – something that iterates nicely).
3) On the front end, you’ll want to make sure that not all of the employer groups are shown to each user on the edit profile screen. By default, each user sees each profile field. That means that if one person on your system listed ten employers, then everyone would see ten employer field groups when they went to edit their profile. You could do this in the profile edit template, by checking bp_get_the_profile_field_name() against a list of permitted field names.
July 24, 2010 at 6:09 pm #86875In reply to: dynamically create new sets of profile fields
paulhastings0
ParticipantYeah, I would agree that a functionality like that would be nice.
-
AuthorSearch Results
no answer