Search Results for 'profile fields'
-
AuthorSearch Results
-
September 16, 2014 at 8:43 pm #197213
cwjordan
ParticipantJohn,
Thanks. I’m sure caching that data speeds things up in normal use, however I do regularly need to export all the extended profile fields, and it doesn’t make sense to try and cache that.
What exactly do you need to know? I’ve got 13302 users, with roughly 115 extended profile fields (many of which tend to be blank for a given user). My little test script is below, although what I actually use is the “Export User Data” plugin.
<?php /* Template Name: test template */ ?> <h2>TEST of BP_XProfile_ProfileData::get_all_for_user</h2> <?php global $bp; $start_time=microtime(true); $memory_use = memory_get_usage(true) / 1024 / 1024; echo "<br/>Start Memory Use = $memory_use MB"; for ($userid = 1; $userid <= 5000; $userid++) { BP_XProfile_ProfileData::get_all_for_user($userid); } $times_run = $userid -1; $finish_time = microtime(true); $elapsed_time = $finish_time - $start_time; $avg_time = $elapsed_time / $times_run; echo "<br/>Ran get_all_for_user for $times_run users"; echo "<br/>Elapsed time = $elapsed_time seconds"; echo "<br/>Avg time = $avg_time seconds"; $memory_use = memory_get_usage(true) / 1024 / 1024; echo "<br/>End Memory Use = $memory_use MB"; echo "</p>"; ?>johnhutchy2014
Participanthmmmmm I like to keep buddy press up to date 🙁 and my scripting skills are rather poor! I would have thought that there should be some validation already built in, why have the field as required otherwise?
During registration they enter their account details which consists of a username,email addy, password and confirm password, then they create their profile details on the right of the page, which Ive added fields for first name , last name, gender, DOB etc, and Ive selected that the first name and last name are required fields, so surely if they fail to enter data the form shouldn’t submit??
or am I missing something here 🙁
September 15, 2014 at 9:37 pm #197025applegateian
ParticipantApologies, I’m not a developer but trying to find a solution that works.
I tried editing bp-profile-filters.php by adding
add_filter( ‘xprofile_get_field_data’,’wpautop’ );I also tried upgrading Buddypress Xprofile Custom Fields Type plugin, as it was out of date, but this hasn’t helped.
From my rudimentary understanding, What I think I need to do is edit echo $data; to somehow include wpautop but I am not finding a way to do that…apologies if it is simple.
Thanks,
Ian
September 15, 2014 at 3:57 pm #196713In reply to: Is Buddy Press Right for me?
sundev
Participant@joedostie buddypress can achieve that as @ubernaut has said.
(1) When your users register, they will have their own profile page to put their details by default. You’ll need to create extra fields for bio/phone/etc as many as you want through the admin User->User Profile Field.
(2) For the animals profile, Wp static page or Category could be use to achieve that.
(3) For each user to blog independently, you can use these 2 plugins together: http://buddydev.com/plugins/buddyblog/ and http://buddydev.com/plugins/bp-simple-front-end-post/see function on site http://sunmyke.com
September 15, 2014 at 3:53 pm #196711In reply to: Is Buddy Press Right for me?
Ben Hansen
Participantwell out of the box you can set up any kind of fields with any label you wish i think a lot of what you need would be covered with text area fields. i would suggest you try it out on a test or stagaging server so you can get an idea for how xprofile works its pretty adaptable as is.
September 15, 2014 at 4:13 am #195823In reply to: Is Buddy Press Right for me?
Joe Dostie
ParticipantThanks Ben,
I appreciate the input. Any chance you may have examples? The more and more I read the more I seem to be understanding. I guess I am trying to accomplish 2 things here.
First I think I am trying to possibly extend and customize the “Portfolio” portion of WordPress.
As a very simple example I would like make the Project = to an Animals if you will.
The Categories would be their Species, Breed, Gender, etc.
The Skills could be Friendly, Likes Kids, House Trained, etc.I think the part the it troubling be is that this may require some customization in the form of renaming fields to be less confusing to the non-technical user. I consider myself technically savvy and I am lost! 🙂
I am guessing this could be accomplished with a Form like page or a plugin. But I was hoping someone was going to say…”oh ya, easy, just use XYZ”
——————————————-
So this would be my thought…
1.) A generic user with very little technical skill would come in to a very simple profile page of some sort.
2.) They fill in some info about themselves (so other fosters can see it – bio/phone/etc)
3.) They have a section on animals(s) they foster
4.) The animal would have its own profile if you will (because its a foster it can move around)It would be nice to use the blogging feature so each person can add, stories, pictures, links, videos and everything else WP has to offer.
——————————————-
Again, thanks for the reassurance, I think I am on the right track. I just think I may be putting the cart before the horse right now as there is a ton to do and a ton more to learn!
Anyone else reading this please feel free to send along some suggestions.
Thanks
September 14, 2014 at 11:12 pm #195818applegateian
ParticipantThanks for the pointer @henrywright – I’ve tried a few executions but can’t seem to generate the breaks/p tags that are needed.
Here is an example of where I am seeing the problem with profile fields – is there a way within the text that is outputted to enable wpautop? Thanks…
<div class="keyPeople"> <?php if (bp_get_profile_field_data('field=Key People') == "") : echo ''; else: // display code $data=bp_get_member_profile_data(array('field'=>'Key People')); echo '<h3>Key People</h3>'; echo $data; endif; ?> </div>September 13, 2014 at 3:54 pm #193476In reply to: [Resolved] Customise register page
danbp
ParticipantThe field NAME in the field group BASE is required. This group is used for the registration page to work. As you already know, it’s also this group who allows you to show custom fields on the registration page.
The NAME field in BuddyPress is intended to receive first and last name and replace the two original fields (first name, last name) coming with WordPress.That said, you can hide this field to users, but you can’t give them the choice to show/hide it.
The above snippet will hide the field NAME to all visitors/members, but not to site admin and the concerned profile.
function bpfr_make_name_members_only( $retval ) { //hold all of our info global $bp; // is xprofile component active ? if ( bp_is_active( 'xprofile' ) ) // The user ID of the currently logged in user $current_user_id = (int) trim($bp->loggedin_user->id); // The author that we are currently viewing $author_id = (int) trim($bp->displayed_user->id); // user can see only his name && admin can see everyone if ($current_user_id !== $author_id && !current_user_can('delete_others_pages') ) { $retval['exclude_fields'] = '1'; } return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'bpfr_make_name_members_only' );Add this to your child-theme functions.php or to bp-custom.php
September 12, 2014 at 5:55 pm #192577In reply to: [Resolved] Need a plugin to require xprofile fields
samdobrow
ParticipantGood points.
Initially, I’d be glad to have a check to require completion of all the xprofile fields then automatically (approve) change the user role to allow more access.
Another option might to be to grant access to the xprofile fields while in a pending status, then manually approve when the profile is completed. Currently, I have an intercept in the login routine that logs users out if their status is pending and redirects them to a “Pending Approval” page. Perhaps I could leave them logged in and force the redirect to the xprofile page. Any ideas on how to form the correct url to the xprofile page? Will all xprofile tabs be accessible under the single url?
Thoughts? Ideas?
September 12, 2014 at 11:29 am #192184In reply to: [Resolved] Need a plugin to require xprofile fields
colabsadmin
ParticipantHave you asked the BP Private plugin devs? Seems that you could edit their code to do a check of each required field. They’re probably only checking if a person is logged in.
if (!bp_is_my_profile() && !bp_custom_get_member_list_xprofile_data('Company') && !bp_custom_get_member_list_xprofile_data('Location'))The unfortunate part of this is that check would have to be done on every page causing unnecessary processing time to every page load, unless you set a cookie or a single flag in the db. But then what happens if a user removes the information in one of the fields at a later date.
September 12, 2014 at 9:00 am #192180In reply to: Can BuddyPress Do This?
danbp
Participantyes, you can have all this !
Profiles are public, but you can set them as “members only”.
And each member can choose the field visibility. Also it is very easy to let some fields public, allow to members or only to users friends.You can also hide comments with your conditionnals.
Discover here all buddypress features and read a bit the codex to see all things you can realize with buddypress.
September 12, 2014 at 1:00 am #192165schorsch2
ParticipantHi,
I have had the same problem and now, I have found a solution which works with my theme: just declare the variable $data (or whatever name you give it) as static before calling bp_get_member_profile_data or bp_member_profile_data like this:<?php static $data = 'bla'; ?> <?php do_action( 'bp_directory_members_item' ); ?> <?php /*** * If you want to show specific profile fields here you can, * but it'll add an extra query for each member in the loop * (only one regardless of the number of fields you show): * * bp_member_profile_data( 'field=the field name' ); */ $data = bp_get_member_profile_data( 'field=Taetigkeit' ); if( $data != '' ) echo $data; ?>September 11, 2014 at 2:35 pm #192058In reply to: Changing Name's default visibility
danbp
Participantnot the exact answer, but a way how to do it.
This snippet will make the NAME field hidden to all except for adminsfunction bp_define_hidden_fields( $hidden_fields, $displayed_user_id, $current_user_id ) { //if not admin or if not the profile of the current user if ( !is_super_admin( $current_user_id) && ($displayed_user_id != $current_user_id) ) { //add name field ( id = 1 ) to the hidden fields $hidden_fields[] = 1; } return $hidden_fields; } add_filter('bp_xprofile_get_hidden_fields_for_user','bp_define_hidden_fields', 10 ,3 );Reference:
bp-xprofile/bp-xprofile-classes.phpSeptember 8, 2014 at 11:02 am #190923In reply to: [Resolved] Re-install Buddypress Tables
christicehurst
ParticipantBelow is the errors that gave out after installing Buddypress
WordPress database error: [Table 'christic_database.wp_bp_xprofile_data' doesn't exist] SELECT id, user_id, field_id, value, last_updated FROM wp_bp_xprofile_data WHERE field_id = 1 AND user_id IN (1) WordPress database error: [Table 'christic_database.wp_bp_xprofile_fields' doesn't exist] SELECT * FROM wp_bp_xprofile_fields WHERE id = 1 WordPress database error: [Table 'christic_database.wp_bp_xprofile_fields' doesn't exist] SELECT type FROM wp_bp_xprofile_fields WHERE id = 1 WordPress database error: [Table 'christic_database.wp_bp_xprofile_fields' doesn't exist] SELECT id FROM wp_bp_xprofile_fields WHERE id = 1 Warning: Cannot modify header information - headers already sent by (output started at /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php:227) in /home/christic/public_html/wp-includes/pluggable.php on line 1173 WordPress database error: [Table 'christic_database.wp_bp_user_blogs' doesn't exist] SELECT COUNT(*) FROM wp_bp_user_blogs WordPress database error: [Table 'christic_database.wp_bp_user_blogs' doesn't exist] DELETE FROM wp_bp_user_blogs WHERE 1=1 Notice: Trying to get property of non-object in /home/christic/public_html/wp-content/plugins/buddypress/bp-members/bp-members-admin.php on line 829 Notice: Trying to get property of non-object in /home/christic/public_html/wp-content/plugins/buddypress/bp-members/bp-members-admin.php on line 829 WordPress database error: [Table 'christic_database.wp_bp_user_blogs' doesn't exist] SELECT COUNT(id) FROM wp_bp_user_blogs WHERE user_id = 1 AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs' doesn't exist] INSERT INTO wp_bp_user_blogs ( user_id, blog_id ) VALUES ( 1, 1 ) WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT blog_id, meta_key, meta_value FROM wp_bp_user_blogs_blogmeta WHERE blog_id IN (1) ORDER BY id ASC WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'url' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'url','http://www.christicehurst.me') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'name' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'name','Chris Ticehurst') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'description' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'description','Creative Writer cat') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'last_activity' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'last_activity','2014-09-08 10:59:55') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'close_comments_for_old_posts' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'close_comments_for_old_posts','') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'close_comments_days_old' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'close_comments_days_old','14') WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] SELECT id FROM wp_bp_user_blogs_blogmeta WHERE meta_key = 'thread_comments_depth' AND blog_id = 1 WordPress database error: [Table 'christic_database.wp_bp_user_blogs_blogmeta' doesn't exist] INSERT INTO <code>wp_bp_user_blogs_blogmeta</code> (<code>blog_id</code>,<code>meta_key</code>,<code>meta_value</code>) VALUES (1,'thread_comments_depth','5')Below is the errors from two other plugins
Strict Standards: Declaration of UberMenuWalkerCore::start_lvl() should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 227 Strict Standards: Declaration of UberMenuWalkerCore::start_el() should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 227 Strict Standards: Declaration of UberMenuWalkerCore::end_el() should be compatible with Walker_Nav_Menu::end_el(&$output, $item, $depth = 0, $args = Array) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 227 Strict Standards: Declaration of UberMenuWalkerEdit::start_lvl() should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 401 Strict Standards: Declaration of UberMenuWalkerEdit::end_lvl() should be compatible with Walker_Nav_Menu::end_lvl(&$output, $depth = 0, $args = Array) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 401 Strict Standards: Declaration of UberMenuWalkerEdit::start_el() should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /home/christic/public_html/wp-content/plugins/ubermenu/core/UberMenuWalkerCore.class.php on line 401 Notice: Undefined index: ctype in /home/christic/public_html/wp-content/plugins/mycred/addons/banking/services/mycred-bank-service-interest.php on line 575 Notice: Undefined index: user_id in /home/christic/public_html/wp-content/plugins/mycred/addons/banking/services/mycred-bank-service-interest.php on line 576September 5, 2014 at 8:59 pm #189703ChiefAlchemist
Participant=> re: “Note that you need to add the correct id(s) for exclude_fields.”
Thanks shanebp. But is this the only way? I mean, I can’t do mucking with the code every time the client wants something new? Can I?
=> re: …/buddypress-xprofile-custom-fields-type/
“Add new visibility setting “Nobody”. Hide the field to all members.”
So this means, I presume that custom visibility is possible. Yes?
That said, I want to use standard fields, but I want to create the list via code, and not have to do it manually. Not possible? Mind you, it could be cause I’m new to BP but I’m trying to where / how the profile definitions are stored. I presume it’s an array, or close. So I want to do that but with code.
Thanks again
September 5, 2014 at 8:09 pm #189699shanebp
ModeratorI wouldn’t rely on messing with visibility settings.
To make a profile field only editable by admins, do this in bp-custom.php or a plugin:// only admins can edit the Skills field function chief_hide_profile_fields( $retval ) { if( is_super_admin () ) return $retval; if( bp_is_profile_edit() || bp_is_register_page() ) $retval['exclude_fields'] = '3'; //profile field ID's separated by comma return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'chief_hide_profile_fields' );Note that you need to add the correct id(s) for exclude_fields.
And that ‘ || bp_is_register_page() ‘ keeps the field(s) off the register page – which you may not need to do.Re how to create profile fields in code, there a couple of ways to do it depending on the kind of field and how it will be used.
Take a look at these plugins for more info:
https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/
https://wordpress.org/plugins/buddypress-xprofile-image-field/September 4, 2014 at 11:00 am #189600In reply to: Extended Profiles / Can't edit the fields
Cartographer
ParticipantHi @danbp
Thank you very much for your response. I really appreciate it!
I think that I understand your points and I will wait for the next update.
My only comment here it that under “My profile fields visibility settings” maybe it would be nice to see the data next to the profile fields (not edit them just see them).
Thank you again 🙂
September 4, 2014 at 10:52 am #189599In reply to: Extended Profiles / Can't edit the fields
danbp
ParticipantIt is not an issue, it is intended so !
The logged user’s profile tab comes with 3 sub menus:
– View (public)
– Edit (private)
– Change avatar (private)On the main navigation of the member, you have at least
– Settings with 3 sub nav items:
– account credential (email, password)
– notifications
– field visibility settingsAnd if component is activated:
– Friends
– Groups
– ForumI agree that this Setting is confusing, at least, because those labels should indicate My Friends, My Groups, My Forums and My profile fields visibility settings, which is too long i grant you. 😉
FYI: such distinction wern’t really possible untill now in the original english version.
But the upcomming BP 2.1 brings some better context disambiguation just to improve such situation.To solve this today, you can:
1) create a translation file and modify the wording (but, as said, without disambiguation)
2) use a child theme and hardcode the text you want into the template file (best approach)
3) wait a few days for 2.1 to use the first optionSeptember 4, 2014 at 9:34 am #189583In reply to: Extended Profiles / Can't edit the fields
Cartographer
ParticipantI found this:
1) If you go through Settings and then Profile you are neither able to edit your profile nor to even see the infos (e.g. your display name)
http://i57.tinypic.com/2i6gvf5.png
2) If you go through Profile and then Edit you can edit your profile as it should
http://i61.tinypic.com/2rpv2gk.png
Well it does make sense but wouldn’t be great if you could at least see the info/fields using the method 1?
Regards
September 3, 2014 at 8:59 pm #189562In reply to: [Resolved] Registration form Field Error
danbp
ParticipantI don’t understand why you obstinatly want to write bios on wordpress (inactive when BP is activated) when you can do that with xprofile !
On the register page you have a single line text area field. Why don’t you use a multiline area for doing this ?
field type = Multi-line Text Area.
Entered text will then appear on user’s profile !The function you want to use cannot work, as it contain errors.
Sorry to tell, but I think you have to learn some php and buddypress handling before going to reinvent the wheel or making things you don’t really understand.
Some good reads here, and many others on the forum.
September 3, 2014 at 6:03 pm #189549In reply to: Multi select field no array?
danbp
ParticipantIf you want your user to set their profile, you must activate the xprofile component first.
You must also have a component page called by default Members
And a page for activation and another for registering.Then you must create some profile fields
Dashboard > users > profile fieldsAt this stage, which is the default process, you have nothing to know about array’s or code. All this is done within in a user friendly interface.
Sorry to detail such things – and probably knowed & done by you, but topics are also read by many other people.
You have an issue with multilines text areas ? OK
– do you use a custom theme or a third party theme ?
– are you on a local install ?
– have you other js malfunction elsewhere on your site ?
– have you tested with another browser ?Anyway, i guess you have to debug by deactivate all plugins but BP on the 2014 theme and retest the text area.
September 3, 2014 at 4:46 pm #189540In reply to: Multi select field no array?
ahalle
ParticipantI want the users to edit your own profile.
If the user is currently trying to save his entry in multiple select box, only in the last entry is saved, because the values are not passed in an array. Exactly the same problem at the register page.However, when I try from the backend multiple typed select and save the changes to take effect. Since this there passed as an array.
Now the question is how do I get it out that the multi-select are passed as array fields in the frontend?
September 3, 2014 at 1:19 am #189015shanebp
Moderatortry this in bp-custom.php.
You’ll have to get the ids of the fields you want to exclude on the register pagefunction register_hide_profile_fields( $retval ) { if( bp_is_register_page() ) $retval['exclude_fields'] = '3'; //field ID's separated by comma return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'register_hide_profile_fields' );September 2, 2014 at 3:49 pm #188992In reply to: Extended Profile Deletes Base Profile "Display Name"
Sokrates
ParticipantHi, Just in case it’s of use….
I’m a bit of a BP newb, and I’m using a fresh install of WP 3.9.2 and BP 2.0.1
I’m using a Gravity form as a registration form with the GravityForms User Registration add-on to register BuddyPress users.
As a newb, I have been experimenting a lot with the XProfile fields, and also noticed that at some stage of the proceedings, I had made a change that resulted in the same problem as in the first post – the WordPress last name value was deleted and the firstname field was set to the nicename when the update profile button was pressed.
I had changed the primary field in the XProfile fields from “Name”.
Replacing the primary field as Name, and mapping the “full name” field from the Gravity form to this field in the Gravity User Registration add-on screen seems to solve it for me
September 1, 2014 at 3:36 pm #188874DarkPsy
ParticipantIt’s one of those I just have to grind it out I guess. I’m not worried at all about the PHP Notices, that’s fine. The absolutely amazing behavior where the current_avatar function stops working even on a clean install is spooky. I’ll post something if I do make a break through , which seems unlikely right now.
Workaround: bbp_current_user_avatar fetches the gravtar link associated with an email.
At signup I have another custom field which forces the user to upload an avatar and then I replace all avatar references to the user defined profile image.You could do this with custom fields or a plugin like ‘Buddypress upload avatar ajax’ and then just retrieve the value from the $user.
Anyway you won’t have a website which relies solely on gravatars to begin with.
Until then I’ll stick to this, thanks again Dan for your patience. Cheers!
-
AuthorSearch Results