Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'display user role on profile page'

Viewing 25 results - 1 through 25 (of 52 total)
  • Author
    Search Results
  • Kir 2012
    Participant

    Hi folks, I’ve tried searching for this but perhaps I can’t find the correct words to search.

    I’m looking to make it possible, in edit profile, to add a profile field that allows the user to select other users of a certain role type or member type, and then they will display at their profile page with an avatar.

    So if my users were all shops and products, with role or member type shop, and role or member type product, and I would like to allow shops to perhaps type into a multi-select box to pull up from the user database, the users in the role or member type products, and select them, and they would display on their page.
    It’s kind of similar to a ‘relationships’ plugin but a bit more basic I guess. Can anyone point me in the right direction?

    Kind regards

    ega3wy4aha
    Participant

    Hello.
    I thought I could represent the message tab on any page by inserting the code from messages.php as a PHP snippet on other pages. However, nothing is being displayed on the page, and it seems to be returning 0. I want to display the content of the message tab content on pages other than the logined user’s profile page. Are there any limitations, such as it only appearing on pages with ‘slug=members’? I would appreciate some advice on how to display the content of the message content to other page.

    messages.php
    >>>
    <nav class=”<?php bp_nouveau_single_item_subnav_classes(); ?>” id=”subnav” role=”navigation” aria-label=”<?php esc_attr_e( ‘Messages menu’, ‘buddypress’ ); ?>”>
    <ul class=”subnav”>
    <?php bp_get_template_part( ‘members/single/parts/item-subnav’ ); ?>

    </nav><!– .bp-navs –>
    <?php
    if ( ! in_array( bp_current_action(), array( ‘inbox’, ‘sentbox’, ‘starred’, ‘view’, ‘compose’, ‘notices’ ), true ) ) :
    bp_get_template_part( ‘members/single/plugins’ );
    else :
    bp_nouveau_messages_member_interface();
    endif;
    ?>

    #331041
    rammysons
    Participant

    Hello,

    It seems like you’re working on a multi-author website and you’re looking for a way to control access to user profiles. Specifically, you’ve implemented code to deny access to administrators’ profiles, and you’re interested in extending this functionality to subscribers as well.

    To achieve this, you can modify the code you provided to include conditions for subscribers. Here’s an example of how you might achieve this:

    php
    Copy code
    // deny access to admins and subscribers profiles. Users are redirected to the homepage
    function bpfr_hide_admins_and_subs_profile() {
    global $bp;

    // Get the current user’s role
    $current_user = wp_get_current_user();
    $user_roles = $current_user->roles;

    // Check if the user is an admin or a subscriber
    if (bp_is_profile && $bp->loggedin_user->id != 1 &&
    (in_array(‘administrator’, $user_roles) || in_array(‘subscriber’, $user_roles))) :
    wp_redirect(home_url());
    exit;
    endif;
    }
    add_action(‘wp’, ‘bpfr_hide_admins_and_subs_profile’, 1);
    This code snippet checks if the currently displayed user’s role is either “administrator” or “subscriber,” and if the conditions are met, it redirects the user to the homepage.

    Remember to replace ‘administrator’ and ‘subscriber’ with the actual role names used in your WordPress setup.

    Thank you for reaching out, and a special shoutout to “TWITCHFOLLOWERFORGE“. If you have any further questions or need additional assistance, feel free to ask!

    geepers
    Participant

    I expect this is likely a configuration issue with either our BuddyPress installation, a conflict from another plugin (though it works on staging version), or perhaps a lingering cacheing issue. But looking to find assistance resolving it and willing to consider hired help on this.

    No url to share, as it is a member’s only site (Intranet).

    
    ### wp-core ###
    
    version: 6.1.1
    site_language: en_CA
    user_language: en_CA
    timezone: America/Vancouver
    permalink: /%year%/%monthnum%/%day%/%postname%/
    https_status: true
    multisite: false
    user_registration: 0
    blog_public: 0
    default_comment_status: open
    environment_type: production
    user_count: 431
    dotorg_communication: true
    
    ### wp-paths-sizes ###
    
    wordpress_path: /home/susyah/public_html
    wordpress_size: 58.81 MB (61669230 bytes)
    uploads_path: /home/susyah/public_html/wp-content/uploads
    uploads_size: 62.25 MB (65272481 bytes)
    themes_path: /home/susyah/public_html/wp-content/themes
    themes_size: 23.15 MB (24279208 bytes)
    plugins_path: /home/susyah/public_html/wp-content/plugins
    plugins_size: 400.27 MB (419712905 bytes)
    database_size: 96.29 MB (100972517 bytes)
    total_size: 640.78 MB (671906341 bytes)
    
    ### wp-dropins (2) ###
    
    advanced-cache.php: true
    maintenance.php: true
    
    ### wp-active-theme ###
    
    name: Kleo Child (kleo-child)
    version: undefined
    author: SeventhQueen
    author_website: http://seventhqueen.com
    parent_theme: Kleo (kleo)
    theme_features: core-block-patterns, widgets-block-editor, editor-style, automatic-feed-links, post-formats, menus, post-thumbnails, html5, featured-content, title-tag, customize-selective-refresh-widgets, responsive-embeds, kleo-facebook-login, kleo-mega-menu, kleo-menu-items, bbpress, woocommerce, buddypress-use-nouveau, widgets
    theme_path: /home/susyah/public_html/wp-content/themes/kleo-child
    auto_update: Disabled
    
    ### wp-parent-theme ###
    
    name: Kleo (kleo)
    version: 5.1.2
    author: SeventhQueen
    author_website: https://themeforest.net/user/SeventhQueen
    theme_path: /home/susyah/public_html/wp-content/themes/kleo
    auto_update: Disabled
    
    ### wp-themes-inactive (1) ###
    
    Twenty Twenty-Three: version: 1.0, author: the WordPress team, Auto-updates disabled
    
    ### wp-plugins-active (71) ###
    
    Admin Menu Editor Pro: version: 2.18.1, author: Janis Elsts, Auto-updates disabled
    AS Admin Customizer: version: 1.0, author: Andolasoft, Auto-updates disabled
    bbPress: version: 2.6.9, author: The bbPress Contributors, Auto-updates disabled
    bbp style pack: version: 5.4.1, author: Robin Wilson, Auto-updates disabled
    Better Notifications for WP: version: 1.9.2, author: Made with Fuel, Auto-updates disabled
    Big File Uploads: version: 2.1.1, author: Infinite Uploads, Auto-updates disabled
    BP Profile Search: version: 5.4.8, author: Andrea Tarantini, Auto-updates disabled
    Brozzme Multiple Admin Emails: version: 1.4, author: Benoti, Auto-updates disabled
    BuddyPress: version: 11.1.0, author: The BuddyPress Community, Auto-updates disabled
    BuddyPress Notifications Widget: version: 1.3.2, author: BuddyDev, Auto-updates disabled
    Classic Editor: version: 1.6.2, author: WordPress Contributors, Auto-updates disabled
    Display Posts: version: 3.0.2, author: Bill Erickson, Auto-updates disabled
    Document Library Pro: version: 1.9.4, author: Barn2 Plugins, Auto-updates disabled
    Duplicate Page: version: 4.5.1, author: mndpsingh287, Auto-updates disabled
    Envato Market: version: 2.0.8, author: Envato, Auto-updates disabled
    Essential Grid: version: 3.0.16, author: ThemePunch, Auto-updates disabled
    FileBird: version: 5.1.4, author: Ninja Team, Auto-updates disabled
    Force Login: version: 5.6.3, author: Kevin Vess, Auto-updates disabled
    GeoDirectory: version: 2.2.25, author: AyeCode - WordPress Business Directory Plugins, Auto-updates disabled
    Image Upload for BBPress: version: 1.1.18, author: Aspen Grove Studios, Auto-updates disabled
    Jetpack: version: 11.9.1, author: Automattic, Auto-updates disabled
    Jetpack Boost: version: 1.7.0, author: Automattic - Jetpack Site Speed team, Auto-updates disabled
    K Elements: version: 5.1.2, author: SeventhQueen, Auto-updates disabled
    K Fonts: version: 1.1.0, author: SeventhQueen, Auto-updates disabled
    Like Button Rating ♥ LikeBtn: version: 2.6.47, author: LikeBtn, Auto-updates disabled
    List Categories: version: 0.4, author: Fernando Briano, Auto-updates disabled
    MainWP Child: version: 4.4.0.1, author: MainWP, Auto-updates disabled
    Manage Notification E-mails: version: 1.8.4, author: Virgial Berveling, Auto-updates disabled
    Media Sync: version: 1.2.9, author: Erol Živina, Auto-updates disabled
    Meta Box: version: 5.6.17, author: MetaBox.io, Auto-updates disabled
    MonsterInsights - Dimensions Addon: version: 2.0.6, author: MonsterInsights Team, Auto-updates disabled
    MonsterInsights - Forms Tracking Addon: version: 2.2.6, author: MonsterInsights Team, Auto-updates disabled
    MonsterInsights - Media Addon: version: 1.0.7, author: MonsterInsights Team, Auto-updates disabled
    MonsterInsights - Page Insights Addon: version: 1.5.2, author: MonsterInsights Team, Auto-updates disabled
    MonsterInsights Pro: version: 8.13.1, author: MonsterInsights, Auto-updates disabled
    Ninja Forms: version: 3.6.20, author: Saturday Drive, Auto-updates disabled
    Page-list: version: 5.3, author: webvitaly, Auto-updates disabled
    Page scroll to id: version: 1.7.7, author: malihu, Auto-updates disabled
    Pages with category and tag: version: 0.9.0, author: YAHMAN, Auto-updates disabled
    Popup Maker: version: 1.18.1, author: Popup Maker, Auto-updates disabled
    Post Slider For Visual Composer: version: 1.1, author: Nasir, Auto-updates disabled
    PublishPress Permissions: version: 3.8.5, author: PublishPress, Auto-updates disabled
    Redirection: version: 5.3.9, author: John Godley, Auto-updates disabled
    rtMedia for WordPress, BuddyPress and bbPress: version: 4.6.13, author: rtCamp, Auto-updates disabled
    SearchWP: version: 4.2.9, author: SearchWP, Auto-updates disabled
    SearchWP bbPress Integration: version: 1.3.1, author: SearchWP, Auto-updates disabled
    SearchWP Custom Results Order: version: 1.3.6, author: SearchWP, Auto-updates disabled
    SearchWP Live Ajax Search: version: 1.7.4, author: SearchWP, LLC, Auto-updates disabled
    SearchWP Shortcodes: version: 1.8.3, author: SearchWP, Auto-updates disabled
    Shortcode in Menus: version: 3.5.1, author: Gagan Deep Singh, Auto-updates disabled
    Site Plugin for susyah.csfs.org: author: (undefined), version: (undefined), Auto-updates disabled
    Social Articles: version: 2.9.5, author: Broobe, Auto-updates disabled
    SQ Sidebar Generator: version: 1.2.2, author: SeventhQueen, Auto-updates disabled
    TablePress: version: 2.0.4, author: Tobias Bäthge, Auto-updates disabled
    The Events Calendar: version: 6.0.10, author: The Events Calendar, Auto-updates disabled
    The Events Calendar: Community Events: version: 4.10.5, author: The Events Calendar, Auto-updates disabled
    The Events Calendar: Filter Bar: version: 5.4.3, author: The Events Calendar, Auto-updates disabled
    The Events Calendar PRO: version: 6.0.9.2, author: The Events Calendar, Auto-updates disabled
    User Role Editor: version: 4.63.3, author: Vladimir Garagulya, Auto-updates disabled
    User Switching: version: 1.7.0, author: John Blackbourn & contributors, Auto-updates disabled
    UsersWP: version: 1.2.3.11, author: AyeCode Ltd, Auto-updates disabled
    Wbcom Designs - BuddyPress Member Export Import: version: 1.5.0, author: Wbcom Designs, Auto-updates disabled
    When Last Login: version: 1.2.2, author: Yoohoo Plugins, Auto-updates disabled
    WordPress Toolbar Editor: version: 1.4.2, author: Janis Elsts, Auto-updates disabled
    WP Add Mime Types: version: 3.0.3, author: Kimiya Kitani, Auto-updates disabled
    WPBakery Page Builder: version: 6.10.0, author: Michael M - WPBakery.com, Auto-updates disabled
    wpDataTables - Tables & Table Charts: version: 2.1.53, author: TMS-Plugins, Auto-updates disabled
    WP Easy Updates: version: 1.1.20, author: AyeCode Ltd, Auto-updates disabled
    WPForms Lite: version: 1.8.0.2, author: WPForms, Auto-updates disabled
    WP Rocket: version: 3.12.5.3, author: WP Media, Auto-updates disabled
    WP SMS: version: 6.1.1, author: VeronaLabs, Auto-updates disabled
    
    ### wp-plugins-inactive (1) ###
    
    Password Protected Categories: version: 2.1.8, author: Barn2 Plugins, Auto-updates disabled
    
    ### wp-media ###
    
    image_editor: WP_Image_Editor_GD
    imagick_module_version: Not available
    imagemagick_version: Not available
    imagick_version: Not available
    file_uploads: File uploads is turned off
    post_max_size: 128M
    upload_max_filesize: 128M
    max_effective_size: 128 MB
    max_file_uploads: 20
    gd_version: 2.3.3
    gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
    ghostscript_version: 9.25
    
    ### wp-server ###
    
    server_architecture: Linux 3.10.0-962.3.2.lve1.5.42.el7.x86_64 x86_64
    httpd_software: Apache
    php_version: 7.4.33 64bit
    php_sapi: litespeed
    max_input_variables: 10000
    time_limit: 360
    memory_limit: 2048M
    max_input_time: 360
    upload_max_filesize: 128M
    php_post_max_size: 128M
    curl_version: 7.84.0 OpenSSL/1.1.1p
    suhosin: false
    imagick_availability: false
    pretty_permalinks: true
    htaccess_extra_rules: true
    
    ### wp-database ###
    
    extension: mysqli
    server_version: 5.7.41
    client_version: mysqlnd 7.4.33
    max_allowed_packet: 268435456
    max_connections: 250
    
    ### wp-constants ###
    
    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /home/susyah/public_html/wp-content
    WP_PLUGIN_DIR: /home/susyah/public_html/wp-content/plugins
    WP_MEMORY_LIMIT: 1024M
    WP_MAX_MEMORY_LIMIT: 2048M
    WP_DEBUG: false
    WP_DEBUG_DISPLAY: true
    WP_DEBUG_LOG: true
    SCRIPT_DEBUG: true
    WP_CACHE: true
    CONCATENATE_SCRIPTS: undefined
    COMPRESS_SCRIPTS: undefined
    COMPRESS_CSS: undefined
    WP_ENVIRONMENT_TYPE: Undefined
    DB_CHARSET: utf8
    DB_COLLATE: undefined
    
    ### wp-filesystem ###
    
    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable
    0: Writable
    
    ### jetpack ###
    
    site_id: 212215713
    ssl_cert: No
    time_diff: 2
    version_option: 11.9.1:1678828073
    old_version: 11.9:1678301680
    public: Public
    master_user: #1 ConceptDesign
    current_user: #1 ConceptDesign
    tokens_set: Blog User
    blog_token: P8&fk$QOWUjx^E0IRR3qiHSD*VPExwHg
    user_token: bvJ0#WWGEoaVgl@fq*KX$BqCk5YW7Si1
    version: 11.9.1
    jp_plugin_dir: /home/susyah/public_html/wp-content/plugins/jetpack/
    plan: free
    protect_header: {"trusted_header":"REMOTE_ADDR","segments":1,"reverse":false}
    full_sync: {"started":"Tue, 08 Nov 2022 19:26:26 +0000","finished":"Tue, 08 Nov 2022 19:31:21 +0000","progress":{"comments":{"total":"5","sent":5,"finished":true,"last_sent":"3"},"constants":{"finished":true},"functions":{"finished":true},"options":{"finished":true},"posts":{"total":"3647","sent":3647,"finished":true,"last_sent":"2"},"term_relationships":{"total":"3115","sent":3115,"finished":true,"last_sent":{"object_id":"1","term_taxonomy_id":"270"}},"terms":{"total":"398","sent":398,"finished":true,"last_sent":"1"},"themes":{"finished":true},"updates":{"finished":true},"users":{"total":"83","sent":83,"finished":true,"last_sent":"1"}},"config":{"comments":1,"constants":1,"functions":1,"options":1,"posts":1,"term_relationships":1,"terms":1,"themes":1,"updates":1,"users":1}}
    sync_size: undefined
    sync_lag: 0 seconds
    full_sync_size: undefined
    full_sync_lag: 0 seconds
    idc_urls: {"home":"https:\/\/susyah.csfs.org","siteurl":"https:\/\/susyah.csfs.org","WP_HOME":"","WP_SITEURL":""}
    idc_error_option: false
    idc_optin: true
    cxn_tests: All Pass.
    
    ### buddypress ###
    
    version: 11.1.0
    active_components: Community Members, Extended Profiles, Account Settings, Friend Connections, Private Messaging, Activity Streams, Notifications, User Groups
    template_pack: BuddyPress Nouveau 11.1.0
    ! hide-loggedout-adminbar: No
    ! bp-disable-account-deletion: No
    ! bp-disable-avatar-uploads: Yes
    ! bp-disable-cover-image-uploads: Yes
    bp-enable-members-invitations: No
    bp-enable-membership-requests: No
    ! bp-disable-profile-sync: Yes
    ! bp_restrict_group_creation: No
    ! bp-disable-group-avatar-uploads: Yes
    ! bp-disable-group-cover-image-uploads: Yes
    ! bp-disable-blogforum-comments: Yes
    _bp_enable_heartbeat_refresh: Yes
    
    ### redux-framework ###
    
    version: 4.3.12
    installation: in_plugin
    data directory: /home/susyah/public_html/wp-content/plugins/k-elements/lib/options/
    browser: 
    	Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/112.0
    	Browser: Firefox
    	Version: 112.0
    	Platform: Apple
    
    ### redux-instance-kleo_kleo_child ###
    
    opt_name: kleo_kleo_child
    global_variable: false
    dev_mode: false
    ajax_save: false
    page_slug: kleo_options
    page_permissions: manage_options
    menu_type: menu
    page_parent: themes.php
    compiler: false
    output: false
    output_tag: true
    templates_path: undefined
    extensions: 
    	Customizer: 4.0.0
    	Import Export: 4.0.0
    	Metaboxes: 4.0.0
    	Options Object: 4.0.0
    	Repeater: 4.3.7
    	Search: 3.4.5
    	Shortcodes: 4.3.5
    
    ### wpforms ###
    
    version: 1.8.0.2
    lite: Nov 14, 2022 @ 5:41pm
    upload_dir: Writable
    total_forms: undefined
    total_submissions: undefined
    
    ### bp-profile-search ###
    
    version: 5.4.8
    platform: BuddyPress 11.1.0
    theme: Kleo Child 
    index: /plugins/buddypress/bp-templates/bp-nouveau/buddypress/members/index.php
    loop: /plugins/buddypress/bp-templates/bp-nouveau/buddypress/members/members-loop.php
    template0: /themes/kleo/buddypress-nouveau/members/bps-form-legacy.php
    template1: /themes/kleo/buddypress-nouveau/members/bps-form-inline.php
    template2: /themes/kleo/buddypress-nouveau/members/bps-form-with-labels.php
    
    
    #320158
    pooriaarab
    Participant

    Hi Shane,

    Thanks for the quick reply and it actually worked! Thank you 🙂

    The sidebar shows for a specific user type now but it shows up in the wrong location. I tried the code in different places but it’s in the middle of the profile now and want it to be on the left side like the normal sidebar for user profile.

    The first part of the code is the simplified version you mentioned and the css styling. The rest is the remaining of the loop on that page. I suppose the code should go somewhere in there:

    </div><!-- #item-body -->
                <?php
                $member_type = bp_get_member_type( bp_displayed_user_id() );
           if ( $member_type == 'club' ) {?>
               <div id="secondary" class="widget-area sm-grid-1-1 no-padding-top" role="complementary">
                   <div class="bb-sticky-sidebar">
                       <?php dynamic_sidebar( 'club_sidebar'); ?>
                   </div>
               </div>
           <?php
            }
           
           ?>
       <?php
                    
                if ( ( !isset($bp_nouveau_appearance['user_nav_display']) || !$bp_nouveau_appearance['user_nav_display'] ) && is_active_sidebar('user_activity') && bp_is_user_activity() ) {
    
    				ob_start();
    				dynamic_sidebar('user_activity' );
    				$sidebar = ob_get_clean();  // get the contents of the buffer and turn it off.
    				if ( trim( $sidebar ) ) { ?>
    					<div id="user-activity" class="widget-area" role="complementary">
    						<div class="bb-sticky-sidebar">
    							<?php dynamic_sidebar( 'user_activity' ); ?>
    						</div>
    					</div><?php
    				}
    			}
              
    			if ( ( !isset($bp_nouveau_appearance['user_nav_display']) || !$bp_nouveau_appearance['user_nav_display'] ) && is_active_sidebar( 'profile' ) && !bp_is_user_settings() && !bp_is_user_messages() && !bp_is_user_notifications() && !bp_is_user_profile_edit() && !bp_is_user_change_avatar() && !bp_is_user_change_cover_image() && !bp_is_user_front() && $profile_cover_width == 'full' ) {
    
    			    ob_start();
    	            dynamic_sidebar('profile' );
    	            $sidebar = ob_get_clean();  // get the contents of the buffer and turn it off.
    				if ( trim( $sidebar ) ) { ?>
    					<div id="secondary" class="widget-area sm-grid-1-1 no-padding-top" role="complementary">
    						<div class="bb-sticky-sidebar">
    							<?php dynamic_sidebar( 'profile'); ?>
    						</div>
    					</div>
    					<?php
    				}
    			}
    			?>
    		</div>
    
    	</div><!-- // .bp-wrap -->
        	<?php if ( isset($bp_nouveau_appearance['user_nav_display']) && $bp_nouveau_appearance['user_nav_display'] &&  is_active_sidebar( 'profile' ) && !bp_is_user_settings() && !bp_is_user_messages() && !bp_is_user_notifications() && !bp_is_user_profile_edit() && !bp_is_user_change_avatar() && !bp_is_user_change_cover_image() && !bp_is_user_front() && $profile_cover_width != 'default' ) { ?>
    			</div>
    
    			<?php
    			ob_start();
    			dynamic_sidebar('profile' );
    			$sidebar = ob_get_clean();  // get the contents of the buffer and turn it off.
    			if ( trim( $sidebar ) ) {
    				?>
    				<div id="secondary" class="widget-area sm-grid-1-1 no-padding-top" role="complementary">
    					<div class="bb-sticky-sidebar">
    						<?php dynamic_sidebar( 'profile'); ?>
    					</div>
    				</div>
    				<?php
    			}
    			?>
    

    This is a screenshot of where the sidebar is appearing:

    Certificates is in the middle. How can it be in the place of cart?

    -How can I move the sidebar (Certificates) to where the left sidebar (Cart) is?

    -And how can I repeat this process for 3 different user types? 3 custom sidebars for 3 user types.

    -I was not sure what “ob_start()” and “bp_nouveau_appearance” were that appear in the beginning of the other sidebar code. How can I add them to the custom sidebar? Are they even necessary?

    Appreciate the support and the community around BuddyPress

    lynnapp
    Participant

    Hi,
    I have been using the below code, So when someone clicks on the profile of an association it will redirect to the products tab.
    All is well and I can use the other tabs to navigate around except when I click on the activities tab. It takes me to the products tab users cannot see the associations (role) activity stream.

    I removed this code and it worked fine so it is some where here. I have this in the child-theme/buddypress-nouveau/members/single/home.php page

    WP Version 5.7.2 PHP 7.4.12

    	$displayed_user =  new WP_User( bp_displayed_user_id() );
    
    	if  ( ( in_array( 'associations', $displayed_user->roles, true ))   &&  
    		(strpos($_SERVER['REQUEST_URI'], "my-products") == false)  &&
    		(strpos($_SERVER['REQUEST_URI'], "front") == false)  &&
    		(strpos($_SERVER['REQUEST_URI'], "profile") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "activity") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "friends") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "my-donations") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "notifications") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "messages") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "groups") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "location") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "invite-anyone") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "settings") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "w-my-account") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "store-manager") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "articles") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "media") == false) &&
    		(strpos($_SERVER['REQUEST_URI'], "item-header-content") == false) 
    		) 
     
    	{
     //is assoc and is not already redirected to products or other profile links
    	$currenturl =  $_SERVER['REQUEST_URI'];
        	$urlto = $currenturl."my-products";
    ?>
            <script>
    	window.location.replace("<?php echo($urlto); ?>");
    	</script>
    <?php	
    
      	} else {  //  just load
    ?>
    

    Thank you for helping with this

    varkoff
    Participant

    Project Details :
    – WordPress version : 5.5.3
    – BuddyPress version : 6.3.0
    – Website Link : https://microfarmap.dev-local.com/
    – Other plugins I use : Advanced Custom Fields PRO, Advanced Custom Fields: JSON, bbPress, bbPress – Moderation Tools, BuddyForm Premium, BuddyForm Advanced Custom Fields, BuddyForm Hook Fields, BuddoForm Members Premium, BuddyPress Username Changer, Custom Post Type UI, LoginPress, Paid Memberships Pro, Progress Map, List & Filter, User Role Editor …

    Hello,
    I have been updating a WordPress website that was made by others, I might lack some information.

    BuddyPress works like a charm except for a few features :

    – From the user profile, we can send friendship requests. As a new user, I sent a friendship request to my admin account. I did receive the notification on my admin profile, but the Friends tab says there is no friend requests pending. It just doesn’t display theme on my customized Understrap theme.

    – Switching to WordPress Twenty Twenty One theme does solve the issues. Switching to Understrap parent theme does switch the issue. There seems to be a problem with my custom theme.

    Under this custom there, there is a /buddypress/ directory with template pages and loops. The buddypress/members/single/friends/requests-loop.php file was not modified, it’s the default one. That’s where I checked first.

    I also checked in the plugin files directly, under plugins/buddypress/bp-friends/bp-friends-functions.php but did not find a clue.

    After some research, I found out that only users that have an active ‘ Paid Memberships Pro ‘ subscription can send friend requests, or atleast their friend requests appear.

    I also installed the ” BuddyPress Integration ” plugin from Paid Memberships Pro website, in which there is an option to allow non-registered users to send friend requests, but it did not solve the issue.

    Please if you need more details or even an access, do not mind asking.

    lilipilon
    Participant

    Hello,

    I have buddyforms and Buddypress and the extended profile.

    When I want to modify the profile on front-end :
    – if I am admin ==> I can modify all fields
    – If am the member ==> I have a blank page on modify

    So, I would like to know how to display the fields when the member connect please ?

    Is this link to user role ? To an another extension ?

    #316135
    haitianguy
    Participant

    Hi, i feel like im doing this properly but i never get the right result. i have a custom meta called “featured” in activity meta. For testing purposes the meta values are 1,2,3,4 my goal is to have an activity loop order activities by the meta value. i’ve checked the documentation and i came up with this.

    
    <?php
    
    get_header(); ?>
    
    <?php get_template_part('page-parts/general-title-section'); ?>
    
    <?php get_template_part('page-parts/general-before-wrap');
    
    $atts =  array(
    			'title'            => 'Latest Activity',// title of the section.
    			'pagination'       => 1,// show or not.
    			'load_more'        => 0,
    			'display_comments' => 'threaded',
    			'include'          => false,     // pass an activity_id or string of IDs comma-separated
    			'exclude'          => false,     // pass an activity_id or string of IDs comma-separated
    			'in'               => false,     // comma-separated list or array of activity IDs among which to search
    			'sort'             => 'DESC',    // sort DESC or ASC
    			'page'             => 1,         // which page to load
    			'per_page'         => 5,         // how many per page.
    			'max'              => false,     // max number to return.
    			'count_total'      => true,
    
    			// Scope - pre-built activity filters for a user (friends/groups/favorites/mentions).
    			'scope'            => false,
    
    			// Filtering
    			'user_id'          => false,    // user_id to filter on
    			'object'           => false,    // object to filter on e.g. groups, profile, status, friends
    			'action'           => false,    // action to filter on e.g. activity_update, new_forum_post, profile_updated
    			'primary_id'       => false,    // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
    			'secondary_id'     => false,    // secondary object ID to filter on e.g. a post_id.
    
    			// Searching
    			'search_terms'     => false,         // specify terms to search on.
    			'use_compat'       => bp_use_theme_compat_with_current_theme(),
    			'allow_posting'    => false,    // experimental, some of the themes may not support it.
    			'container_class'  => 'activity',// default container,
    			'hide_on_activity' => 1,// hide on user and group activity pages.
    			'for'              => '', // 'logged','displayed','author'.
    			'role'             => '', // use one or more role here(e.g administrator,editor etc).
                'for_group'        => '',// group slug.
    		);
    
    		$atts['meta_query']= array(
                                        array(
                                            'key' => 'featured',
                                            'value' => '0',
                                            'type' => 'numeric',
                                            'compare' => '!=',
                                            ),
                                            'meta_type' => 'numeric',
                                    'orderby' => 'meta_value_num',
                                    'meta_key' => 'featured',
                                    'order' => 'DESC'
                                    );
    
     ?>
    			<div id="buddypress">
    	
    
    		<?php do_action( 'bp_before_activity_loop' ); 
    		
    		
    		
    	
    
    if ( bp_has_activities( $atts ) ) : ?>
    
                <div class="<?php echo esc_attr( $atts['container_class'] ); ?> 
                <?php if ( ! $atts['display_comments'] ) : ?> hide-activity-comments<?php endif; ?>">
    
                    <ul id="activity-stream" class="activity-list item-list">
    
    					<?php while ( bp_activities() ) : bp_the_activity(); ?>
    						
    						<?php bp_get_template_part( 'buddypress/activity/entry' ); ?>
    					<?php endwhile; ?>
    
    					<?php if ( $atts['load_more'] && bp_activity_has_more_items() ) : ?>
                            <li class="load-more">
                                <a href="<?php bp_activity_load_more_link() ?>"><?php _e( 'Load More', 'buddypress' ); ?></a>
                            </li>
    					<?php endif; ?>
                    </ul>
    
    				<?php if ( $atts['pagination'] && ! $atts['load_more'] ) : ?>
                        <div class="pagination">
                            <div class="pag-count"><?php bp_activity_pagination_count(); ?></div>
                            <div class="pagination-links"><?php bp_activity_pagination_links(); ?></div>
                        </div>
    				<?php endif; ?>
    
                </div> 
    
            <?php else : ?>
                <div id="message" class="info">
                    <p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ); ?></p>
                </div>
            <?php endif; ?>
            
    ?>
    			</div>
    		
    
    		<?php do_action( 'bp_after_activity_loop' ); ?>
    
    <?php get_template_part('page-parts/general-after-wrap'); ?>
    
    <?php get_footer(); ?>
    

    everything here works except for the order. for some reason it always orders by activity ID. am i missing something here? Thanks in advance im going crazy with this.

    #305446
    webmister76
    Participant

    Hi guys 🙂
    My users have many custom fields in their profile.
    I’m trying to create a member page, with different loops, because I need to split them in different groups with different criteria.

    I’m using the my_custom_ids function, but I’m getting crazy…

    <?php if ( bp_has_members( my_custom_ids( 'Nome', 'testB' ) ) ) : ?>
    is working. The loop displays only one user, named “testB”

    <?php if ( bp_has_members( my_custom_ids( 'Nickname', 'web9' ) ) ) : ?>
    is working. The loop displays only one user, with the nickname “web9”

    <?php if ( bp_has_members( my_custom_ids( ‘Role’, ‘iscritto’ ) ) ) : ?>
    is NOT working. Also Administrators are displayed.
    This is not the only problem. It happens also with other fields, but I can’t understand why…

    #304842
    jennifersanchez
    Participant

    Hi Venutio! I modified this

    function devb_show_role_on_profile()
    {    global $wp_roles;
        $user_id = bp_displayed_user_id();
        $user = get_userdata($user_id);
        $roles = $user->roles;
        if (!$roles)        return;
        if (!isset($wp_roles))        $wp_roles = new WP_Roles();
        $named_roles = array();
        foreach ($roles as $role) {
            $named_roles [] = $wp_roles->role_names[$role];    }
        if ($named_roles)        return '<span class="user-role activity">' . join(', ', $named_roles) . '</span>';
    }
    add_filter('eo_title_content_html_below_title', 'devb_show_role_on_profile');

    This works and show it in the cover page of the profile.
    the problem is in the other pages like group or other page out of my profile (when i open it) this error appear in the cover page:
    NOTICE: TRYING TO GET PROPERTY ‘ROLES’ OF NON-OBJECT IN

    I tried with !null but it didnt work.
    Any suggest?
    Thanks!!

    #304471
    jennifersanchez
    Participant

    Hi!
    I saw this code for add the role in the profile of the User.
    I want show it in the cover page of his profile, can you help me?
    Thanks very much!

    add_action( 'bp_before_member_header_meta', 'devb_show_role_on_profile' );
     
    function devb_show_role_on_profile() {
        global $wp_roles;
     
        $user_id = bp_displayed_user_id();
     
        $user = get_userdata($user_id);
     
        $roles = $user->roles;
     
        if ( !$roles )
            return;
     
        if ( !isset( $wp_roles ) )
            $wp_roles = new WP_Roles();
     
        $named_roles = array();
     
        foreach ( $roles as $role ) {
     
            $named_roles [] = $wp_roles->role_names[$role];
        }
     
        if ( $named_roles )
            echo '<span class="user-role activity">' . join(', ', $named_roles) . '</span>';
    }
    #304097
    Venutius
    Moderator

    First of all, I got the filename wrong, it’s home.php you need to edit.

    This should be about the easiest bit of php you can get. But you will need to get ftp access to your site then create a buddypress/members/single directory in your themes/childtheme directory. Then take a copy of the source home.php file.

    Home.php creates the basic content for the profile page and if you open it up you will see a section as follows:

    		<?php if ( ! bp_nouveau_is_object_nav_in_sidebar() ) : ?>
    
    			<?php bp_get_template_part( 'members/single/parts/item-nav' ); ?>
    
    		<?php endif; ?>

    This is what calls the navigation, at the moment it’s the second item being loaded, you want it to be the first, so you just need to move it as follows:

    ?>
    		<?php if ( ! bp_nouveau_is_object_nav_in_sidebar() ) : ?>
    
    			<?php bp_get_template_part( 'members/single/parts/item-nav' ); ?>
    
    		<?php endif; ?>
    
    	<?php bp_nouveau_member_hook( 'before', 'home_content' ); ?>
    
    	<div id="item-header" role="complementary" data-bp-item-id="<?php echo esc_attr( bp_displayed_user_id() ); ?>" data-bp-item-component="members" class="users-header single-headers">
    
    		<?php bp_nouveau_member_header_template_part(); ?>
    
    	</div><!-- #item-header -->
    
    	<div class="bp-wrap">
    
    		<div id="item-body" class="item-body">
    
    			<?php bp_nouveau_member_template_part(); ?>
    
    		</div><!-- #item-body -->
    	</div><!-- // .bp-wrap -->
    
    	<?php bp_nouveau_member_hook( 'after', 'home_content' ); ?>
    

    Once you’ve done that use ftp to copy your updated file to themes/child-theme/buddypress/members/single/home.php and test. that should do it.

    #281268
    oliviergodefroit
    Participant

    Yes excuse me. I would like to dislpay only one specific role on profile page, to certify this user is certified by the moderator.

    here is the code:

    
    add_action( 'bp_before_member_header_meta', 'verifed_profile_check' );
    function verifed_profile_check( ) {
    		
      if ( $role = 'certified_subscribers' ) 
    	echo '<span class="pmpro_label"> CERTIFIED PROFILE </span>';
      }
    

    This code display ‘CERTIFIED PROFILE’ to all profiles but should only display it for users role ‘certified_subscribers’

    #279506
    entoen
    Participant

    Hi, thank you for your message. The link shows solutions for the role a visitor has when on a profile page. I would like to remove a tab on a profile when the profile owner (bp_displayed_user_id) doesn’t have a certain role.
    I think i am close but i could be miles off:(
    Here is where i am but it doesnt work

    //Disable bookings subnav by role of the displayed user id.
     
    function remove_bookingtab_by_displayed_role() {
    
        // Get Current User Data.
        $user = get_userdata( bp_displayed_user_id() );
    
        // Get Roles.
        $roles = (array) $user->roles;
    	
    // exclamationmark means not in array i hope
        if (!in_array( 'translator', $roles ) ) {
    		bp_core_remove_subnav_item( 'bookings','booking' );
    	}
    	
    }
    
    add_action( 'bp_setup_nav', 'function remove_bookingtab_by_displayed_role', 15 );
    
    entoen
    Participant

    hi, i am searching everywhere but i cannot find a way to hide a subnav element (‘Bookings’,’Calendar’) on a profile page when the displayed user does NOT have a certain role (Author).

    #276684
    israel4lincelot
    Participant

    Hi!

    I’m having some hard time with the following:

    I want to place my profile avatar (item-header-avatar) from the header to the left from my item-nav and eventually delete the header section.

    I’m editing the member-header.php file through my child-theme ( using Kleo-theme ). I thought it would be as easy as copying the div from item-header-avatar and pasting it after <ul class=”responsive-tabs”> but after loading the webpage it does not work.

    So my code looks like this:


    <?php

    /**
    * Fires after the display of a member's header.
    *
    * @since 1.2.0
    */
    do_action( 'bp_after_member_header' ); ?>

    <?php if ( sq_option( 'bp_nav_overlay', 0 ) == 1 ) : ?>
    <div id="item-nav">
    <div class="item-list-tabs no-ajax" id="object-nav" aria-label="<?php esc_attr_e( 'Member primary navigation', 'buddypress' ); ?>" role="navigation">
    <ul class="responsive-tabs">
    <div id="item-header-avatar" class="rounded">
    ">

    <?php bp_displayed_user_avatar( 'type=full' ); ?>


    <?php do_action('bp_member_online_status', bp_displayed_user_id()); ?>
    </div><!-- #item-header-avatar -->

    <?php bp_get_displayed_user_nav(); ?>

    <?php

    /**
    * Fires after the display of member options navigation.
    *
    * @since 1.2.4
    */
    do_action( 'bp_member_options_nav' ); ?>

    </div>
    </div>
    <!-- #item-nav -->
    <?php endif; ?>

    Thankyou!!

    #273176
    panosa1973
    Participant

    Is this a bug? I’ve been trying to figure this out for days. Why does my custom member directory revert to the default when I sort it??? I load it, it works fine and outputs the filtered users. I sort it by Alphabetical order (for example) and it gives me all users again. Does anyone have an idea why this is happening?

    [members-loop-2.php]

    <?php
    /**
     * BuddyPress - Members Loop
     *
     * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter()
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
    
    /**
     * Fires before the display of the members loop.
     *
     * @since 1.2.0
     */
    do_action( 'bp_before_members_loop' ); ?>
    
    <?php if ( bp_get_current_member_type() ) : ?>
    	<p class="current-member-type"><?php bp_current_member_type_message() ?></p>
    <?php endif; ?>
    
    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) .'&include=' .get_user_matches()  ) ) : ?>
    
    	<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
    
    	/**
    	 * Fires before the display of the members list.
    	 *
    	 * @since 1.1.0
    	 */
    	do_action( 'bp_before_directory_members_list' ); ?>
    
    	<ul id="members-list" class="item-list" aria-live="assertive" aria-relevant="all">
    
    	<?php while ( bp_members() ) : bp_the_member(); ?>
    		<li <?php bp_member_class(); ?>>
            
    			<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" data-livestamp="<?php bp_core_iso8601_date( bp_get_member_last_active( array( 'relative' => false ) ) ); ?>"><?php bp_member_last_active(); ?></span></div>
    
    				<?php
    
    				/**
    				 * Fires inside the display of a directory member item.
    				 *
    				 * @since 1.1.0
    				 */
    				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):
    				  *
    				  * $xGender =  bp_member_profile_data( 'field=Gender' );
    				  */
    				  
    				?>
    			</div>
    
    			<div class="action">
    
    				<?php
    
    				/**
    				 * Fires inside the members action HTML markup to display actions.
    				 *
    				 * @since 1.1.0
    				 */
    				do_action( 'bp_directory_members_actions' ); ?>
    
    			</div>
    
    			<div class="clear"></div>
    		</li>
    	<?php endwhile; ?>
    
    	</ul>
    
    	<?php
    
    	/**
    	 * Fires after the display of the members list.
    	 *
    	 * @since 1.1.0
    	 */
    	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
    
    /**
     * Fires after the display of the members loop.
     *
     * @since 1.2.0
     */
    do_action( 'bp_after_members_loop' );

    [index-2.php]
    ‘<?php
    /**
    * BuddyPress – Members
    *
    * @package BuddyPress
    * @subpackage bp-legacy
    */

    /**
    * Fires at the top of the members directory template file.
    *
    * @since 1.5.0
    */
    do_action( ‘bp_before_directory_members_page’ ); ?>

    <div id=”buddypress”>

    <?php

    /**
    * Fires before the display of the members.
    *
    * @since 1.1.0
    */
    do_action( ‘bp_before_directory_members’ ); ?>

    <?php

    /**
    * Fires before the display of the members content.
    *
    * @since 1.1.0
    */
    do_action( ‘bp_before_directory_members_content’ ); ?>

    <?php /* Backward compatibility for inline search form. Use template part instead. */ ?>
    <?php if ( has_filter( ‘bp_directory_members_search_form’ ) ) : ?>

    <div id=”members-dir-search” class=”dir-search” role=”search”>
    <?php bp_directory_members_search_form(); ?>
    </div><!– #members-dir-search –>

    <?php else: ?>

    <?php bp_get_template_part( ‘common/search/dir-search-form’ ); ?>

    <?php endif; ?>

    <?php
    /**
    * Fires before the display of the members list tabs.
    *
    * @since 1.8.0
    */
    do_action( ‘bp_before_directory_members_tabs’ ); ?>

    <form action=”” method=”post” id=”members-directory-form” class=”dir-form”>

    <div class=”item-list-tabs” id=”subnav” aria-label=”<?php esc_attr_e( ‘Members directory secondary navigation’, ‘buddypress’ ); ?>” role=”navigation”>

      <?php

      /**
      * Fires inside the members directory member sub-types.
      *
      * @since 1.5.0
      */
      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

      /**
      * Fires inside the members directory member order options.
      *
      * @since 1.2.0
      */
      do_action( ‘bp_members_directory_order_options’ ); ?>
      </select>

    </div>

    <h2 class=”bp-screen-reader-text”><?php
    /* translators: accessibility text */
    _e( ‘Members directory’, ‘buddypress’ );
    ?></h2>

    <div id=”members-dir-list” class=”members dir-list”>
    <?php bp_get_template_part( ‘members/members-loop-2’ ); ?>
    </div><!– #members-dir-list –>

    <?php

    /**
    * Fires and displays the members content.
    *
    * @since 1.1.0
    */
    do_action( ‘bp_directory_members_content’ ); ?>

    <?php wp_nonce_field( ‘directory_members’, ‘_wpnonce-member-filter’ ); ?>

    <?php

    /**
    * Fires after the display of the members content.
    *
    * @since 1.1.0
    */
    do_action( ‘bp_after_directory_members_content’ ); ?>

    </form><!– #members-directory-form –>

    <?php

    /**
    * Fires after the display of the members.
    *
    * @since 1.1.0
    */
    do_action( ‘bp_after_directory_members’ ); ?>

    </div><!– #buddypress –>

    <?php

    /**
    * Fires at the bottom of the members directory template file.
    *
    * @since 1.5.0
    */
    do_action( ‘bp_after_directory_members_page’ );

    kwavewd
    Participant

    I am using Buddypress and the BuddyBoss theme. I have 2 user types contributors and subscribers I made using BP Member Types and user profile fields. Everything is working except.

    When a contributor is logged in and goes to a tab say members/username/messages the subnav tabs show perfectly little grey boxes next to each other.

    But…

    when a subscriber goes to a tab say members/username/messages the css for the subnav tabs does not show as if it’s not pulling the css. I check and the file that controls this css section is buddyboss/css/buddypress-main.min.css and I checked this file is being used in the source code of this page. So for some reason the subscriber account is not pulling this style sheet even though it’s shown as included in the source. I tried to hard code the entire css into my page and it still didn’t show.

    the other thing I noticed was the code for the nav section was setup like this for contributor

    <div id=”buddypress”>
    <div id=”item-header” role=”complementary”>
    <div id=”item-nav”>
    <div id=”item-body”>

    but the subscriber one only shows like this

    <div id=”buddypress”>
    <div id=”item-nav”>
    <div id=”item-body”>

    why would the section <div id=”item-header” role=”complementary”> not be showing for subscribers? Could this be my problem

    Anyone have any ideas?

    amandafrench
    Participant

    Never mind! I’ve found a fabulous solution that has gotten me out of SQL query hell. Again, if anyone else is trying to sort a Members Directory, here’s what I did:

    1) Put it in a table, not a list (I had done this anyway, since I wanted a single-page directory that displayed xprofile fields horizontally) — make sure it has a <th> table header row;
    2) Install the plugin Table Sorter https://wordpress.org/plugins/table-sorter/ and add the class “tablesorter” to the table.

    Et voilà! I commented out the sort type dropdown in members/index.php starting with
    <div class="item-list-tabs" id="subnav" aria-label="<?php esc_attr_e( 'Members directory secondary navigation', 'buddypress' ); ?>" role="navigation">
    all the way through

    <?php
    /**
     * Fires inside the members directory member order options.
     *
     * @since 1.2.0
     */
    do_action( 'bp_members_directory_order_options' ); ?>
    </select>
    </li>
    </ul>
    </div>

    and I made sure that the default single page list showed all users alphabetically by default in members-loop.php

    <?php if ( bp_get_current_member_type() ) : ?>
    	<p class="current-member-type"><?php bp_current_member_type_message() ?></p>
    <?php endif; ?>
    
    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) . '&per_page=500' . '&exclude=1,2,3,4,6' . '&type=alphabetical') ) : ?>

    And then all I had to do was add that tablesorter class to the table as required by the tablesorter plugin, and I got a nice dynamic table with sortable columns, which can also be sorted by multiple criteria by holding down the Shift key on the second column. I set the initial sort order with parameters that select the column by number, as described at http://tablesorter.com/docs/example-option-sort-list.html and elsewhere.

    <table id="members-list" class="tablesorter {sortlist:[[4,0], [3,0], [2,0], [1,0], [0,0]]}" aria-live="assertive" aria-relevant="all">

    Yay.

    #270258
    keshabee
    Participant

    2)I wanted to ask if there was a function code that could print a word such as Website associate to display beside, users profile photo in the profile page when given a certain role.

    3) Finally wanted to ask if it was possible to have a function where a green light dot is placed at side of a user profile page when the user is logged in, an example is
    https://postimg.org/image/ym0tuaoy3/
    as presently its grey there because the user is offline.

    Thanks you

    #269412
    bcanr2d2
    Participant

    I am using WP Mail SMTP to get the mail to send without issues. But it seems to affect this particular email only, I am getting everything else as far as I am aware.

    Here are my current active plugins – There is quite a long list.
    I do use Autoptimize, so not sure if it’s affecting anything.
    One of note, is Social Login, which when logging directs to their site, and redirects back to my site to log the user in via their social network, this is where it falls over and does not send this one email. It manages to send other emails related to the login, but it now gives me an idea to look into the code that sends this social email sign up notification.

    (BuddyDev) BP Auto Login on Activation (1.0.3)
    Advanced Custom Fields (4.4.11)
    Allow Multiple Accounts (3.0.4)
    Autoptimize (2.2.2)
    BP Profile Message UX Free (1.5)
    BP xProfile Location (1.2)
    BP XProfile WordPress User Sync (0.6.4)
    BuddyDev Username Availability Checker (1.1.1)
    BuddyExtender (1.0.1)
    BuddyPress (2.7.4)
    BuddyPress Member Type Generator (1.0.3)
    BuddyPress Security Check (2.1.2)
    BuddyPress Simple Terms And Conditions (1.3)
    BuddyPress Xprofile Custom Fields Type (2.6.3)
    BuddyPress Xprofile Member Type Field (1.0.4)
    BuddyPress XProfile Validate with RegEx (0.1.2)
    Cherry Parallax Plugin (1.1.0)
    Cherry Plugin (1.2.8.1)
    Child Theme Configurator (2.1.2)
    Conditional Profile Fields for BuddyPress (1.1.9)
    Contact Form 7 (4.6)
    Contact Form 7 – Dynamic Text Extension (2.0.1)
    Contact Form 7 Conditional Fields (1.0)
    Contact Form 7 Get and Show Parameter from URL (0.9.7)
    Contact Form 7 Honeypot (1.10)
    Contact Form 7 Modules: Hidden Fields (2.0)
    Contact Form 7 Shortcode Enabler (1.1)
    Custom Hooks (1.0)
    Custom Post Template By Templatic (1.0)
    Custom Post Type UI (1.4.3)
    Disable Comments (1.6)
    Display Posts Shortcode (2.7.0)
    FacetWP (2.7.4)
    FacetWP – Map (1.0.5)
    Flamingo (1.5)
    GeoIP Detection (2.7.0)
    GEO my WP (2.7)
    Google Analytics Dashboard for WP (4.9.6.2)
    List Plugins (1.4.4)
    Meta Slider (3.4)
    Optimize Database after Deleting Revisions (4.2.1)
    Page-list (5.1)
    PHP Compatibility Checker (1.4.0)
    Popup Maker (1.4.20)
    Shortcodes in Menus (3.2)
    Social Login (5.2)
    Stream (3.2.0)
    String Locator (2.2.0)
    Sucuri Security – Auditing, Malware Scanner and Hardening (1.8.3)
    SuitePlugins – Advanced XProfile Fields for BuddyPress (1.0.3)
    Theme Check (20160523.1)
    Visual Builder for Contact Form 7 (2.0)
    WPFront User Role Editor (2.13)
    WP Mail SMTP (0.11.1)
    WP Private Content Plus (1.13.1)
    WP Smush (2.6.1)
    Yoast SEO (4.3)

    #264536
    adamt89
    Participant

    On some forums and social networks, you will see a badge or for example Admin next to the username of the member of the network that is an admin, or MOD next to their name if they are a moderator.

    Do you know how we can display roles in WordPress next to usernames, use a badge or image, or know of a plugin that can accomplish custom roles or tags for staff members within buddy press?

    #261682
    sweeneytodd94
    Participant

    (Latest version of WP/BP; non-bundled custom theme, using child theme.)

    When adding a custom index & members-loop to /members/ in my child-theme, to make some adjustments to the members directory layout, individual profile pages break completely, I think defaulting to the pages.php but loaded without any content.

    childtheme/members/members-loop.php

    <?php 
    //global $members_template;
    //$reset_members_template = $members_template;
    
    do_action( 'bp_before_members_loop' ); ?>
    
    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) . '&per_page=21&type=alphabetical' ) ) : ?>
    
    	<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('type=full&width=80&height=80'); ?></a>
    			</div>
    			<div class="item">
    				<div class="item-title"><a href="<?php bp_member_permalink(); ?>"><?php bp_member_name(); ?></a></div>
    				<div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
    				<?php do_action( 'bp_directory_members_item' ); ?>
    			</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; 
    
    //$members_template = $reset_members_template;
    ?>
    
    <?php do_action( 'bp_after_members_loop' ); ?>

    childtheme/members/index.php

    <?php
    
    /**
     * BuddyPress - Members Directory
     *
     * @package BuddyPress
     * @subpackage bp-default - SSSMG
     */
    
    get_header( 'buddypress' ); ?>
    
    	<?php do_action( 'bp_before_directory_members_page' ); ?>
    
    <div class="container">
    <div class="row">
    <div id="primary" class="col-md-10">
    
    	<div id="content" role="main" class="<?php do_action( 'content_class' ); ?>">
    		<div class="padder">
    		<div class="buddypress">
    
    		<?php do_action( 'bp_before_directory_members' ); ?>
    		
    	<form action="" method="post" id="members-directory-form" class="dir-form">
    	
    	<?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' ); ?>
    
    		<div class="item-list-tabs" role="navigation">
    			<ul>
    				<li class="selected" id="members-all"><a href="<?php bp_members_directory_permalink(); ?>"><?php printf( __( 'All Members %s', 'buddypress' ), '<span>' . bp_core_get_total_member_count() . '</span>' ); ?></a></li>
    
    				<?php if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
    					<li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/'; ?>"><?php printf( __( 'My Friends %s', 'buddypress' ), '<span>' . bp_get_total_friend_count( bp_loggedin_user_id() ) . '</span>' ); ?></a></li>
    				<?php endif; ?>
    
    				<?php do_action( 'bp_members_directory_member_types' ); ?>
    
    			</ul>
    		</div><!-- .item-list-tabs -->
    
    		<div id="members-dir-list" class="members dir-list">
    			<?php //bp_get_template_part( 'members/members-loop' );
    				locate_template( array( 'members/members-loop.php' ), true );
    			?>
    		</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><!-- .padder -->
    	</div><!-- #content -->
    
    </div><!-- primary -->
    <?php get_sidebar( 'buddypress' ); ?>
    </div><!-- row -->
    </div><!-- container -->
    
    	<?php do_action( 'bp_after_directory_members_page' ); ?>
    
    <?php get_footer( 'buddypress' ); ?>

    bp-custom.php

    <?php
    // bp-custom.php - BP hacks and mods will go here
    /**
     * Include bbPress 'topic' custom post type in WordPress' search results */
     
    function ntwb_bbp_topic_cpt_search( $topic_search ) {
    	$topic_search['exclude_from_search'] = false;
    	return $topic_search;
    }
    add_filter( 'bbp_register_topic_post_type', 'ntwb_bbp_topic_cpt_search' );
    
    /**
     * Include bbPress 'forum' custom post type in WordPress' search results */
    
    function ntwb_bbp_forum_cpt_search( $forum_search ) {
    	$forum_search['exclude_from_search'] = false;
    	return $forum_search;
    }
    add_filter( 'bbp_register_forum_post_type', 'ntwb_bbp_forum_cpt_search' );
    
    /**
     * Include bbPress 'reply' custom post type in WordPress' search results  */
    
    function ntwb_bbp_reply_cpt_search( $reply_search ) {
    	$reply_search['exclude_from_search'] = false;
    	return $reply_search;
    }
    add_filter( 'bbp_register_reply_post_type', 'ntwb_bbp_reply_cpt_search' );
    
    /**
     * Ensure that multiselect boxes have trailing brackets in their 'id' and 'name' attributes.
     *
     * These brackets are required for an array of values to be sent in the POST
     * request. Previously, bp_get_the_profile_field_input_name() contained the
     * necessary logic, but since BP 2.0 that logic has been moved into
     * BP_XProfile_Field_Type_Multiselectbox. Since bp-default does not use the
     * BP_XProfile_Field_Type classes to build its markup, it did not inherit
     * the brackets from their new location. Thus this workaround.
     */
    function bp_dtheme_add_brackets_to_multiselectbox_attributes( $name ) {
    	global $field;
    
    	if ( 'multiselectbox' === $field->type ) {
    		$name .= '[]';
    	}
    
    	return $name;
    }
    add_filter( 'bp_get_the_profile_field_input_name', 'bp_dtheme_add_brackets_to_multiselectbox_attributes' );
    
    // add the custom column headers to BP manage signups
    function philopress_modify_user_columns($column_headers) {
            $column_headers['extended'] = 'Extended';
            return $column_headers;
    }
    add_action('manage_users_page_bp-signups_columns','philopress_modify_user_columns');
    
    // dump all the pending user's meta data in the custom column
    function philopress_signup_custom_column( $str, $column_name, $signup_object ) {
    	if ( $column_name == 'extended' ) 
                 return print_r( $signup_object->meta, true );
            return $str;
    }
    add_filter( 'bp_members_signup_custom_column', 'philopress_signup_custom_column', 1, 3 );
    
    //* Redirect WordPress Logout to Home Page
    add_action('wp_logout',create_function('','wp_redirect(home_url());exit();'));
    
    //add @mentions to bbpress forum
    function custom_bbpress_maybe_load_mentions_scripts( $retval = false ) {
    	if ( function_exists( 'bbpress' ) && is_bbpress() ) {
    		$retval = true;
    	}
    	return $retval;
    }
    add_filter( 'bp_activity_maybe_load_mentions_scripts', 'custom_bbpress_maybe_load_mentions_scripts' );
    
    function bphelp_dpioml(){
    	$bphelp_my_profile_field_1='Profession';
    	$bphelp_my_profile_field_2='Primary Institution';
           if( is_user_logged_in() && bp_is_members_component() ) { ?>
            <div class="bph_xprofile_fields">
                              <?php if(bphelp_my_profile_field_1<>"") echo bp_member_profile_data( 'field='.$bphelp_my_profile_field_1 );  ?><br />
    						  <?php if(bphelp_my_profile_field_2<>"") echo bp_member_profile_data( 'field='.$bphelp_my_profile_field_2 );  ?><br />
                    </div><?php
           }
    }
    add_action('bp_directory_members_item', 'bphelp_dpioml');
    
    ?>

    I’ve tried all sorts of different combinations but whatever I do, the only way to get both the profile pages and the members directory to display is to remove the index and members-loop customizations. Then everything works fine, but without the adjustments to the members directory that I want (removing recent updates, for instance). Any pointers would be brilliant!

Viewing 25 results - 1 through 25 (of 52 total)
Skip to toolbar