Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'buddypress'

Viewing 25 results - 8,926 through 8,950 (of 69,133 total)
  • Author
    Search Results
  • #260984
    danbp
    Participant

    I don’t understandd this paranoรฏd question: So this is another case where they decided to leave out any option.

    – Who are “They” ?
    – What are the other case ?
    – Which options are leaved out ?

    Really mysterious, unless the truth is elswhere ? May be in the Twilight Zone ?

    You have the option to disable the Toolbar under Settings > BuddyPress > Options.
    You have the possibility to use BP’s login widget under Apparence > Widgets

    #260982
    danbp
    Participant

    Hi @vickievik,

    the right question here would be how to make my theme compatible with buddypress.

    The thing to understand is that BP use dynamic content for its page and that these page are NOT ordinaty WP pages.
    For each content, BP fires a so called template-part.
    Lets take as example a profile page

    The slug is /members/ which exist as “page” on wp’s page list. This wp page has no content and also no model or template. It’s just a “slug” in the wp ecosystem.

    When you’re on a profile you have the page(aka /members/) but also many template parts, depending what you’re doing on that profile. Aside the common parts header – content – footer, you’ll find also personnal activity, frineds, groups, mentions, notifications, messages and not the worst, profile settings. All this on the same “page”.

    Most theme mistakes are at this point. People try to design the page, instead to work the template parts.

    When you design a theme, you usually design something for a page, independantly from any plugin. This structure is used by any Twenty Theme and you can follow them as model, because these themes are bullet proof and systematically used by all wp devs when building (in our case) BuddyPress

    BP can be used with almost any existing theme, so far this theme is respecting WP’s coding standarts.

    If you have brocken elements, and specially thoose using JS, it could be due to missing ID or class or even more simple, some missing instructions/conditionnals in your theme.

    BP’s template parts are designed to fit with a majority of themes. The best to do, at least while creating your first theme, is to use BP “as is” and build your theme around thoose existing parts and not to remove/modifying BP arts to fit your creation.

    #260972
    Earl_D
    Participant

    This might be a good place to start if you looked at it already?

    BuddyPress Theme Development

    #260970
    davehakkens
    Participant

    OK, we got it to work in a different way. Special thanks to @coffeywebdev for the help.
    For those interested:

    This snippet is used in the functions.php to get the locations from the profile fields and show the flag image.

    function dh_get_flag_by_location($country){
      if($country <> '' && !empty($country)){
      $country_filename = get_stylesheet_directory_uri() . '/img/flags/' . sanitize_file_name($country) . '.png';
      $country_path = get_stylesheet_directory() . '/img/flags/' . sanitize_file_name($country). '.png';    
         if(file_exists($country_path)){
           $html = '<img src="' . $country_filename . '"/>';
         } else {
           $html = $country;
           echo '<!--' . get_stylesheet_directory_uri() . '/img/flags/' . sanitize_file_name($country) . '-->';
        }
      echo $html;
      }
    }

    Then we needed to change 2 templates to show this flag image in
    the Bbpress forum replies and on the buddypress members page. So we added the code necessary to show the flag
    bbpress/loop-single-reply.php
    <div id="country" style="float:left;margin-right:.5em;"> <?php $user = get_userdata( bbp_get_reply_author_id() ); $country = xprofile_get_field_data( 42, $user->ID ); dh_get_flag_by_location($country); ?></div>

    buddypress/members/members-loop.php
    <div class="member-location"> <?php $country = bp_get_member_profile_data('field=Location'); dh_get_flag_by_location($country); ?></div>

    #260968
    danbp
    Participant

    @masoud1111,

    You’re talking about 2 different things: profile and groups. Let me explain you a little…

    On the buddy nav bar, navigation looks similar but doesn’t work the same way on profile and on group page. While profile navigation use nav and sub-nav, the group navigation use only sub-nav.

    Also, as documented on codex, define('BP_DEFAULT_COMPONENT', '...' ); is a constant related to a component, not a sub-nav tab. It let you define the default landing component, but not the one or other sub-nav tab. For example on profiles, the component Activity has 4 sub-nav attached to it: personnal, mentions, favorites, friends, groups

    To get one of them, you need to specify a new default tab, not another component. ๐Ÿ™‚

    Buddybar main nav items on profile page
    Activity Profile Friends Groups Forums (if you use group forums)

    Default tab is Activity/personnal. To change it for “Friends” you use the constant:
    define('BP_DEFAULT_COMPONENT', 'friends' );

    To change the default landing tab from (Component/sub-tab). For example Activity/personnal to Activity/mentions, you define a new nav default tab with a function like this one:

    function bpex_set_member_default_nav() {
     
        bp_core_new_nav_default (
            array(
                'parent_slug'       => buddypress()->activity->id,
    	   // other "activity" sub_nav slugs : personal favorites friends groups
                'subnav_slug'       => 'mentions',
                'screen_function'   => 'bp_activity_screen_mentions'
            )
        );
    }
    add_action( 'bp_setup_nav', 'bpex_set_member_default_nav', 20 );

    For groups, it’s a similar technique, but a different syntax. The following example is a bit sophisticated, as it let you change the landing tab differently for each defined group.
    Depending each group activity or target, you can choose a different default tab.
    In this example, the kill bill group has Forum as landing tab, while Leon’s group use the group member directory.

    function bpex_custom_group_default_tab( $default_tab ){
    	/**
    	 * class_exists() is recommanded to avoid problems during updates 
    	 * or when Groups Component is deactivated
    	 */
    	if ( class_exists( 'BP_Group_Extension' ) ) : 
    	
    	$group = groups_get_current_group();//get the current group
    	
    	if( empty( $group ) ) {
    	 return $default_tab;
    	}
    		switch($group->slug){
    			
    			case 'kill-bill': // group name (use slug format)
    			$default_tab='forum';
    			break;
    			
    			case 'leon':
    			$default_tab='members';
    			break;
    			
    			default:		
    			$default_tab='home';// the default landing tab
    			break;
    			
    		}
    	
    	return $default_tab;
    	
    	endif; // end if ( class_exists( 'BP_Group_Extension' ) )
    }
    add_filter('bp_groups_default_extension','bpex_custom_group_default_tab');

    All this tested and working with BP 2.7.2 / Twenty Sixteen

    #260956
    danbp
    Participant

    Hi,

    no of course ! Read 2.7.2 changelog.

    If you use a child theme or a third party theme, ensure it is updated for BP 2.7+: verify the templates.

    Template Updates 2.7

    #260953
    danbp
    Participant

    Hi,

    all is explained in the doc !

    Changing Internal Configuration Settings

    Navigation API

    shanebp
    Moderator

    Try the solution near the bottom of this codex page:
    https://codex.buddypress.org/emails/#filter-from-address-and-name

    add_action( 'bp_email', function( $email_type, $email_obj ) {
    $email_obj->set_from( "custom@example.com", "Custom Website Name" );
    }, 10, 2 );
    #260930

    In reply to: Hiding register link

    Venutius
    Moderator

    I think you are looking for BP Registration options – that provides you with new member moderation.
    https://wordpress.org/plugins/bp-registration-options/

    If you are new to BuddyPress I’m developing a site aimed at helping people get the most out of BuddyPress http://buddyuser.com

    #260924
    modemlooper
    Moderator

    You can find this information in the codex https://codex.buddypress.org/themes/buddypress-cover-images/

    #260922
    modemlooper
    Moderator

    define( 'BP_GROUPS_DEFAULT_EXTENSION', 'members' );

    change members to the slug of the extension and then that tab will load when you click a link to a group.

    more configurations here https://codex.buddypress.org/getting-started/customizing/changing-internal-configuration-settings/

    #260921
    modemlooper
    Moderator
    #260919
    modemlooper
    Moderator

    Under Settings in the admin click BuddyPress. Then the tab Pages and re associate the page to the component.

    #260914
    talvasconcelos
    Participant

    Hi, thread_id is from the buddypress. When a message is going for save bp checks if there’s a thread id, if not it’s because that is the first message.

    Anyway, i got it to kind of work. Used some info from the other thread. I use the add_filter() to check if the user has a membership and if not, take out the button. Also i was forgeting to include the file with the Paid membership function. Here’s the code:

    add_filter( 'bp_get_send_message_button', function( $array ) {
        if ( pmpro_hasMembershipLevel('Premium') ) {
            return $array;
        } else {
            return '';
        }
    } );

    If you have any recommendations for this i’ll be glad to follow.

    #260905
    Venutius
    Moderator

    This has got to be plugin conflict or theme related issue since avatar and cover image uploads work when BuddyPress is running standalone. I’d try deactivating all other plugins and if that does not work then switching to the 2016 theme to check

    #260892
    Masoud
    Participant

    hi.
    i am using latest versions of both wordpress and buddypress.and working on a food website.
    in this website , i wanted to allow only authors to post activity updates .
    (because it will be much easier for users to track their favorite chef recipes in the activity page.)
    so i’ve hide the ” personal ” submenu of activity tab : Activity > Personal (where people can post updates)
    with the help of following code in bp-custom.php :

    function bpfr_hide_tabs() {
    global $bp;
    if ( bp_is_user() && ( !current_user_can(author) || !current_user_can(administrator) ) ) {		
     bp_core_remove_subnav_item($bp->activity->slug, 'just-me');	}
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );

    but now when i go to my profile (as a subscriber)
    i will see a 404 page.
    i’ve searched a lot and i noticed that , now that i’ve removed the default activity stream tab , i have to point it to another tab. so when a user profile is loading (or if a user clicks on activity tab),
    instead of default activity> personal . it load activity > mentions / OR / favorites / OR / … (some other submenu than personal )

    so my question is:

    how can i change the default activity stream tab
    from
    Activity > Personal
    To
    Activity > Mentions – Or to – Activity > Favorites – …

    thanks a lot for any help.

    #260888
    Venutius
    Moderator

    You could try something like this, only it’s not been updated in a while, not tried it myself https://wordpress.org/plugins/buddypress-login-redirect/

    #260884
    danbp
    Participant

    Well, you now have to control your child theme and custom functions (if any).
    Seems that changes made in BP 2.7, 2.7.1 and 2.7.2 won’t apply to your case.

    Read also here.

    And if it doesn’t help, go to kleo support and ask there.

    #260862
    worsin
    Participant

    Oh and its important to note that none of the tools for buddypress work to fix this issue.

    #260856
    claudiosinopoli
    Participant

    Dear danbp,
    first of all tank you for killing the discussion with your silence.
    Almost two months ago I asked you for help, without success.

    After a while I realized that I can perform a supposedly so simple task myself.
    I’m writing now to inform other people that want the “create a group” button in the single member’s “groups” page or somewhere else in a buddypress template page.

    After reading some buddypress documentation I replicated in my child theme the buddypress templates and css folders structure.

    Looking into the group-related php files I noticed that the function for the button “create a group” is called bp_groups_directory_group_filter.

    The “groups” page for the single member is generate by the file located in the following folder in my child theme: my_child_theme/buddypress/members/single/groups.php

    It is starting with the following code

    <?php
    /**
     * BuddyPress - Users Groups
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
    
    ?>
    <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
    	<ul>
    		<?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?>
    		
    		<?php if ( !bp_is_current_action( 'invites' ) ) : ?>
    
    			<li id="groups-order-select" class="last filter">
    
    				<label for="groups-order-by"><?php _e( 'Order by:', 'buddypress' ); ?></label>
    				<select id="groups-order-by">
    					<option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>

    It’s enough to add the line
    <?php do_action( 'bp_groups_directory_group_filter' ); ?>
    after line 12
    <?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?>
    and you do the trick.

    Now in the single member’s “groups” page there will be the following buttons:
    Memberships | Invitations | Create a group

    In the same way you can add this button to any other template page, taking care that the function it’s placed in the right position in the code.

    Thank you again danbp: your silence was not very professional but perhaps stimulating in order to take initiative, learn something and solve a problem by myself.

    #260855
    maccast
    Participant

    Just so this is complete. Here’s the code updated for BuddyPress 2.6 or later.

    
    function add_settings_subnav_tab() {
    
        //reorder messages tabs
        buddypress()->members->nav->edit_nav( array(
            'position' => 10,
        ), 'compose', 'messages' );
    
        buddypress()->members->nav->edit_nav( array(
            'position' => 11,
        ), 'inbox', 'messages' );
    
        buddypress()->members->nav->edit_nav( array(
            'position' => 12,
        ), 'sentbox', 'messages' );
    
         buddypress()->members->nav->edit_nav( array(
            'position' => 20,
        ), 'starred', 'messages' );
    
    }
     
    add_action( 'bp_setup_nav', 'add_settings_subnav_tab', 100 );
    
    #260832
    danbp
    Participant

    Hi @maccast,

    thank you for the tutorial and sharing your trick, but there is a little problem !

    bp_options_nav is deprecated since 2.6 – you can verify by enabling wp-debug in wp-config.php or by reading the doc.

    Get the right navigation solutions available for BP 2.6+ here:

    Navigation API

    #260830

    In reply to: Emailing all users

    Venutius
    Moderator
    #260824

    Hey @danbp

    I just thought I’d jump in here real quick, as I think this will be beneficial to everyone in the thread including @Tranny.

    And even if you would be a genius coder creator of an extra super original spam shield, you could be sure to became target #1 of all spammers, because in this case, you would represent the absolute challenger of all code breakers !

    We are that “genius coder creator of an extra super original spam shield” that you speak of. ๐Ÿ™‚

    There is no miraculous plugin or trick to stop them.

    Ahh, but there is.

    It’s real, and it’s even called WP-SpamShield. LOL…you can’t make this stuff up. ๐Ÿ™‚

    Check it out on WPorg. It’s been out for about two and a half years, and is forked from another plugin we developed almost a decade ago. It works perfectly and automatically on BuddyPress, bbPress, and pretty much everything else. You can also feel free to check out the plugin documentation here.

    …And for the record, we definitely are a huge target of spammers. ๐Ÿ™‚

    dealing with spammers is a long run work, to not say a never ending work.

    True story!

    – Scott

    #260816
    MatrixMedia
    Participant

    to exclude some categories I have tried this:

    function exclude_category_slugs_from_activity_stream( $new_status, $old_status, $post ) {
    
    	// Only record published posts
    	if ( 'publish' !== $new_status ) {
    		return;
    	}
    
    	// Don't record edits (publish -> publish)
    	if ( 'publish' === $old_status ) {
    		return;
    	}
    
    	// add in any categories to exclue from activity stream, separated by commas, no spaces
    	$category_slugs_to_exclude = "news,new,News,service,Service";
    
    	// create the array that contains the category ids to exclude
    	$ids_to_exclude = array();
    	// create new array by splitting category slugs by comma
    	$category_slug_array = split( ",", $category_slugs_to_exclude );
    	// iterate over category_slug_array
    	foreach ( $category_slug_array as $category ) {
    		// get the category id based on the slug
    		$idObj = get_category_by_slug( $category );
    		$id = $idObj->term_id;
    		// push the category id onto the exclude array
    		array_push ( $ids_to_exclude, $id );
    	}
    
    	// get the post's categories
    	$categories = get_the_category( $post->ID );
    	$in = false;
    
    	// check if the post has any categories, do nothing if not
    	if( count($categories) > 0 ) {
    		// iterate over categories
    		foreach ( $categories as $category ) {
    			// check if any excluded category exists within post's categories
    			if( in_array( $category->cat_ID, $ids_to_exclude) )
    				$in = true;
    		}
    	}
    
    	// Don't record posts from filtered categories
    	if( $in )
    		return;
    
    	return bp_activity_post_type_publish( $post->ID, $post );
    }
    
    add_action( 'bp_init', 'bp_blogs_catch_filtered_published_post' );
    
    function bp_blogs_catch_filtered_published_post() {
    	if ( bp_is_active( 'blogs' ) ) {
    		remove_action( 'transition_post_status', 'bp_activity_catch_transition_post_type_status', 10 );
    		add_action( 'transition_post_status', 'exclude_category_slugs_from_activity_stream', 10, 3 );
    	}
    }

    I found here: https://premium.wpmudev.org/forums/topic/exclude-auto-blog-posts-from-buddypress-activity-stream

    of course I changed the deprecated functions:
    bp_blogs_record_post -> bp_activity_post_type_publish
    bp_blogs_catch_transition_post_status -> bp_activity_catch_transition_post_type_status

    but nothing … not working … HELP!!!

Viewing 25 results - 8,926 through 8,950 (of 69,133 total)
Skip to toolbar