Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'buddypress'

Viewing 25 results - 9,626 through 9,650 (of 68,948 total)
  • Author
    Search Results
  • #256492
    danbp
    Participant
    #256490
    danbp
    Participant

    The Home tab is the default one. If you remove that tab, BP has no way to know where to output the other group tabs content. If you remove Home(aka activity) you should define another landing tab.

    But when you want to modify groups, you shouldn’t define ‘profile’, but ‘groups’. (read what you wrote!)
    For the profile landing tab, see this codex page.

    For groups, you can try this snippet. This let you define a different landing tab for each of your groups (not profile, ok ?). 😉

    function bpfr_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 'groupe-2014':
    		$default_tab='members';
    		break;
    		
    		default:		
    		$default_tab='home';// the original default landing tab
    		break;
    		
    	}
    	
    	return $default_tab;
    	
    	endif; // end if ( class_exists( 'BP_Group_Extension' ) )
    }
    add_filter('bp_groups_default_extension','bpfr_custom_group_default_tab');
    #256489
    danbp
    Participant

    Global.js is related to BP Default theme which is no more used since 1.9.
    The “new” js you can check for comment count is \buddypress\bp-templates\bp-legacy\js\buddypress.js:667

    I don’t know how the default 5 count is set before firing Show all X comments link. But i haven’t read very attentively the whole js file.

    If your goal is to gain some place on activity feeds, you may use a show/hide comment button ?

    function add_comment_hide_show() {
    ?>
    <style>
    .single-group .activity-comments ul{display: none;}
    </style>
    <script type="text/javascript">
    jQuery(function($) {
    	setInterval(function() {
    		$('.activity-meta').each(function() {
    			if( !$(this).find('.show-comments').length ){
    				var html = '<a href="#" class="button bp-primary-action show-comments">Show/Hide Comments</a>';
    				$(this).find('.button.acomment-reply').after(html);
    			}
    		});
    		
    	}, 500);
    	
    	$('body').on('click', '.show-comments', function(e) {
    		e.preventDefault();
    		var obj = $(this).closest('.activity-content').next('.activity-comments').find('ul');
    		obj.slideToggle();
    		return false;
    	});
    	
    });
    </script>
    <?php
    }
    add_action( 'wp_footer', 'add_comment_hide_show' );

    Or if you want to limit the number of comment a member can leave on activities, BPDEVEL has a premium plugin called BP Rate Limit User Activity which can do that.

    On Trac, some very old tickets about comments: #2768, #1870

    Perhaps @dcavins can tell you more about this ?

    #256488
    marcono
    Participant

    ‘danbp’ your codes work great!
    One thing, though, since I removed the ‘home’ item in groups, now if I create a private group or click on a public group icon, the group page will not be available!
    I think it is because the ‘home’ item has remained as the default page for the group pages!? I changed my profile default page with ‘define(‘BP_DEFAULT_COMPONENT’, ‘profile’ );’ but it seems for changing group default tab story is different, so I used code suggested here: https://buddypress.org/support/topic/changing-group-tab-display-defaults/

    But still no success!?

    David Cavins
    Keymaster

    Hi there-

    Yes, 2.6.1 (and 2.6.1.1) have a conflict with BP Group Hierarchy. The problem is caused by the addition of the autoloader check in bp-loader.php because BPGH instantiates its class before BP knows if the groups component is active or not. The short term fix is, unhappily, to change bp-loader.php. Comment out the line that reads return (add a // before return) here:
    https://github.com/buddypress/BuddyPress/blob/master/src/bp-loader.php#L621

    allancaeg
    Participant

    On the profile page, the count of messages, notifications, etc are displayed:
    https://mercime.files.wordpress.com/2015/03/bpmenu-frontlinks.jpg

    Same goes for the BuddyPress header:

    View post on imgur.com

    BuddyPress has this menu feature:

    BuddyPress Links in WordPress Menus

    How do I add the notification count beside the menu item on the header navigation?

    #256461
    graeme_bryson
    Participant

    I’m currently trying to bring the number of comments shown below a post from 5 to 2. I’ve updated the following lines in ‘global.js’, but the feed still outputs 5 comments below each activity item.

    (global.js line 1490)
    if ( jq(this).children('ul').children('li').length < 5 ) return;
    to
    if ( jq(this).children('ul').children('li').length < 2 ) return;

    (global.js line 1502)
    if ( i < comment_lis.length - 5 ) {
    to
    if ( i < comment_lis.length - 2 ) {

    I’m running a vanilla install of BuddyPress 2.6.1.1 on WP 4.5.3, so I’m assuming my logic is incorrect in how I’m trying to bring the comment count down. Any help would be massively appreciated as I’ve hit a bit of a brick wall.

    Cheers, Graeme

    #256456

    In reply to: Members display name

    webexpression
    Participant

    Ahh yes I see. I’m not entirely sure. Apparently what I am in need of changing is code from BuddyPress.

    Does anyone know another way to get a problem fixed if you don’t get a response on here? I really need help.. oh and on my website also 😉

    #256453
    danbp
    Participant

    No, not for the moment. We’re handling here about profile and group nav, not about Group or Member Directory nav.

    If you have a snippet who works for the Directory, feel free to add it to the Nav Api examples. Codex Contributors are always welcome.

    #256451
    danbp
    Participant

    @socialc, since 2.6 and the new Nav API, there is a much simplier possibility as the translation file to change nav item names.


    @marcono
    , try this; not sure you learned, below snippet is on Nav API examples i indicated previously. 😉

    function bpcodex_rename_group_tabs() {
    
        if ( ! bp_is_group() ) {
            return;
        }
       
        buddypress()->groups->nav->edit_nav( array( 'name' => __( 'Group Discussion', 'buddypress' ) ), 'forum', bp_current_item() );
    }
    add_action( 'bp_actions', 'bpcodex_rename_group_tabs' );
    
    function bpcodex_rename_profile_tabs() {
     
          buddypress()->members->nav->edit_nav( array( 'name' => __( 'My Buddy Forums', 'textdomain' ) ), 'forums' );
          buddypress()->members->nav->edit_nav( array( 'name' => __( 'My Buddy Groups', 'textdomain' ) ), 'groups' );
     
    }
    add_action( 'bp_actions', 'bpcodex_rename_profile_tabs' );
    #256450
    socialc
    Participant

    @marcono you might want to read this page and consider making a translation file of your own.

    danbp
    Participant

    Make sure you have pretty permalinks enabled on your WordPress install. (whatever except default) and save.

    And check your install again.
    Ray’s script is not a bug tracker, it gives only information about global variables which is usefull when you want to debug a custom script. If you seek for bugs – rarely the case on a new install -, activate wp_debug in wp-config.php

    https://codex.wordpress.org/Debugging_in_WordPress

    Configure BuddyPress

    tutorbe
    Participant

    Dear All,

    I hope someone can point me a clue regarding the following:

    I have just installed WP 4.5.3 along with only Buddypress 2.6.1.1 activated, when I tried to access members/admin/profile/, it just returned 404 page. I have tried with different themes, the same issue still existing.

    I tried to investigated the problem using the debug script from r-a-y, it just showed:

    Array
    (
        [component] => profile
    )

    Thanks and best regards,

    Jobi

    #256432

    In reply to: Custom post type

    jaaahaaa
    Participant

    Solved!!

    What I was testing was tracking comments. I realized that it worked by using the tutorial for tracking when new objects are created.

    However, comments did not work so I ended up editing the creation of the custom post type. Posting the full code here if anyone else googles ignitiondeck buddypress integration:

    ignitiondeck-admin.php line 5 to 46:

    add_action( 'init', 'ign_create_post_type' );
    function ign_create_post_type() {
    	require 'languages/text_variables.php';
    	$slug = apply_filters('idcf_archive_slug', __('projects', 'ignitiondeck'));
    	register_post_type( 'ignition_product',
    		array(
    			'labels' => array(
    				'name' => $tr_Projects,
    				'singular_name' => $tr_Project,
    				'add_new' => $tr_Add_New_Project,
    				'add_new_item' => $tr_Add_New_Project,
    				'edit' => $tr_Edit,
    				'edit_item' => $tr_Edit_Project,
    				'new_item' => $tr_New_Project,
    				'view' => $tr_View_Project,
    				'view_item' => $tr_View_Project,
    				'search_items' =>$tr_Search_Project,
    				'not_found' => $tr_No_Products_found ,
    				'not_found_in_trash' => $tr_No_Product_in_Trash,
    				'all_items' => __( 'All Videos' ),
    			),
                'public' => true,
    			'show_in_nav_menus' => true,
    			'show_ui' => true,
    			'publicly_queryable' => true,
    			'exclude_from_search' => false,
    			'hierarchical' => apply_filters('idcf_hierarchical', false),
    			'menu_position' => 5,
    			'capability_type' => 'post',
    			'menu_icon' => plugins_url( '/images/ignitiondeck-menu.png', __FILE__ ),
    			'query_var' => true,
    			'rewrite' => apply_filters('id_register_project_post_rewrite', array('slug' => $slug, 'with_front' => true)),
    			'has_archive' => apply_filters('id_register_project_post_has_archive', $slug),
    			'supports' => array( 'title', 'author', 'editor', 'thumbnail', 'revisions', 'comments', 'buddypress-activity' ),
    			'taxonomies' => array('category', 'post_tag', 'project_category'),
    			'bp_activity' => array(
    			    'action_id'         => 'new_ignition_product',
    			    'comment_action_id' => 'new_ignition_product_comment',
    			)
    		)
    	);
    }
    #256431
    socialc
    Participant

    … or just add a login link to your site anywhere in your theme files. e.g <a href="<?php echo wp_login_url(bp_loggedin_user_domain()); ?>"><?php _e('Login', 'buddypress'); ?></a>.

    This will redirect a user to their profile page after logging in.

    #256428
    danbp
    Participant

    Maybe Slava is busy ! Try to contact him on BuddyPress Slack or Twitter (@slaFFik).

    #256425

    In reply to: Errors after update

    danbp
    Participant

    [MOD] Topic moved to a more appropriate forum.

    The following plugins/widget are generating these error messages.

    bp-edit-group-slug

    BP_Toplevel_Groups_Widget

    BP_Group_Navigator_Widget

    bp-group-email

    bp-group-hierarchy

    You have to contact their authors via plugin support on WP repo.

    and on your side:

    The first step to getting rid of those Notices is identifying the source, so:
    – switch momentarily to a WP theme like 2016 and see if any persist
    – turn off plugins one at a time and see if any persist

    About the bbPress notice (bbp_setup_current_user was called incorrectly), read here:
    https://buddypress.trac.wordpress.org/changeset/10709/

    bbp_setup_current_user was called incorrectly

    #256419
    danbp
    Participant

    It’s the same principle, but not the same syntax since 2.6

    To hide tabs on groups, you need to specify the component. Note that all menu items (nav and subnav items) are considered as sub-nav, they have not the same distinction as on member or activity menus.

    Use another function for groups. Try this.

    function bpex_remove_group_tabs() {  
    
    	if ( ! bp_is_group() ) {
    		return;
    	}
    
    	$slug = bp_get_current_group_slug();
    
    		// hide items to all users except site admin
    	if ( !is_super_admin() ) {
    
    	//	bp_core_remove_subnav_item( $slug, 'members' );
    		bp_core_remove_subnav_item( $slug, 'send-invites' );
    	//	bp_core_remove_subnav_item( $slug, 'admin' );
    	//	bp_core_remove_subnav_item( $slug, 'forum' );
    	}
    
    }
    add_action( 'bp_actions', 'bpex_remove_group_tabs' );

    To get more usage examples, see here:

    Navigation API

    #256417
    danbp
    Participant

    When you copy/paste code you do not really control, try at least the original one first before adding wrong things to it.

    For the redirect link, use this syntax:

    return bp_core_get_user_domain( $user->ID ) .'/mypics';

    And please don’t double post. It’s annoying.

    #256416
    danbp
    Participant

    Do you mean also that members can’t access to their profile settings when they are on their profile page ?

    The BP usermenu on the Toolbar, under Howdy (top right) mimics the usermenu of the BuddyBar which is on each profile.

    Have you enabled Extended Profiles ?

    Or use this snippet to login redirect your users to their profile.

    ps: i removed your site url as it is locked to public – which doesn’t help no one to help you.

    #256415
    danbp
    Participant

    hi @earl_d,

    add this snippet to bp-custom.php and give it a try.

    function bpex_redirect_to_profile( $redirect_to_calculated, $redirect_url_specified, $user ){
     
        if( empty( $redirect_to_calculated ) )
            $redirect_to_calculated = admin_url();
     
        // redirect logged in to his/her profile - except site admins
     
        if( isset( $user->ID) && ! is_super_admin( $user->ID ) )
            return bp_core_get_user_domain( $user->ID );
        else
            return $redirect_to_calculated; /* nada !*/
     
    }
    add_filter( 'bp_login_redirect', 'bpex_redirect_to_profile', 11, 3 );

    For the redirect URL error you mentionned here, use:

    return bp_core_get_user_domain( $user->ID ) .'/mypics';

    mypics is a slug, not a constant ( $user->ID ) .mypics

    #256411
    danbp
    Participant

    Add this snippet to bp-custom.php and give it a try.

    function bpex_hide_profile_menu_tabs() {
    
    	if( bp_is_active( 'xprofile' ) ) :
    
    	if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) {
    	//	BP's profile main menu items. Comment those to show.
    	//	bp_core_remove_nav_item( 'activity' );
    		bp_core_remove_nav_item( 'profile' );
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_nav_item( 'groups' );
    	//	exist only if you use bbPress
    		bp_core_remove_nav_item( 'forums' ); 
    
    	//	BP's profile main menu items. Comment those to show.
    	//	bp_core_remove_subnav_item( 'activity', 'personnal' );
    		bp_core_remove_subnav_item( 'activity', 'mentions' );
    		bp_core_remove_subnav_item( 'activity', 'favorites' );
    		bp_core_remove_subnav_item( 'activity', 'friends' );
    		bp_core_remove_subnav_item( 'activity', 'groups' );
    	}
    	endif;
    }
    add_action( 'bp_setup_nav', 'bpex_hide_profile_menu_tabs', 15 );
    5high
    Participant

    uh oh – just logged a php error for the new code. The error reported was this:

    PHP Parse error: syntax error, unexpected ‘endif’ (T_ENDIF) in /home/mysite/public_html/wp-content/themes/child-theme/buddypress/activity/index.php on line 34

    But when I look at this file I’m pretty sure it’s the same as what you posted =

    <?php if ( is_user_logged_in() && is_super_admin() ) ?>
    	 
    	   <?php bp_get_template_part( 'activity/post-form' ); ?>
    
    	<?php endif; ?>

    and line 34 is: <?php endif; ?> which I’m pretty sure I didn’t change!

    Can anyone spot what the problem is here?

    Many thanks, j

    #256397

    In reply to: Members display name

    webexpression
    Participant

    It seems that the comments and friendship function abilities are core things of buddypress not external plugins.

    Can anyone help with this?

    #256170
    danbp
    Participant

    BP files are very well commented actually. But reading through hundreds of files is not easy. Here a good ressource to find a function, hook by keywords. Still interesting even if related to BP 2.4.3
    Test and search for get_ to have an idea !

Viewing 25 results - 9,626 through 9,650 (of 68,948 total)
Skip to toolbar