Search Results for 'profile fields'
-
AuthorSearch Results
-
August 14, 2016 at 1:52 pm #257608
anonymousse2
ParticipantActually @danbp I knew that there was a difference between an site admin and an average user. To be certain of it, I have just created an account specially to test the plugin but that does not still work. I can always modify the at will profile fields. What’s to be done?
August 14, 2016 at 12:08 pm #257603danbp
ParticipantUse this:
August 14, 2016 at 11:44 am #257601anonymousse2
ParticipantThank you very much @danbp.
I shall have another small question for you if him you are willing:
Do you know how can prevent the users from modifying one profile fields of type “Dropdown selector” ? That is they can fill this field while their registration, and then that it is not modifiable any more, but that he remains at least shown on the profile.Thank you in advance for your help
August 13, 2016 at 6:42 am #257581In reply to: Xprofile custom fields – image
danbp
Participant@earl_d, this “issue” is mentionned in plugin’s FAQ. Have you done the recommended changes ?
August 11, 2016 at 11:19 pm #257544jbboro3
ParticipantHello,
It’s be great if someone can suggest me how to get custom text before outputting the xprofile field contents. For eg., I’d want to output like “Lives in ($Loction)”, “Studied at ($school)” etc.. How do I output those custom text as “Lives in” “studied at” before the actual content output of fields. The reason being I’m using this on the sidebar widget.. Though I tried with something like:
<?php echo ‘Lives in’, xprofile_get_field_data( ‘Location’, bp_displayed_user_id(), $multi_format = ‘comma’ ) ?>
It outputs the “Lives in” custom text irrespective of whether the field is empty or filled.. I want to show both custom text and field content only when the field is filled..
Thank you.
August 8, 2016 at 3:22 am #257330In reply to: [Resolved] Profile Fields Error!
r-a-y
KeymasterThere was no change to the Extended Profiles component in BP 2.6.2.
Also i created about 11 profile groups but when i checked extended profile for my users from the admin panel i found all the created profile groups plus one more group with no content to it called “Social” which i didn’t create and i can’t even find it under Profile fields tab.
Sounds like a plugin conflict. Did you also install or upgrade some BuddyPress plugins during your BP 2.6.2 upgrade? If so, deactivate those plugins and try to replicate your issue again. Also, try a different theme like twentysixteen since some themes try to add some of their own BuddyPress customizations, which may not work properly.
August 6, 2016 at 4:55 pm #257294shanebp
ModeratorYou should set up a test site so that you can do a proper evaluation.
Answers:
1. The reg form will include any profile fields you place in the ‘Base’ profile group.
2. Each member has a page that includes profile editing.
3. All active members are shown on the ‘Members’ page. That page can include profile details.
August 1, 2016 at 2:30 pm #257154Topic: Image not saving in xprofile textarea field
in forum How-to & Troubleshootingjbboro3
ParticipantHello,
I’ve been trying to remove the strips on images on xprofile textarea fields (as I set the add media button on tinymce editor). I can upload, position and everything but it simply doesn’t save it.. There must be somewhere it’s not allowing to save images and other scripts for security purposes. But I need this feature must as for my current project..
If someone can point me the core files where I can look for that is not allowing to save images or stripping the images and other tags, that would be very much helpful.. I totally want to remove the entire strip tags that will support all the tags including image and iframes etc.,
Somewhat tried with: remove_filter( ‘xprofile_get_field_data’, ‘wp_filter_kses’, 1 );
but still it’s not saving the data.. can someone help me to better implement the above code?
I’m in desperate need of solution as possibly as I could get.
Thanks
July 22, 2016 at 11:21 am #256918In reply to: Visibility Conditions Ignoring Single Digit Values
crawlinson
ParticipantAh HA! My apologies, it seems as though conditional visibility is not a core feature of BP. As I am working with another developer I didn’t realise they had added this functionality through a plugin called “conditional profile fields for buddypress” https://buddydev.com/plugins/conditional-profile-fields-for-buddypress/
Sorry!
July 20, 2016 at 1:02 am #256823In reply to: Buddypress Profiles Display In Wrong Order
danbp
Participant@eli225, please calm down. @sharmavishal is only trying to help you !
It’s not easy trying to help people asking questions without giving much details. It’s the case with this topic and your previous. Have you even read this before asking ?
This is not possible: Buddypress Profiles Display In Wrong Order as it is not BP but the site admin who determines this.
xprofile fields and xprofile field groups (what you call section i suppose ) are drag’n’dropable.
If despite a correct positionning in the backend, the order changed on front-end, two possibilities: the drag’n’drop was to fast or there is a js error/latentency/cookie somewhere. And this is generally due to the theme in conflict with a plugin (which could be BP).
Unfortunately, kleo is a premium theme for which you can’t expect assistance here, as we have no access to it’s code.
For the part related to BuddyPress, note that the actual version works flawlesly with the xprofile component. Nobody related a similar issue to yours recently.
So back to handcrafted annoying but very related questions:
What do you call section ?
Which type of field do you use ?Also related to general debug work:
Have you tested with another theme ?
Have you tested without any other plugin as BP ?July 19, 2016 at 8:10 am #256790danbp
ParticipantOn a default single install, all users can access their credentials via your-site/wp-admin/profile.php
From there they have access to the WP fieldss and to the extended profil fields.
From there, they can change email & password.
Admitting you closed admin access to all users, the only other way for them to modify there email and password is to use the “forgotten your password ?” at loggin stage.
All this is not really a BP thing, but how WP is working since 2003.
The 3 mandatory field (username, email and password) belonging exclusively to WP. They are showed on registration, ASIDE BuddyPress custom fields. BP doesn’t exactly handle them, it only show them. And as these fieds are WP territory and a bit sensible, they are not accessible from within frontend profile settings.Guess the word “critical’ is a bit exagerated. Not every user change his mail or password every day. How long do you wait for a new phone number or new electricity supply ? Probably more critical things as a mail/password change !
July 18, 2016 at 9:31 pm #256779jagarolik
ParticipantOkay, that’s a good start – I’ve installed BP XProfile WordPress User Sync, but there are several critical wordpress account fields inaccessable from BP.
– account email
– account passwordThese are critical, as people change their emails and passwords – and there is no way to do this right now through BP as is.
July 18, 2016 at 9:40 am #256752In reply to: Get users using specific profile field
buddycore
ParticipantYou’re going into a pretty complicated MySQL query.
$field_id = SELECT id FROM wp_bp_xprofile_fields WHERE name = Profile Field$users = SELECT DISTINCT user_id FROM wp_bp_xprofile_data WHERE value = enterprise AND field_id = $field_idThen you’re gonna be implementing a foreach loop in PHP.
That’s the approach I would take, it’s quite in-depth and I’m working on something else at the moment but hopefully that gives you an idea of where to look.
July 18, 2016 at 5:29 am #256734In reply to: Buddypress Profiles Display In Wrong Order
sharmavishal
Participantyou can sort the order in the wp backend by going to profile fields
July 17, 2016 at 4:33 pm #256715In reply to: Add $_POST data before submitting registration
gorbett
ParticipantSOLUTION (finally)
Thanks @henrywright and @coffeywebdev for pointing me in the right direction. Here is what I ended up with.
1. Enable child theme and copy the BP register.php file to the child theme.
2. In the child theme’s style.css, I entered to remove the xprofile fields from the register.php page:
.editfield {
display: none;
}
3. In the child theme’s functions.php file I have this (again, reassign the xprofile fields ‘field_3’ and ‘field_4’ because of their position in the DOM:add_action( ‘bp_signup_pre_validate’, ‘assign_username’ );
function assign_username(){
if ( isset( $_POST[‘first_name’] ) ) {
$_POST[‘field_3’] = $_POST[‘first_name’];
$_POST[‘field_4’] = $_POST[‘last_name’];
$_POST[‘signup_username’] = create_username();
foreach ($_POST as $key => $value) {
echo $key . “: “;
echo $value;
echo “<br>”;
}
exit();
}
}function create_username() {
$i = 0;
$username = $_POST[‘field_3’] . $_POST[‘field_4’];
while (username_exists( $username )) {
$username = $username . ++$a;
}
return $username;
}I am simply creating a username from first name and last name and then start to append a number when inevitably someone with the same name registers. I need to add more validation on the username to ensure that it is <= 50 characters, but this finally worked for me.
Thanks again to the community for pointing me in the right direction!
July 17, 2016 at 3:11 pm #256712In reply to: Add $_POST data before submitting registration
gorbett
ParticipantIssue now is with the extra BP fields coming later in the DOM than my fields on my register.php. Even though I have the css set to display: none for the actual xprofile fields, my fields are not carrying through the $_POST values because display: none does not remove the fields from the DOM.
I guess I can try adding hidden fields after the xprofile fields and set them to the values being entered in my fields, but that seems kinda clumsy.
I added test code to check the $_POST values at where I can see the fields coming over as empty strings: https://pantest.centralus.cloudapp.azure.com/register/
July 17, 2016 at 12:51 pm #256705In reply to: [Resolved] member address
danbp
Participantassuming your fields names are Address, City and Postal code, add this snippet to bp-custom.php and any logged-in user will see these fields on the Member Directory page underneath the already existing informations.
function bpex_address_on_directory( ) { if( bp_is_active( 'xprofile' ) && is_user_logged_in() ) : echo '<p>'; if ( $address = xprofile_get_field_data( 'Address', bp_get_member_user_id() ) ) : echo $address.' '; endif; if ( $zipcode = xprofile_get_field_data( 'Postal code', bp_get_member_user_id() ) ) : echo $zipcode .' '; endif; if ( $city = xprofile_get_field_data( 'City', bp_get_member_user_id() ) ) : echo $city .' '; endif; echo '</p>'; endif; } add_filter ( 'bp_directory_members_item', 'bpex_address_on_directory' );July 17, 2016 at 12:31 pm #256702In reply to: [Resolved] member address
sharmavishal
ParticipantAs mentioned:
In the WordPress dashboard, find under “Users” a link titled, “Profile Fields” (Users>Profile Fields)
Here you can add profile fields to the signup process,
in your case add address, city and postal code fields
if above is added and you are not able to see then check the visibility of this 3 fields
July 16, 2016 at 7:07 pm #256683In reply to: [Resolved] member address
coffeywebdev
ParticipantIn the WordPress dashboard, find under “Users” a link titled, “Profile Fields” (Users>Profile Fields)
Here you can add profile fields to the signup process, if you don’t want to add the fields to signup you need to add a new field group.
The field group ‘Base’ is added to signup process
I hope that helps
July 16, 2016 at 10:32 am #256668In reply to: BP exclude member role
pws2015
ParticipantHi,
In this file: wp-content/plugins/bp-custom.php i add this:function buddydev_exclude_users_by_role( $args ) { //do not exclude in admin if( is_admin() && ! defined( 'DOING_AJAX' ) ) { return $args; } $excluded = isset( $args['exclude'] )? $args['exclude'] : array(); if( !is_array( $excluded ) ) { $excluded = explode(',', $excluded ); } $tab_role=array('administrator','subscriber','author','contributor','editor'); foreach($tab_role as $k=>$role){ //$role = ;//change to the role to be excluded $user_ids = get_users( array( 'role' => $role ,'fields'=>'ID') ); $excluded = array_merge( $excluded, $user_ids ); } $args['exclude'] = $excluded; return $args; }So i exclude all role but i have custom role which users of this role are only can see they profiles in member page
July 15, 2016 at 10:05 pm #256646shanebp
Moderatormodifying the general.php template
There is no such template in a standard BP install, afaik.
But there is an easier way to add a field…
Why not add a profile field in the proscribed manner?
In wp-admin, go to Users > Profile Fields and add your field to whichever Group you want.
All fields in the Base Group will appear on the Registration page.July 14, 2016 at 1:28 am #256575In reply to: Add user ID in profile section
coffeywebdev
ParticipantIn the WordPress dashboard, find under the Users menu a link titled, “Profile Fields”(Users>Profile Fields)
Once you click on this link, then you can add new fields to the profile by clicking the Add New Field button.
When you’ve added a field to the Base(Primary) field group, then it will appear on your registration pages and user profiles.
July 14, 2016 at 12:20 am #256573In reply to: Add $_POST data before submitting registration
coffeywebdev
ParticipantCopy the buddypress theme into your WordPress child theme, and then you can modify the register template if needed.
copy the buddypress theme into your child theme by pasting this path into your child theme folder
/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypresspath of file for registration fields is this:
/wp-content/themes/child-theme/buddypress/members/register.phpThen, add First and Last name fields under User>Profile Links in the WordPress Dashboard.
Currently there is a ‘Name’ field that is required, you can edit it to read ‘First Name’ then add another ‘Last Name’ field..
Then you need to process the data before it saves into the database, I’m kind of at a loss here… I would need more time to brainstorm on it but I did find this hook ‘bp_core_signup_user’
I believe this is the hook you are looking for:
// define the bp_core_signup_user callback function action_bp_core_signup_user( $array, $int, $int ) { // make action magic happen here... }; // add the action add_action( 'bp_core_signup_user', 'action_bp_core_signup_user', 10, 3 );July 12, 2016 at 7:09 am #256516In reply to: Is filtering Activity on CPT meta info possible?
danbp
ParticipantHi,
it’s not the solution but an example you can perhaps use.
The snippet handles the object members and sort them by type “contributing”
Replace object by activity and type by “beer” and see what you can do from that.// add order options to members loop function ch_member_order_options() { ?> <option value="contributing"><?php _e( 'Contributing Members', 'buddypress' ); ?></option> <?php } add_action( 'bp_members_directory_order_options', 'ch_member_order_options' ); // filter ajax members by contributing function ch_filter_ajax_querystring( $querystring = '', $object = '' ) { if( $object != 'members' ) return $querystring; $defaults = array( 'type' => 'active', 'action' => 'active', 'scope' => 'all', 'page' => 1, 'user_id' => 0, 'search_terms' => '', 'exclude' => false, ); $ch_querystring = wp_parse_args( $querystring, $defaults ); if( $ch_querystring['type'] == 'contributing' ) { // grab members by Member Type role declared on xprofile $users = get_users( array( 'fields' => array( 'ID' ), 'role' => 'contributor' ) ); $users_str = ''; foreach ( $users as $user ) { $users_str .= $user->ID . ','; } $users_str = rtrim($users_str, ","); $ch_querystring['include'] = $users_str; $ch_querystring['type'] = 'alphabetical'; return $ch_querystring; } else return $querystring; } add_filter( 'bp_ajax_querystring', 'ch_filter_ajax_querystring', 20, 2 );https://buddypress.org/support/topic/adding-new-order-by-on-members-loop/
July 5, 2016 at 8:02 am #255942In reply to: Profile Fields
danbp
ParticipantIt’s not a duplicate, but how it works.
On the left, you have the WP field for “username”, on the right BP’s mandatory field “name”. Both are used for registering a new user. WP’s username field accept only lower case alphanumerics without space. Mostly used to enter a pseudonym. BP’s field accept uppercase and space or even carets, wich allows to enter first and last name for example.Note that you’re not obligated to enter a first and last name. If you rename Name to City or Gender, a user must enter a city name or his gender. Eg. username: johnrobertsonquid | city: Los Angeles or username: johnrobertsonquid | gender: male
But whatever the field may contain, it cannot be removed.
About xprofile fields:
-
AuthorSearch Results