Search Results for 'profile fields'
-
AuthorSearch Results
-
January 4, 2015 at 10:40 pm #231477
djsteveb
Participant@ch1n3s3b0y – there are options to create your own profile fields, so you could add a new profile field with a radio button eg – choose customer or expert.
There are also different membership plugins and stuff that might enhance that a bit more – plugins like s2member.. maybe even something like press permit…
as far as having a different profile page for each – I think that is going to take some fancy custom coding.. some if then statements and such.. you will likely have to post on a job board to get someone with some skills on that.. it may be tempting to custom code a theme like this – but ultimately I think it would be better to custom code a couple of plugins and drop those into a sidebar or something – eg – “if bp_profile-field-2=customer” then display these fields / this code…
IF you custom mod up a theme and things change in the future where you theme has issues with new buddypress, or you want something different for another reason – then it will be more custom coding to bring over your custom profiles stuff..
just some random thoughts from a BP user – I am not an expert on any of this.
January 4, 2015 at 6:00 pm #231462In reply to: creating custom link
tsabar
Participant<div class="register-section" id="profile-details-section"> <h4>Profile Details</h4> <div class="editfield field_1 field_first-name required-field visibility-public field_type_textbox"> <label for="field_1"> First Name (required) </label> <input id="field_1" name="field_1" type="text" value="" aria-required="true" > <p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-1"> This field can be seen by: <span class="current-visibility-level">Everyone</span> </p> </div> <div class="editfield field_15 field_last-name required-field visibility-public alt field_type_textbox"> <label for="field_15"> Last Name (required) </label> <input id="field_15" name="field_15" type="text" value="" aria-required="true" > <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-15"> This field can be seen by: <span class="current-visibility-level">Everyone</span> <a href="#" class="visibility-toggle-link">Change</a> </p> <div class="field-visibility-settings" id="field-visibility-settings-15"> <fieldset> <legend>Who can see this field?</legend> <ul class="radio"> <li class="public"> <label for="see-field_15_public"> <input type="radio" id="see-field_15_public" name="field_15_visibility" value="public" checked='checked' /> <span class="field-visibility-text">Everyone</span> </label> </li> <li class="adminsonly"> <label for="see-field_15_adminsonly"> <input type="radio" id="see-field_15_adminsonly" name="field_15_visibility" value="adminsonly" /> <span class="field-visibility-text">Only Me</span> </label> </li> <li class="loggedin"> <label for="see-field_15_loggedin"> <input type="radio" id="see-field_15_loggedin" name="field_15_visibility" value="loggedin" /> <span class="field-visibility-text">All Members</span> </label> </li> <li class="friends"> <label for="see-field_15_friends"> <input type="radio" id="see-field_15_friends" name="field_15_visibility" value="friends" /> <span class="field-visibility-text">My Friends</span> </label> </li> </ul> </fieldset> <a class="field-visibility-settings-close" href="#">Close</a> </div> <p class="description"></p> </div>January 2, 2015 at 2:00 am #231352In reply to: Hook for when a user first logs in
valuser
ParticipantHi @ndh01,
I think you could do this just with buddypress.
(just please backup database before….. etc)
Go to Profile Fields—> (Click) Add New Field Group
Add New Field (text) say Field Name virgin
Then add the following to your functions.php
function vub_login_redirect($redirect_to, $set_for, $user){ global $current_user, $bp, $wpdb; $val = 'no'; if (bp_get_profile_field_data (virgin, $user -> ID )!=""){ $redirect_to = bp_core_get_user_domain($user->ID) .'/groups/'; }else{ xprofile_set_field_data( 'virgin', $user -> ID, $val); $redirect_to = bp_core_get_user_domain($user->ID) .'/profile/change-avatar/'; } wp_redirect( $redirect_to ); exit(); } add_action('login_redirect', 'vub_login_redirect', 20, 3);Alternatively you could as you have suggested create a new meta.
A useful plugin for that would be User Meta Manager
Add Custom Meta say a text field Name — firsttimer
then add the following (instead of the above) to your functions.php
function vu_login_redirect($redirect_to, $set_for, $user){ global $current_user, $wpdb; $firsttimer = get_usermeta($user -> ID, 'firsttimer',single); $val = 'no'; if (!empty ($firsttimer)) { $redirect_to = bp_core_get_user_domain($user->ID) .'/groups/'; }else{ update_user_meta( $user -> ID,'firsttimer',$val); $redirect_to = bp_core_get_user_domain($user->ID) .'/profile/change-avatar/'; } wp_redirect( $redirect_to ); exit(); } add_action('login_redirect', 'vu_login_redirect', 20, 3);Obviously change the redirects to wherever you want the user to go.
January 2, 2015 at 12:57 am #231351In reply to: Reliable hosting for BuddyPress installations?
Dave Lozier
Participant@sbraiden – I recently helped migrate a site off of wpengine because of performance issues and the price wpengine wanted for more horse power under the hood. Their next level of service was going to cost $3200 a month. I suggested linode.com and was also amused by the fact that wpengine runs on top of linode.
The page generation times for wordpress/buddypress/bbpress along with various plugins (gravity forms, buddypress xprofile custom fields type, gravity forms upload rules, gravity forms wysiwyg, gd bbpress toolbox, cloudflare…) was not good. It is still not where we want it either, unfortunately.
The site is quite active, pushing 30,000 members and over 1.3+ million rows in the posts table. On average the page generation times are about 1.5 seconds for logged in users. Adding a new bbpress topic/reply can time out sometimes though. (still on the list to track down and fix)
We utilize Cloudflare out front for a CDN and their threat/spam protection. Their service is free but if you need more page rules to balance out caching the pro service level is $20 a month.
On linode we have a node balancer in front of two 4 core app server nodes. The app server nodes each connect directly to their own 8 core database nodes in a master master setup. This will be changing down the road once the database indexes are trimmed down with some denormalization. The cost for the node balancer, two 4 core and two 8 core nodes is $260 a month but that’s also allowing for some room to grow, capacity wise.
Server software is a combination of nginx, apache (threaded), php-fpm, glusterfs (upload directory only), memcache, zend opcode cache and mariadb. Nginx is the web server in front of apache which serves up static files from the glusterfs file system. Nginx is caching the static content being served up by apache along with full page caching (fastcgi) for anonymous visitors. Cloud flare is also caching the static content and to date we aren’t having any performance issues with IO and glusterfs.
I hope this helps. It can be done but it takes some effort (and money) to do so.
December 30, 2014 at 5:17 pm #231282In reply to: Locking some profiles fields
shanebp
ModeratorThis will hide fields on the profile edit page and on the register page.
You need to add the field IDs.
Put the function in bp-custom.php.function oazar_hide_profile_fields( $retval ) { if( is_super_admin () ) return $retval; if( bp_is_profile_edit() || bp_is_register_page() ) $retval['exclude_fields'] = '3'; //field ID's separated by comma return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'oazar_hide_profile_fields' );December 27, 2014 at 12:38 am #231087In reply to: Access to BP functions in external code via wp-load
johnmontfx
ParticipantThanks Dan — while they are separate plugins I’m sure you’ll agree that they are very much joined at the hip (as bbPress even includes BuddyPress functions). What was really nice was the ability to bring in extended Vbulletin profile information over to to BuddyPress extended profiles at the same time as importing to bbPress. Took some custom coding, but the code in both plugins made it fairly clear about how to accomplish it. Makes it easy to use in both plugins.
As far as what I’m trying to do with BuddyPress, it’s basically the issue in the first post. I’ve traced the code a bit more and my main issue right now is simply figuring out if I could get access to the xprofile_get_field_data function. wp-load.php doesn’t seem to call the bp-xprofile-loader.php, so $bp->profile->table_name_fields is empty.
In the meantime, I’ve just issued some mysql db calls to grab the info…but I’d love to use the built in functions if I could.
December 26, 2014 at 9:46 pm #231083In reply to: Men Woman Couple
djsteveb
Participant@mariovisie – you say after you choose the radio button for man, when you login you always see the other fields… you mean when viewing a profile you see all the filed option? OR you mean if you click “edit profile” you see all field option?
I have not seen all fields show when viewing profiles that are already created, so I am confused if you are seeing this in this way.
as far as “Only an administrator must have the option to change this.” – I don’t know about setting permissions for that, another bp expert may be able to chime in on that – or maybe the “press permit core” plugin can lock that down somehow. Not sure on that one.
December 26, 2014 at 12:56 am #231046In reply to: Men Woman Couple
djsteveb
Participantunder “users” -> “profile fields”
add new field.
I choose “field type” radio buttons – you might use checkboxes or something.
put “guy” in the field option under radio buttons.
then click “add another option” text under that.
put “girl”
click add another option
“couple”December 24, 2014 at 8:39 am #231001Kookidooki
ParticipantHello Shanebp,
This is what I mean:
In Buddypress dashboard > Users > Profile Fields > Add New Field Group… it’s not creating a new group.
Is there incompatibilty between WP 4.1 and Buddypress cause it’s duplicating my profile fields. For example: it’s now showing my name field twice.. and the order of the groups are changing every time…Weird
December 23, 2014 at 8:54 pm #230940michaeltransmissions
Participantshanebp — I followed your suggestion and it worked like a charm. I also had to add some code to my functions.php file to be able to redirect calls to the WP Profile page to the BP Profile page because editing the the files you suggested didn’t affect restrict the fields on the WP Profile page (code for this below, if anyone wants).
My only question is the following – would changes to the files in the bp-templates directory get overwritten if I update the BP plugin? If so, it would be nice to find an alternative way to do this, but otherwise I just need to know so I can incorporate a restore of the code changes from a backup to my upgrade workflow document for this site.
Thanks,
Michaeladd_action ('init' , 'prevent_profile_access'); function prevent_profile_access(){ if (current_user_can('manage_options')) return ''; //if admin, exit //everyone else, redirect to the bp profile page, not the wp profile page! if (strpos ($_SERVER ['REQUEST_URI'] , 'wp-admin/profile.php' )){ wp_redirect (bp_loggedin_user_domain()); } }December 20, 2014 at 5:34 pm #230838In reply to: BuddyPress 2.1.1 Adding details to member-header.php
shanebp
ModeratorI cannot duplicate your issue.
In wp-admin, Users > Profile Fields, are your fields part of the ‘Base’ group of fields?
Or are they under another group, in another tab to the right of ‘Base’?btw: instead of
bp_get_profile_field_data, you should usebp_get_member_profile_data
That tutorial is for BP 1.5, very old.December 20, 2014 at 4:48 pm #230833In reply to: BuddyPress 2.1.1 Adding details to member-header.php
mdory89
ParticipantI should’ve explained more. In the WordPress admin panel, If you click Users-Profile Fields, the profile field created and placed into the member-header.php file doesn’t show at all.
Here’s a tutorial I followed: http://code.tutsplus.com/articles/developing-buddypress-themes-part-3-buddypress-15-member-pages-the-overall-user-experience–wp-21856
The code:
<?php $favorite_spot = bp_get_profile_field_data( 'field=Favorite Camping Spot' ) ; echo '<p class="profile-fields">My Favorite Camping Spot: ' .$favorite_spot. '</p>'; $necessary_item = bp_get_profile_field_data( 'field=One Necessary Item' ) ; echo '<p class="profile-fields">My One Necessary Item: ' .$necessary_item. '</p>'; ?>December 20, 2014 at 3:47 pm #230831In reply to: BuddyPress 2.1.1 Adding details to member-header.php
shanebp
Moderatorbut not in the admin menu profile fields section
What exactly are you referring to?
The adminbar at the top of each page? If so, member-header.php does not affect that.December 18, 2014 at 11:55 pm #230801shanebp
ModeratorHow will the ‘tags’ be used?
As the basis for filtering members?
Or just as ‘notes’ about each member?If the former, see the BP_User_Query codex page.
If the latter, you could use this premium plugin: BuddyNotes
Or you could simply create template overloads of these 2 files:
buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\profile-loop.php buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\edit.phpAnd check the fields via their id or name and then decide, based on who the logged-in user is, whether the fields should be displayed.
December 17, 2014 at 6:56 pm #230724In reply to: [Resolved] Hide possibility to change 'Base' name
danbp
ParticipantSorry to answer you with a big laught, it’s not html but php. 😀
You should also find the time to read more attentively the forum, or search by keywords.
in this case: hide xprofile fieldshttps://buddypress.org/support/search/hide+xprofile+fields/
You’re welcome. Glad you got it. 😉
December 17, 2014 at 6:20 pm #230718In reply to: [Resolved] Hide possibility to change 'Base' name
danbp
ParticipantWhen BP is installed and xProfile is activated, the original WP profile settings are not accessible to user.
The WP register process use only username, password and email and BuddyPress add by default a Name field as base for other extended profile fields.
In short this means that username and name fields can contain a same information(a name, a pseudonym, a first or/and a last name). The plugin you mention is best for a WP install where user had choosen first/last name as output on post, comments, etc Once BP is activated, this became a little different.
Now to the initial question.
The CSS trick is a very inelegant solution as it lets everybody knowing how BP works to surround this invisibility. You’re also loosing any flexibility if you want to show some fields privately for example.You can do this properly with a little snippet, as explained here:
Here’s an example which let you hide fields or fiels group to members, but not to site admin
function bpfr_hide_profile_field_group( $retval ) { if ( bp_is_active( 'xprofile' ) ) : // hide profile group/field to all except admin if ( !is_super_admin() ) { //exlude fields, separated by comma $retval['exclude_fields'] = '1'; //exlude groups, separated by comma $retval['exclude_groups'] = '1'; } return $retval; endif; } add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );Add it to bp-custom.php or your child-theme functions.php
Of course you can also choose to show a field or group, but remove the possibility for the user to edit it later. Simply add more conditionnal to the function.
Here another example:
function bpfr_hide_profile_edit( $retval ) { // remove field from edit tab if( bp_is_user_profile_edit() ) { $retval['exclude_fields'] = '54'; // ID's separated by comma } // allow field on register page if ( bp_is_register_page() ) { $retval['include_fields'] = '54'; // ID's separated by comma } // hide the field on profile view tab if ( $data = bp_get_profile_field_data( 'field=54' ) ) : $retval['exclude_fields'] = '54'; // ID's separated by comma endif; return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_edit' );Hope to be clear.
December 17, 2014 at 5:33 pm #230708In reply to: [Resolved] Hide possibility to change 'Base' name
Amic58
ParticipantThank you very much! I was looking for the fix for so long, but I never found one, didn’t know it was that easy.
Also, if it is possible to hide another ‘Base’ name fields.
In extended profile, there is a similar function like in Profile page.
On WordPress Dashboard, when you click Profile, there is a possibility to view Extended profile like on the page before. There is also possibility to change the name.
I also would like to hide the field Name (required), as I don’t want to push people to use their real names.
I use the plugin called Usernames only that eliminates possibility to use real names, but the problem is that people won’t like to add their real name during registration.December 15, 2014 at 8:45 pm #230638In reply to: Making Certain Xporfile fields ReadOnly or Locked
danbp
ParticipantAdd this snippet to your child-theme functions.php or bp-custom.php
function bpfr_hide_profile_edit( $retval ) { // remove field from edit tab if( bp_is_profile_edit() ) { $retval['exclude_fields'] = '2'; // field ID's separated by comma } // allow field on register page if ( bp_is_register_page() ) { $retval['include_fields'] = '2'; // field ID's separated by comma } // hide the field on profile view tab if ( $data = bp_get_profile_field_data( 'field=2' ) ) : $retval['exclude_fields'] = '2'; // field ID's separated by comma endif; return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_edit' );December 14, 2014 at 10:02 pm #230605In reply to: Sort member directory by xprofile field
shanebp
ModeratorThe BuddyPress codex is your friend:
December 10, 2014 at 9:13 pm #230379shanebp
ModeratorRead this for a better approach to your issue: Filtering by Xprofile fields
Another approach: bp_user_query
December 5, 2014 at 10:07 am #230192In reply to: Social Icons Profiles BP
Cartographer
ParticipantIs there any way to make the icons following the privacy rules of the related profile fields?
December 4, 2014 at 7:48 pm #230168In reply to: Social Icons Profiles BP
Cartographer
ParticipantHi @danbp
I tried the way you suggested and it works.
I would like to ask if there is any way the social media icons to follow the privacy rules of the related custom profile fields.
Thank you!
November 29, 2014 at 3:28 am #229862In reply to: Our Member Posts Pages Not Showing in Buddypress
Brent Havill
ParticipantHi Henry
I went to ‘plugins’/buddypress/settings, and found the following (I note that “account settings” is not ticked – could this be it?)
I have bolded the ones that are ticked currently.Settings:
Component Description
Component Description
Extended Profiles Customize your community with fully editable profile fields that allow your users to describe themselves.
Account Settings Allow your users to modify their account and notification settings directly from within their profiles.
Friend Connections Let your users make connections so they can track the activity of others and focus on the people they care about the most.
Private Messaging Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members.
Activity Streams Global, personal, and group activity streams with threaded commenting, direct posting, favoriting, and @mentions, all with full RSS feed and email notification support.
Notifications Notify members of relevant activity with a toolbar bubble and/or via email, and allow them to customize their notification settings.
User Groups Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings.
Site Tracking Record activity for new posts and comments from your site.
BuddyPress Core It‘s what makes time travel BuddyPress possible!
Community Members Everything in a BuddyPress community revolves around its members.November 21, 2014 at 6:12 pm #229313danbp
Participanthi franklinkevin321,
I have disabled all of my xprofile plugins
For our understanding, can you tell which plugins you’re speaking about ?
The snippet is intended for BP, so if you use another source to generate your profile fields, it maybe possible that it screws your template.November 21, 2014 at 12:49 pm #229283Niels Pilon
ParticipantNope, it returns an error that there are no members to display. I guess that I could replace ‘Robin van Persie’ with something blank like this
substr( strstr( ' ', ' ' ), 1 )Just to clarify, this is the full code in my functions.php to sort the members:
function alphabetize_by_last_name( $bp_user_query ) { if ( 'alphabetical' == $bp_user_query->query_vars['type'] ) $bp_user_query->uid_clauses['orderby'] = "ORDER BY substring_index(u.display_name, ' ', -1)"; } add_action ( 'bp_pre_user_query', 'alphabetize_by_last_name' ); // To reflect the alphabetical sorting of the member directory, you // could also format the names to show the last name first. Here is // a helper function to format names as follows: Last, First Middle // Etc. // // To use this function every time a user's name is shown or queried, // simply add it as a filter: // // <code>add_filter ('bp_get_member_name', 'format_last_name_first' );</code> // // To only reformat the name in the member directory, change your // members/members-loop.php file in your (child)theme. Look for // <code>bp_member_name()</code> // and replace it with // <code>echo format_last_name_first ( bp_get_member_name() );</code> /** * Helper function for formatting a name: Last, First Middle Etc. * * @param string $name * @return string Formatted name **/ function format_last_name_first( $name ) { if ( $first_space = strrpos( $name, " ") ) $name = substr( $name, $first_space + 1 ) . ", " . substr( $name, 0, $first_space ); return $name; } // BONUS: To make alphabetical sorting the default sorting, use the // function below. // // In order for this to work properly, <code><option value="alphabetical"></code> // must be the first option for the members-order-select in // members/index.php. function sort_members_alphabetically( $qs = '', $object = false ) { if( $object != 'members' ) //for members only return $qs; if ( empty( $qs ) || ! strpos( $qs, "type=" ) ) { $args = wp_parse_args($qs); $args['type'] = 'alphabetical'; $args['action'] = 'alphabetical'; $qs = build_query( $args ); } return $qs; } add_action( 'bp_ajax_querystring', 'sort_members_alphabetically', 11, 2 );I guess that members are sorted by the default WordPress first and last name fields right? Just because we’ve added some custom fields to the member profile pages to split their names in first name, ‘surname prefix (it’s for words like ‘van’ ‘de’) and last name. Not all members have a surname prefix though.
-
AuthorSearch Results