Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 926 through 950 (of 3,589 total)
  • Author
    Search Results
  • #241848
    Quinn Goldwin
    Participant

    Thank you @djsteveb

    I just thought of a different way to word what I’m asking for.

    Is there any way to add @ mentions in xprofile fields? I can make an x profile field called A list team and would like users to add “ie. @jonhdoe so users can be directed to the profile.

    Thanks.

    #241844
    maelga
    Participant

    Do you guys have any snippet to display the xprofile fields ID in admin?
    The lesser I go to my db, the happier I am! 🙂

    #241742

    In reply to: Delete profile fields

    shanebp
    Moderator

    You can get the ids by going to .../wp-admin/users.php?page=bp-profile-setup
    Click or roll-over the Edit links for group or single field.
    And you’ll see group_id & field_id.
    btw – you can delete groups and / or single fields on that wp-admin page.

    #241741

    In reply to: Delete profile fields

    Henry Wright
    Moderator

    You could put it in your functions.php file, or even your bp-custom.php file if you have one. It only needs to be run once so make sure you remove it after visiting your website in a web browser.

    Finding the group ID or the field ID is something you’ll need to do yourself. Take a look in your database and find table bp_xprofile_fields. Then look for the id column and the name column. Say the name of the field you want to delete is ‘Social’. Just look for ‘Social’ in the name column and find the id of that particular row. Then you have your field ID.

    #241668
    stegtflesk
    Participant

    Thx for the replay, but its not the value of the field i need, but the array of options i have created in the wp backend.

    Ex.

    I have created a new profile field in the “User->profile fields” page in the wp backend. Calling it eyecolour.

    So i select the field to be a “select, dropdown” (still in the wp backend). I enter an array of eyecolours as options and saves the field and set the default colour as green. I am now able to extract the value of the field as you shown above. But i wanto get the full array of all the options of the field pref. as and array. Then i would be able to create the dropdown, dynamically in the frontend, using the options i allready created.

    psudocode example (i know its the wrong functions, its just to show the logic):

    $selectedOption = get_profile_field(‘eyecolor’);
    $possibleOptions = get_profile_field_options(‘eyecolor’); //this function i need!! 😛

    foreach ($possibleOptions as $option) {

    if ($option == $selectedOption) {

    echo ‘<option selected value=”‘.$option.'”>’.$option.'</option>’;

    } else {

    echo ‘<option value=”‘.$option.'”>’.$option.'</option>’;

    }

    hope this makes sense 😀

    #241617
    danbp
    Participant

    Hi

    instead using a link field type, use a normal text box and harcode the link to social account in the function. That way, the user has only to enter his account name and the link is build when the data is on front-end.

    profile fields are stripped
    profile datas are made clickable by default for search purpose in BP
    We don’t want this for icons or when linking to a social network.

    Here an usage example which use fontawesome to add the icons. That the general idea, change it to your need.

    function bpfr_socialize_profile () {	
    
    echo '<br>'; 
    
    if ( $data = bp_get_profile_field_data( 'field=Twitter ' ) ) : 
    ?>
    
    <a href="http://twitter.com/<?php echo xprofile_get_field_data( 'Twitter', bp_displayed_user_id() );?>/" target="_blank" title="Twitter"><i class="icon-twitter"></i><?php echo $data; ?></a>&nbsp;
    
    <?php endif;
    
    if ( $data = bp_get_profile_field_data( 'field=Facebook ' ) ) : 
    ?>
    
    <a href="http://facebook.com/<?php echo xprofile_get_field_data( 'Facebook', bp_displayed_user_id() );?>/" target="_blank" title="Facebook"><i class="icon-facebook"></i><?php echo $data; ?></a>		
    
    <?php		
    endif;
    }
    add_filter( 'bp_before_member_header_meta', 'bpfr_socialize_profile' );
    Quinn Goldwin
    Participant

    Never mind I used this css coding to add line breaks, still not perfect but it looks so much better than it used to!

    #buddypress table.profile-fields p {
    	margin-top: 10px !important;
    	margin-bottom: 10px !important;
    }
    
    Henry Wright
    Moderator

    Right. So it looks as though it could be something the BuddyPress core team might need to look at. Can you open a Trac ticket explaining how the profile fields are displaying in the wrong order? If you could provide as much info as you can that’d be great.

    You can use the same username and password as you use here in the forums.

    #241481
    whoaloic
    Participant

    Hello,
    actually I mean to merge content of members/single/settings/general.php and members/single/profile/edit.php.
    My idea is to get custom BP profile fields (username) along with the email and password fields in the general settings tab.
    When I copy plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/ to mytheme/buddypress/members/single/, those files don’t override plugin core files.

    #241425
    Anonymous User
    Inactive

    Hello danbp,

    So far i understand you use bbPress and now you want a members directory, and eventually some additionnal fields on user’s profiles. And most of this should be private or “members only”, right ?
    >> Correct, combined with private bbpress forums on a website with also public content.

    I have set the “members” page I created as private, but it is still displayed when I go on the page as a logged out user. Why is that so?
    Would it work if I would not connect the “members” page with BuddyPress in the settings, set the page to private and pull the dynamic content for the members list by a stortcode?

    I can read into the codex of course, but do I need to learn to code to use BuddyPress?

    Nicole

    #241424
    danbp
    Participant

    Hi @nmschaller,

    bbPress is a separate plugin and BuddyPress doesn’t manage bbPress. For questions about forum settings, you can use the bbPress support.

    When you use BP groups component, you can add a forum to each of them. In this case only, you have to install bbPress. Of course you can also use bbPress as standalone on a BP install, or use bbPress with WordPress, without BP.

    BP doesn’t use “pages” but templates, and the only pages created during installation are in for internal purpose. The “member” page is used to show the member directory, but also profiles or members activities. This dynamic content is displayed on different templates, depending the context, and using WP’s page system to fire all that via a same page slug (aka internal path).

    your-site/members/some/thing/ where /some/thing/ is using his own template part displayed on “members page”.

    So far i understand you use bbPress and now you want a members directory, and eventually some additionnal fields on user’s profiles. And most of this should be private or “members only”, right ?

    The main problem is that you want some custom behave that need some knowledge (you seem to have), but you cannot edit functions.php Unfortunately, this is the place where to add customisation. And what to tell about bp-custom, which is another crucial cusmisation file.

    You want to drive and have no steering wheel ! Annoying… 😉

    The question is Do you need BuddyPress or can you use another solution ? 🙂

    Depends your project, really. Members directory or extended profiles can be done with separate plugins.

    Read here:
    http://chrislema.com/best-wordpress-membership-plugin-2014/

    Or digg into the Codex if you decide to use BuddyPress.

    #241391
    shanebp
    Moderator

    There is a filter hook for displaying profile fields – so you don’t need to hack core files.

    apply_filters( 'bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id );

    Use str_replace to insert your target blank string.

    function swiss_target_blank( $field_value, $field_type, $field_id ){
    	
    	if( $field_id == 123 ) { // get the field_id from edit field url in wp-admin
    
    		$field_value = str_replace('rel="nofollow"', 'rel="nofollow" target="_blank"', $field_value);
    	}
    
    	return $field_value;
    }
    add_filter('bp_get_the_profile_field_value', 'swiss_target_blank', 11, 3);
    danbp
    Participant

    How to create MT is explained above, and you’re lucky, as a brand new plugin was published a few days back by @offereins: BP XProfile Field For Member Types

    Proof of concept for the implementation of member-type specific profile fields in BuddyPress.

    https://github.com/lmoffereins/bp-xprofile-field-for-member-types

    Successfully tested with my custom code(in bp-custom.php), BP 2.3.2.1 and WP 4.2.2

    #241319
    danbp
    Participant

    See if this can help you:
    https://buddypress.org/support/topic/men-woman-couple/

    Also some topics about multi search criteria, like this one
    https://buddypress.org/support/topic/multiple-search_terms-displays-nothing/

    Note also that xprofile fields values are clickable by default. This let users get a list of members who entered same value.

    Field name > Gender, when male is clicked you get all males list.

    For more detailed result, you have to buid your own solution or to use a dedicated plugin. See
    https://wordpress.org/plugins/buddypress-global-search/

    #241298
    danbp
    Participant
    Aethermage
    Participant

    Thank you for your reply @danbp.

    I actually created the profile field myself in Dashboard > Users > Profile Fields to emulate a captcha plugin. For some odd reason it appears under Account Details instead of under Profile Details on the Register page and is missing from the backend so I am unable to edit/delete it.

    #241044
    shanebp
    Moderator

    If the role is set to vendor and xprofile fields are not involved, then there is a WP hook for that.

    Assuming the group_id is 8, try:

    function jeffery_join_vendor_group( $user_id, $role, $old_roles ) {
    	if( $role == 'vendor' ) {
    		groups_accept_invite( $user_id, 8 );
    	}
    }
    add_action( 'set_user_role', 'jeffery_join_vendor_group', 11, 3 );
    #241005
    danbp
    Participant

    When you use WordPress alone, you can use many plugins for registering.

    If you use BuddyPress, you also use his fonctionnalities.
    One of them, is Members, which comes also with extra components, like extended profile.

    When you use extended profile, it is like using a register plugin for WP, with his own extra fields you can create/add to the original WP registering process. After that, each user can handle/view these fields on his profile.

    Now you have to choose:
    – WP alone, with his poor profile fields
    – WP + BP, with rich profile fields
    – WP + BP, without xprofile component (and users go back to the original profile fields aera).
    – or ask on ninja plugin support for improvement guidance to apply with BuddyPress.

    #240969
    peter-hamilton
    Participant

    One of the few things I not tried much is the add profile fields option, this is where I guess that can be achieved

    Small example on my sites profile

    #240825
    ct25
    Participant

    Today I found there was a member-loop.php added to my theme files. Could this be part of the problem? Should I add the member template file to the theme as well?

    <?php
    
    /**
     * BuddyPress - Members Loop
     *
     * Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter()
     *
     * @package BuddyPress
     * @subpackage bp-default
     */
    
    ?>
    
    <?php do_action( 'bp_before_members_loop' ); ?>
    
    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
    
    	<div id="pag-top" class="pagination">
    
    		<div class="pag-count" id="member-dir-count-top">
    
    			<?php bp_members_pagination_count(); ?>
    
    		</div>
    
    		<div class="pagination-links" id="member-dir-pag-top">
    
    			<?php bp_members_pagination_links(); ?>
    
    		</div>
    
    	</div>
    
    	<?php do_action( 'bp_before_directory_members_list' ); ?>
    
    	<ul id="members-list" class="item-list" role="main">
    
    	<?php while ( bp_members() ) : bp_the_member(); ?>
    
    		<li>
    			<div class="item-avatar">
    				<a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></a>
    			</div>
    
    			<div class="item">
    				<div class="item-title">
    					<a href="<?php bp_member_permalink(); ?>"><?php bp_member_name(); ?></a>
    
    					<?php if ( bp_get_member_latest_update() ) : ?>
    
    						<span class="update"> <?php bp_member_latest_update(); ?></span>
    
    					<?php endif; ?>
    
    				</div>
    
    				<div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
    
    				<?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' );
    				  */
    				?>
    			</div>
    
    			<div class="action">
    
    				<?php do_action( 'bp_directory_members_actions' ); ?>
    
    			</div>
    
    			<div class="clear"></div>
    		</li>
    
    	<?php endwhile; ?>
    
    	</ul>
    
    	<?php do_action( 'bp_after_directory_members_list' ); ?>
    
    	<?php bp_member_hidden_fields(); ?>
    
    	<div id="pag-bottom" class="pagination">
    
    		<div class="pag-count" id="member-dir-count-bottom">
    
    			<?php bp_members_pagination_count(); ?>
    
    		</div>
    
    		<div class="pagination-links" id="member-dir-pag-bottom">
    
    			<?php bp_members_pagination_links(); ?>
    
    		</div>
    
    	</div>
    
    <?php else: ?>
    
    	<div id="message" class="info">
    		<p><?php _e( "Sorry, no members were found.", 'buddypress' ); ?></p>
    	</div>
    
    <?php endif; ?>
    
    <?php do_action( 'bp_after_members_loop' ); ?>
    
    #240478
    patrix87
    Participant

    Same problem here,

    I’ve even tried to modify xprofile_filter_kses directly to add img tag without any success.

    Apparently the fields are being filtered more than once.

    here’s my modified code

    function xprofile_filter_kses( $content, $data_obj = null ) {
    	global $allowedtags;
    
    	$xprofile_allowedtags             = $allowedtags;
        $xprofile_allowedtags['a']['img']['rel'] = array();
    
    	$xprofile_allowedtags = apply_filters( 'xprofile_allowed_tags', $xprofile_allowedtags, $data_obj );
    	return wp_kses( $content, $xprofile_allowedtags );
    }
    
    #240238
    CodeMonkeyBanana
    Participant

    @shanebp Thanks for the reply.

    […]in any relational table, if an item is assigned to a group ID and that group ID no longer exists in the table that holds group IDs, then that data will not be displayed, ie. orphaned.

    I deleted through the admin panel so I am not sure what was deleted, that was what I meant by asking if is was standard behaviour. Possibly what I should have said is; when a user deletes a group by using the ‘bp-profile-setup’ page to click on the ‘delete group’ button, is buddypresses default behaviour to just drop the group and leave the profile data in the table or does it also iteratively remove the profile fields?

    I can see the reason why you would want to leave the data in the table (and also reasons why you wouldn’t). I had a quick look at the code but I am not familiar enough with it yet to pinpoint the exact code block.

    If fields are not deleted then I guess any fields directly referenced would still be visiable on the site. That may be misleading to user as they may assume deleting a group would also remove fields. However you wouldn’t want a group to be deleted by accident and then a large amount of data be lost. I would guess a system of deleting the group and then updating each profile field to explicitly notify calling functions that their parent has been deleted would be appropriate in the circumstance.

    I have used a relational database before but I am unfamiliar with the logic employed by buddypress to interact with it.

    The behaviour I was was getting was weird. When I deleted a group and created it again no fields were showing. Then when I added a field, it had a value immediately after creating so something weird was going on so I thought I would ask to see if you knew if the profile data gets deleted when a user clicks delete group in admin panel.

    I am starting again now so will pay closer attention to all data as it goes into fresh tables but sometimes it is harder to see to absence of data compared to the addition of new data.

    Why? BP will always create a Base group.

    I am running a multisite where individual user blogs can create their own fields (https://codex.buddypress.org/themes/guides/segregated-x-profile-fields-for-multisite/).

    As the article says:

    This code will not create dummy content, so for every new site you will need to create a Profile Fields group and add profile fields to it manually.

    When I create new site there are no field groups made at all which I assumed is what it was talking about. Also I wanted to have a default set of groups but allow subsite to edit them. If they want to get default groups back they can just delete all their groups and default will be restored. I could add a separate button for that but I just figured I’d do it like this, no particular reason, I am still in early stages of project.

    I think there were other errors at play so starting from scratch with a little more understanding will hopefully enlighten me. I will be duplicating tables this time instead of using meta table.

    #240141
    shanebp
    Moderator

    This is a basic mysql table structure issue.

    The id field is set to auto increment.
    So it you really want the id to be 1, you need to flush the bp_xprofile_groups table.
    But that may orphan any data you have in bp_xprofile_fields or cause mismatches with data in the
    bp_xprofile_data table.

    Perhaps the id field should not be an argument in xprofile_insert_field_group.

    Does it really matter what the id is?

    #240140
    Henry Wright
    Moderator

    Yeah sounds like it could be your database preserving referential integrity. i.e. Can’t delete a profile group unless all fields belonging to that group have been deleted first.

    Check what’s going on by looking at your database. This may help:

    BuddyPress Database Diagram

    #240114

    In reply to: Per-group Identity?

    Tony G
    Participant

    Well, group meta allows meta data to be applied to groups. I’m thinking along the lines of data in the usermeta table which is only consumed by specific groups. This might be expressed as a name/value pair in the profile. So with reference to my original example, a GroupName profile value would include:
    school:Robert
    home:Bobby
    coolGame:Zarcon

    The BuddyPress Profile Shortcodes plugin allows for custom fields and related shortcodes to be used. This is much closer to my needs but still not quite there. I can’t create a profile field for every possible group. Ideally there would be a pulldown of groups to which the user belongs, where they can enter the name they wish the use for that group, and the group/name pairs would be displayed in a grid.

    Now I’m thinking one of the better user meta plugins could handle that. But I would also need to customize it so that there can only be one WP user with a specific value for a specific group. This is a unique key per group, as some reference to @Bobby can’t apply to more than one person, but the @Bobby in one group can be different from @Bobby in another group.

    On the client side, I would then need to modify bbPress to get the user name that’s specifically for the current group, rather than using wp_get_current_user()->display_name or whatever it has there. For example:
    get_user_meta($user_id,’groupName_’.$group_id,true)
    or better
    get_user_meta($user_id,’groupNames’,false)[$group_id]

    Actually I’d rather abstract all requests for a user name to a function which can then be replaced with custom code just once. I don’t suppose anyone has already done that, or it’s been proposed as a BP/BBP enhancement?

    I’m a noob with coding into WP, haven’t touched BP/bbP, and know little about the APIs, so please bear with me on the syntax and other specifics and focus on the concepts. Thanks.

    The more I try to flesh it out above the more it seems possible for me to do this myself. But it would be really helpful if someone has already done it. Or if someone with knowledge in this area can see a more direct line from an exiting plugin to the solution I’m describing.

    Thanks for your time!!

Viewing 25 results - 926 through 950 (of 3,589 total)
Skip to toolbar