Search Results for 'hide xprofile fields'
-
Search Results
-
Hi @danbp,
My question may sound obvious so my apologies in advance if that’s the case.
The issue: I was trying to hide a specific xprofile field group and used the code you provided here https://buddypress.org/support/topic/conditional-exclusion-of-a-xprofile-fields-group-from-editing/ adding it to bpcustom.php.
It worked as a charm, and the group is currently visible only to logged-in users (both in profile view and profile edit). However I no longer need the group to be publicly hidden, but removing the function and the respective add_filter from bpcustom.php does not seem to work: the group stays visible to logged-in users only.
Unfortunately I have no idea about how to address this issue, the best clue I could figure out is I might have to remove the filter registered by your bit of code (and yet that’s but a guess as my php knowledge is pretty amateurish). I would really appreciate if you could help me figuring out what’s happened, considering that my only change to your code was using my own group ID number.
Thanks in advance for you attention.
My wordpress is 4.1 and Buddypress 2.1.1
Hello Community,
I am having a problem with a custom member page pagination, when clicking link to pagination page 2, pagination takes us to page 2 and adds the string “?upage=2” to the site URL.
After that, clicking page 1 or back symbol on pagination links does nothing, only refreshes page.
Problematic page: http://wp1.kodeserver.net/coach/
I have set the page above in Twentyfifteen theme as to exclude any third party theme related errors.If we use the default member page “http://wp1.kodeserver.net/members/” then pagination works ok.
I believe the error might be caused by the member filter i made or maybe i messed up the template.
Hope you can help.
Below is the code i am using:
functions that i use to filter member loop by member types on the site:
function bp_exclude_users_but_player() {
$excluded_users_but_player = implode(',',get_users('role=coach&fields=ID'));
$excluded_users_but_player = $excluded_users_but_player.','.implode(',',get_users('role=seniorcoach&fields=ID'));
$excluded_users_but_player = $excluded_users_but_player.','.implode(',',get_users('role=subscriber&fields=ID'));
$excluded_users_but_player = $excluded_users_but_player.','.implode(',',get_users('role=editor&fields=ID'));
$excluded_users_but_player = $excluded_users_but_player.','.implode(',',get_users('role=administrator&fields=ID'));
return $excluded_users_but_player;
}function bp_exclude_users_but_coach() {
$excluded_users_but_coach = implode(',',get_users('role=player&fields=ID'));
//$excluded_users_but_coach = $excluded_users_but_coach.','.implode(',',get_users('role=seniorcoach&fields=ID'));
$excluded_users_but_coach = $excluded_users_but_coach.','.implode(',',get_users('role=subscriber&fields=ID'));
$excluded_users_but_coach = $excluded_users_but_coach.','.implode(',',get_users('role=editor&fields=ID'));
$excluded_users_but_coach = $excluded_users_but_coach.','.implode(',',get_users('role=administrator&fields=ID'));
return $excluded_users_but_coach;
}function bp_exclude_users_but_senior_coach() {
$excluded_users_but_senior_coach = implode(',',get_users('role=player&fields=ID'));
$excluded_users_but_senior_coach = $excluded_users_but_senior_coach.','.implode(',',get_users('role=coach&fields=ID'));
$excluded_users_but_senior_coach = $excluded_users_but_senior_coach.','.implode(',',get_users('role=subscriber&fields=ID'));
$excluded_users_but_senior_coach = $excluded_users_but_senior_coach.','.implode(',',get_users('role=editor&fields=ID'));
$excluded_users_but_senior_coach = $excluded_users_but_senior_coach.','.implode(',',get_users('role=administrator&fields=ID'));
return $excluded_users_but_senior_coach;
}function bp_exclude_cc_backend_users() {
$excluded_cc_backend_users = implode(',',get_users('role=subscriber&fields=ID'));
$excluded_cc_backend_users = $excluded_cc_backend_users.','.implode(',',get_users('role=editor&fields=ID'));
$excluded_cc_backend_users = $excluded_cc_backend_users.','.implode(',',get_users('role=administrator&fields=ID'));
return $excluded_cc_backend_users;
}
Member Loop that calls member “Coach” filter:
<?php if ( bp_has_members( bp_ajax_querystring( 'members').'&exclude='.bp_exclude_users_but_coach().'&per_page=24' ) ) : ?>
And this is the problematic page template code (The one that filters by role type (coach))
<?php
/**
* The template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages and that
* other 'pages' on your WordPress site will use a different template.
*
* @package WordPress
* @subpackage Kleo
* @since Kleo 1.0
*/get_header(); ?>
<?php get_template_part('page-parts/general-title-section'); ?>
<?php get_template_part('page-parts/general-before-wrap'); ?>
<?php
if ( have_posts() ) :
// Start the Loop.
while ( have_posts() ) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', 'page' );
endwhile;
endif;
?><?php do_action( 'bp_before_directory_members_page' ); ?>
<section class="container-wrap main-color">
<div class="section-container container"><div id="buddypress">
<?php do_action( 'bp_before_directory_members' ); ?>
<?php do_action( 'bp_before_directory_members_content' ); ?>
<!--<div id="members-dir-search" class="dir-search" role="search">
<?php //bp_directory_members_search_form(); ?>
</div>--><!-- #members-dir-search --><?php do_action( 'bp_before_directory_members_tabs' ); ?>
<form action="" method="post" id="members-directory-form" class="dir-form">
<div id="subnav" class="item-list-tabs" role="navigation">
-
<!--<li class="selected" id="members-all">"><?php //printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?>--> <!--Contatore membri totali-->
<?php //if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
<!--<li id="members-personal">"><?php //printf( __( 'My Friends <span>%s</span>', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?>-->
<?php //endif; ?><?php //do_action( 'bp_members_directory_member_types' ); ?>
<?php //do_action( 'bp_members_directory_member_sub_types' ); ?>
<!--<li id="members-order-select" class="last filter">
<label for="members-order-by"><?php //_e( 'Order By:', 'buddypress' ); ?></label>
<select id="members-order-by">
<option value="active"><?php //_e( 'Last Active', 'buddypress' ); ?></option>
<option value="newest"><?php //_e( 'Newest Registered', 'buddypress' ); ?></option><?php //if ( bp_is_active( 'xprofile' ) ) : ?>
<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
<?php //endif; ?><?php //do_action( 'bp_members_directory_order_options' ); ?>
</select>
--></div><!-- .item-list-tabs -->
<div id="members-dir-list" class="members dir-list">
<?php
/**
* BuddyPress - Members Loop
*
* Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter()
*
* @package BuddyPress
* @subpackage bp-legacy
*/?>
<?php if ( bp_has_members( bp_ajax_querystring( 'members').'&exclude='.bp_exclude_users_but_coach().'&per_page=24' ) ) : ?>
<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 row kleo-isotope masonry">
<?php while ( bp_members() ) : bp_the_member(); ?>
<?php $user_info = get_userdata(bp_get_member_user_id()); ?>
<?php
$user_roles = $user_info->roles;
$user_role = array_shift($user_roles);// echo 'User ID: ' . $user_info->ID . "\n";
// echo bp_core_get_user_displayname( $user_info->ID ) ;
// echo $user_info->ID ;
?><li class="kleo-masonry-item type-<?php echo $user_role; ?>">
ID ; ?>' value='show/hide'> <!-- link che apre info's nascoste -->
<div class="member-inner-list animated animate-when-almost-visible bottom-to-top">
<div class="item-avatar rounded">
<!-- ">
--> <?php bp_member_avatar( 'type=full&height=150&width=150' ); ?>
<!-- -->
<?php //do_action('bp_member_online_status', bp_get_member_user_id()); ?>
</div>
<!-- "> -->
<div class="item">
<div class="item-title"><span class="loop-nome"><?php bp_member_name(); ?></span><span class="loop-cognome"><?php bp_member_profile_data( 'field=Cognome' ); ?></span></div><!-- <?php if ( bp_get_member_latest_update() ) : ?>
<span class="update"> <?php bp_member_latest_update(); ?></span>
<?php endif; ?>
-->
<?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><!--end member-inner-list-->
<!-- link che apre informazioni nascoste -->
<div id="contenuto-nascosto-<?php echo $user_info->ID ; ?>" class="hidden-infos">
<div class="nascondi-infos">
ID ; ?>' value='show/hide'>
<i class="icon-cancel"></i>
</div>
<div class="unhidden-infos unhidden-infos-first ">
<div class="item-avatar-small">
">
<?php bp_member_avatar( 'type=full&height=50&width=50' ); ?>
<?php do_action('bp_member_online_status', bp_get_member_user_id()); ?>
</div>
</div>
<div class="unhidden-infos">
<div class="item-title">
">
<span class="loop-nome"><?php bp_member_name(); ?></span>
">
<span class="loop-cognome"><?php bp_member_profile_data( 'field=Cognome' ); ?></span>
</div>
</div>
<div class="unhidden-infos">
<span class="nomeazienda-titolo custom-title">Azienda:</span>
<span class="nomeazienda custom-infos"><?php bp_member_profile_data( 'field=Azienda' ); ?></span>
</div>
<div class="unhidden-infos">
<span class="pos-lavorativa-title custom-title">Funzione:</span>
<span class="pos-lavorativa custom-infos"><?php bp_member_profile_data( 'field=Funzione' ); ?></span>
</div>
<div class="unhidden-infos">
<span class="settore-title custom-title">Settore:</span>
<span class="settore custom-infos"><?php bp_member_profile_data( 'field=Settore' ); ?></span>
</div>
<div class="unhidden-infos">
<span class="laurea-title custom-title">Laurea:</span>
<span class="laurea custom-infos"><?php bp_member_profile_data( 'field=Laurea' ); ?></span>
</div><div class="action">
<div class="generic-button" id="send-private-message">
" title="Clicca per profilo completo" class="send-message">Profilo Completo
</div><?php //do_action( 'bp_directory_members_actions' ); ?>
</div>
</div><script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#nascondi-mostra-<?php echo $user_info->ID ; ?>').live('click', function(event) {
jQuery('#contenuto-nascosto-<?php echo $user_info->ID ; ?>').toggle('show');
});
});
</script><?php endwhile; ?>
<?php do_action( 'bp_after_directory_members_list' ); ?>
<?php bp_member_hidden_fields(); ?>
<?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' ); ?>
</div><!-- #members-dir-list -->
<?php do_action( 'bp_directory_members_content' ); ?>
<?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ); ?>
<?php do_action( 'bp_after_directory_members_content' ); ?>
</form><!-- #members-directory-form -->
<?php do_action( 'bp_after_directory_members' ); ?>
</div><!-- #buddypress -->
</div>
</section><?php do_action( 'bp_after_directory_members_page' ); ?>
<?php get_template_part('page-parts/general-after-wrap'); ?>
<?php get_footer(); ?>
Hi,
Is there a way users that have hidden fields can be excluded from member search results?
It seems that if a user hides a field, their profile still shows in the search results when someone searches for whatever was hidden.For example, if a user #1 sets the visibility of an xprofile field “State” to “only me”. Then user #2 searches for the state that User #1 hid, then User #1’s profile should not show up on the search results. But it does. This kind of defeats the purpose of hiding a field so I’m hoping there is a way to exclude those results from searches. Any advice or insight is much appreciated!
I am using WP 3.9.2 and BP 2.0.2.
Thanks in advance!Topic: 'Change Avatar' Button
Hey guys,
How can I change the link of the ‘Change Avatar’ button so that it directs users to the settings page (where they can change their profile information).
I am now using the Xprofile fields image upload on registration for the avatars, so original avatar settings are useless.
Also, I’d like to change wording to ‘Change Photo” rather that ‘Avatar’
Otherwise if this is too tricky, I’ll just hide/remove the button.
Cheers guys.
PS is it just me or has the BP theme changed to purple?
Hi there,
I have a profile field which i hided from the edit profile page, so it will basically function as a view only field. The data for this field is getting from another table (t2) i created in MYSQL, that data in t2 is generated from data from other profile fields from wp_bp_xprofile_data. (Data from all the users is used, you can see it has some kind of calculator. So i tried to update the wp_bp_xprofile_data table with a procedure triggered after an update on the profile fields, unfortunately this doesn’t seem to work (http://buddypress.org/support/topic/start-procedure-when-profile-is-edited/). So now i am asking if it is possible to load the data from profile field 15 directly from t2, instead of first transfer the data from t2 to wp_bp_xprofile_data? the columns from t2 are user_id | value and from wp_bp_xprofile_data are afcourse id | field_id | user_id | value. Where is the best place to start? Thanks in advance 🙂
ps. i use BP 2.0.1. and WP 3.9.1.