Search Results for 'profile fields'
-
AuthorSearch Results
-
January 8, 2010 at 11:31 pm #60424
vusis
ParticipantThis is great, the what i wanna do next is show certain tabs (profile groups) to different member levels.
I saw there’s a function called profile_group_tabs. is there a way i can perhaps play around with this?
January 8, 2010 at 10:39 pm #60412In reply to: wp and bp profile syncing–works only sporadically
Bowe
Participant@Mike: you are saying that from BP 1.2 you can display user info (xprofile fields) into member blogs? So you could create a widget on a blog which would display basic info from the author (BP avatar + xprofile fields_
That would be great, but I’m not sure if that was what you meant to say!
January 8, 2010 at 9:14 pm #60400In reply to: wp and bp profile syncing–works only sporadically
Mike Pratt
Participant@Andy I think the central issue is that WP and BP store member info separately. For the uninitiated, it means that comments on blogs on a BP sire will not show the same profile info as comments on forums, etc. b/c the blog gets it’s info from the Wp table. So if you go into my admin on my site, none of the info is filled out except email and username, altho there’s AIM, website, First Name etc. But none of that is made avail into a BP install. On my site, the blog comments say ” username” commented….. instead of “Display name” commented.
Additionally, if WP has all those user fields, why are they not exposed to BP already? That’s what is being talked about. So I am writing functions to sync up that data.
January 8, 2010 at 7:13 pm #60384In reply to: wp and bp profile syncing–works only sporadically
peterverkooijen
ParticipantAs much as I agree that you want to keep it simple, the last thing I want to do is a. auto-generate usernames (you have to tell them and they have to remember – let them decide)
They don’t in my site. They log in with email address. The only reason to still have an (autogenerated) username is because you need it for the URL.
parse a field into various name fields (parsing is just begging for errors – too may what-ifs) … But look deeper: they then auto-generate a username. why? who knows … Additionally they auto-gen a drop down list of “display names” … So what’s the diff between me and FB?
Also not much difference between me and FB. The difference between your solution and FB is what the user actually sees on the registration form. I don’t believe a new user will be all that interested in those extra choices.
I hearby declare it off limits to refer to Andy’s decision not to include firsname/lastname ever again.
It’s not up to you to decide what the limits of discussion are. You may get it, but until Andy/WP/Automattic gets it I’ll keep bringing it up. I like the features WP/WPMU/BP offers, there are really no alternatives for those, but they need to get central member management and the database structure up to standard.
January 8, 2010 at 6:59 pm #60381In reply to: wp and bp profile syncing–works only sporadically
Mike Pratt
ParticipantAs much as I agree that you want to keep it simple, the last thing I want to do is a. auto-generate usernames (you have to tell them and they have to remember – let them decide) or b. parse a field into various name fields (parsing is just begging for errors – too may what-ifs)
FYI – Facebook has you do the same 4 fields you mention you are doing. Fine. But look deeper: they then auto-generate a username. why? who knows since you always login with an email address. Additionally they auto-gen a drop down list of “display names”
So what’s the diff between me and FB? I let you pick your display name up front in addition to your username. Ideal no but better than the alternative…for me.
Bottom line is: let’s keep this discussion to how to do our own work arounds. The core way of doing does not appear to be changing. Fine (we can always leave the BP-sphere) Instead, let’s make it work.
I hearby declare it off limits to refer to Andy’s decision not to include firsname/lastname ever again.
We get it.
January 8, 2010 at 5:51 pm #60377In reply to: wp and bp profile syncing–works only sporadically
Mike Pratt
ParticipantWhy not do the following (as we have)
1. Have 4 name fields in BP registration
1. username
2. 1st name
3. last name
4. display name (the bp required field)
Make them all required. We describe “display name” to everyone as “how you want your name to be viewed throughout the site’ If we had a choice, we’d get rid of it and mash 1st and last names together for display purpose. On the other hand, we have also seen many users do the following:
1. username -> jim1974
2. James
3. Smith
4. Jim Smith
Obviously, this allows for nicknames and with a little prodding, you get people entering nicer monikers than “ladiesman269”
Now, with the (lame) fact that WP user table is actually different (not sure why it wasn’t co-opted for BP purposes) All you have to do is create a function that writes the xprofile field values for 1st and Last name over to the WP table, in addition to setting the “display name value accordingly.
a thousand user later and no one has complained.
January 8, 2010 at 1:09 pm #60357In reply to: wp and bp profile syncing–works only sporadically
peterverkooijen
ParticipantWhat does that plugin do? It has some vague requirements:
Create three news fields that will be used by the plugins (ex. “Member name”, “Member firstname”,”Member bothnames”). I suggest “Member name” to be a required field.
Fill the values of those fields for your profile (the datas for at least one user are needed to setup the plugin options)
Where are you supposed to create those fields? xprofile? In addition to the existing fullname field? You can already do that without this plugin.
wp_usermeta is nowhere in the plugin. That is the table WP uses to store firstname and lastname. Any solution in Buddypress should leverage wp_usermeta or at least synchronize with it imho. This plugin solves nothing.
If you’ve got a repeatable case of BP changes not syncing to the WP profile, please create a bug ticket on https://trac.buddypress.org/.
The problem Dan Butcher described looks like standard Buddypress behavior to me. It’s not a bug, it’s a feature, based in Andy Peatling’s design decision that firstname + lastname would cause international incidents.
Below again my hack as I use it in my sites, minus creation + update of a fullname-derived username for user_login, user_nicename, user_url and integration with a mailing list script I use:
function synchro_wp_usermeta($user_id, $password, $meta) {
global $bp, $wpdb;
$uid = get_userdata($user_id);
$email = $uid->user_email;
$fullname = $meta[field_1];
$space = strpos( $fullname, ' ' );
if ( false === $space ) {
$firstname = $fullname;
$lastname = '';
} else {
$firstname = substr( $fullname, 0, $space );
$lastname = trim( substr( $fullname, $space, strlen($fullname) ) );
}
update_usermeta( $user_id, 'nickname', $fullname );
update_usermeta( $user_id, 'first_name', $firstname );
update_usermeta( $user_id, 'last_name', $lastname );
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) );
}
add_action( 'wpmu_activate_user', 'synchro_wp_usermeta', 10, 3);I have this code in bp-custom.php or functions.php, not as a plugin. Adding a plugin header could have caused Dan Butcher’s error messages.
BTW, I’m still looking for code to validate the fullname input for at least a two part name, so make a space required. I now get a lot of users only entering a first name. In that case the lastname field in wp_usermeta will stay empty.
January 8, 2010 at 11:06 am #60351In reply to: Hide some fields in profile
lukabernardi
ParticipantThis seems like a solution that can fit only in certain cases.
I would also like to filter-before-output …
January 8, 2010 at 5:36 am #60341In reply to: Display xprofile field in blog post?
Anton
ParticipantIs it even possible to display “custom” xprofile fields in blog posts?
January 7, 2010 at 6:01 pm #60292In reply to: Groups vs Roles vs Custom Profile Fields
John James Jacoby
KeymasterI know this is a little back from the dead, but I would go about this in a totally different way myself.
I would use good old WordPress usermeta, and have three different registration screens. Giving users the ability to choose something will more often than not confuse them. If you give them a dedicated registration with only the options they need, that will yield better results.
I have a post around here somewhere on how to assign usermeta values directly from registration. Then rather than trying to group users together, rather than wasting a profile field that you eventually have to hide or prevent users from changing, and rather than creating custom user role types, you can just check the meta and go. And if they upgrade their account, you just update the usermeta value.
Custom user roles is a good idea too, but it comes with a little more work to make things cooperate the way you want to use them.
January 7, 2010 at 6:00 pm #60290In reply to: Groups vs Roles vs Custom Profile Fields
designodyssey
ParticipantAlso check out Role Scoper which now has good support for WPMU. I’m doing the same thing, but was hoping to use Role Scoper and BPContents to achieve the same.
January 7, 2010 at 5:35 pm #60282In reply to: Display xprofile field in blog post?
Anton
ParticipantThis is where I got the idea from but it doesn’t seem to work:
https://buddypress.org/forums/topic/displaying-profile-fields-in-blog-posts
January 7, 2010 at 4:43 pm #60276In reply to: Display xprofile field in blog post?
peterverkooijen
ParticipantWe were discussing displaying single xprofile fields here.
Someone gave me this function:
function custom_xprofile( $field ) {
echo bp_custom_get_member_list_xprofile_data( $field );
}
function bp_custom_get_member_list_xprofile_data( $field ) {
global $site_members_template;
return xprofile_get_field_data( $field, $site_members_template->member->id );
}So you can use this in the members index.php:
<p><?php custom_xprofile('Company') ?></p>But it only works in members_template. I’d like to have a function for xprofile fields that works anywhere…
Haven’t had time to try variations on this one. Suggestions very welcome!
@Anton Koekemoer, I’m pretty sure the key would be in replacing $site_members_template in the function, but I wouldn’t know with what.
EDIT2: Here’s the thread where I originally got the function, from John James Jacoby.
January 7, 2010 at 11:45 am #60261In reply to: Groups vs Roles vs Custom Profile Fields
Michael Eisenwasser
ParticipantHow did this turn out? What steps did you take to make it work?
I am creating a site with a similar need. I will have 2 roles – employers and job seekers. I would like to display different fields for each role’s profile and also allow them to pick their role on signup. Any tips?
January 6, 2010 at 6:09 pm #60168In reply to: BuddyPress Geo plugin
John James Jacoby
KeymasterIn my opinion, the downfall of this plugin is that it uses JS to hide xprofile fields that store the lat and lon instead of just using user-meta. That and it just works a little strangely, and I couldn’t really figure out why I wasn’t comfortable with it.
I’ve got a re-engineered version of this plugin I’m using for a client at the moment, and will probably give that code back to the devs of this plugin to be reused for later.
January 6, 2010 at 1:49 am #60128In reply to: Display single xprofile fields
hugodouchet
ParticipantUp! Anyone to help me? Thx
January 6, 2010 at 12:53 am #60124In reply to: Single WP supported on latest trunk
kineda
ParticipantThanks. That clears things up. The only other problem I’ve encountered is after I deactivate the BuddyPress plugin and re-activate it, I’ll get the follow db errors:
WordPress database error: [Duplicate key name ‘useritem’]
ALTER TABLE wp_bp_notifications ADD KEY useritem (user_id, is_new)
WordPress database error: [Table ‘wp_bp_activity’ already exists]
RENAME TABLE wp_bp_activity_user_activity_cached TO wp_bp_activity
WordPress database error: [Duplicate entry ‘1’ for key 1]
INSERT INTO wp_bp_xprofile_groups VALUES ( 1, ‘Base’, ”, 0 );
WordPress database error: [Duplicate entry ‘1’ for key 1]
INSERT INTO wp_bp_xprofile_fields ( id, group_id, parent_id, type, name, is_required, can_delete ) VALUES ( 1, 1, 0, ‘textbox’, ‘Name’, 1, 0 );
January 5, 2010 at 10:23 pm #60115In reply to: Friends and Groups for BuddyPress 1.3
Bowe
ParticipantThanks for further explaining yourself JJJ, and I like the general concept behind a lot.. But the idea that speaks to me the most is making BuddyPress in general more flexible and not “hook” into the group API but make a new one based on that which can not only be used for groups but also for users (and thus friends options).
The idea to make a general API which can be hooked in by the Core components and 3rd Party plugins seems to me the best solution. If you take the group API for example and use it’s functions for individual users:
– Add extra signup pages/fields
– Add new pages
– Add new navigational items etc
All these things are possible with the Group API but take lots of work with a regular profile. Like MrMaz said you could break these functions into smaller parts which can be called upon and extended upon for Groups, Users, Friends and the Activity stream.
The amount of possibilities for new plugins would be endless
Once again I’m no programmer and this is coming from as a site admin/BP enthousiast/”Copy and Paste and pray to god I don’t get a white screen of death” kinda guy..edit: I would also like to say that Mike perfectly summorized my exact ideas of what a group should be and what a group of friends means. Well spoken. I’m getting a Deja Vu here lol
January 5, 2010 at 7:52 pm #60085In reply to: Display single xprofile fields
hugodouchet
ParticipantOk, thank you man,
Your previously answer was very usefull! I’ll try some things too and post a message if i find solution

See ya
January 5, 2010 at 7:42 pm #60082In reply to: Display single xprofile fields
peterverkooijen
ParticipantI’d like to know as well. I’m not a php programmer. I’d noticed this function is specific for the members template, index I guess.
global $site_members_template;I guess we need to add a global there. Or replace it in a separate function. I’ll try some things as soon as I have time.
Ideally I’d like to have a function that works anywhere in the theme…
January 5, 2010 at 7:22 pm #60080In reply to: Display single xprofile fields
hugodouchet
ParticipantHi Peterverkooijen,
Thanks for your help! This function works great!!
But I have another problem now!
In the list member, if I want to show the “company” field near the name (in the loop), what is the function to call to have the member id?Big thanks!
January 5, 2010 at 4:11 am #60035In reply to: BuddyPress Geo plugin
Kate
ParticipantI’m actually having the same issue as shaisimchi. I’ve been playing around with it, but haven’t found the solution. I only had some test users, so I tried deleting those and re-creating users. No dice. Any input would be great. Thanks!
@jamesyeah: I’m pretty sure the fields just need to be instantiated. I’m using a location field from the base group. It took me a while to figure out, but all I had to do was go into edit profile, add data to the field I wanted to use for the location, and select save. Then, that field will show up in the admin drop-down. (If you look at the PHP code, it checks that there is a value for that field. That’s how I figured out what I needed to do.)
Hope that makes sense. May not even be what you were talking about! : )
January 5, 2010 at 3:46 am #60034In reply to: Display single xprofile fields
peterverkooijen
ParticipantI got this solution here earlier. This in functions.php or bp_custom.php:
function bp_custom_member_list_xprofile_data( $field ) {
echo bp_custom_get_member_list_xprofile_data( $field );
}
function bp_custom_get_member_list_xprofile_data( $field ) {
global $site_members_template;
return xprofile_get_field_data( $field, $site_members_template->member->id );
}And then this in the template:
<?php if ( $company = bp_custom_get_member_list_xprofile_data('Company') ) : ?>
<p><?php echo $company ?></p>
<?php endif; ?>I didn’t come up with this myself. Forgot who deserves the credit…
EDIT:
BTW, this seems to work as well:
<p><?php echo bp_custom_get_member_list_xprofile_data('Company') ?></p>Or am I missing something?
EDIT2:
Or further cleaned up:
function custom_xprofile( $field ) {
echo bp_custom_get_member_list_xprofile_data( $field );
}
function bp_custom_get_member_list_xprofile_data( $field ) {
global $site_members_template;
return xprofile_get_field_data( $field, $site_members_template->member->id );
}In the template:
<p><?php custom_xprofile('Company') ?></p>January 3, 2010 at 7:20 pm #59953In reply to: Remove Automatic Links in Profile
Boone Gorges
KeymasterSure, there’s a couple ways to do it.
If you want to turn off linking in specific profile fields (so that nothing in “About Me” gets linked, but locations in “Location” or “Hometown” do), you can use https://wordpress.org/extend/plugins/custom-profile-filters-for-buddypress/. Near the beginning of that plugin, there’s a spot for you to list fields that should NOT be linkable.
If you want to be more specific and look for certain words in a field, here’s how. Copy the original xprofile_filter_link_profile_data function from bp-xprofile-filters.php, paste it into functions.php or wherever you put the remove_filter code, rename it something unique (like henry_xprofile_filter_link_profile_data), then afterwards add the line
add_filter( 'bp_get_the_profile_field_value', 'henry_xprofile_filter_link_profile_data', 2, 2 );At this point you’ll have to customize the filter to look for certain words. Use something like this (untested, but something like it should work):
if ( strpos( $field_value, 'Boston' ) ) {
$field_value = str_replace( 'Boston', '<a href="' . site_url( BP_MEMBERS_SLUG ) . '/?s=Boston">', $field_value);
}In other words, if ‘Boston’ is found in the field, replace the plaintext ‘Boston’ with a link to a search on the word ‘Boston’.
January 3, 2010 at 5:07 pm #59948In reply to: Remove Automatic Links in Profile
Henry
ParticipantAnyone? Really just need to know where to add a remove_filter for links in profile fields.
-
AuthorSearch Results