BuddyDev

Search

Replies

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Remove activity tab menu counter #21328

    Hello,

    Thank you code worked. I would like to ask a question regarding this plugin https://wordpress.org/plugins/bp-whats-hot/ I was wondering if it can be used in conjunction with your plugin (Facebook Like User Activity Stream For BuddyPress) without any conflict

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Remove activity tab menu counter #21320

    Hello brajesh,

    1. Yes the activity/index.php file is present in my child theme
    2. I am using the Buddypress Legacy template pack

    This is the code in my child theme where I changed the text (ALL MEMBERS) to (NEWS FEED)

    I am using the klein theme

     <?php do_action( 'bp_before_directory_activity' ); ?>
    
    <div id="buddypress">
    
    	<?php do_action( 'bp_before_directory_activity_content' ); ?>
    
    	<?php if ( is_user_logged_in() ) : ?>
    
    		<?php bp_get_template_part( 'activity/post-form' ); ?>
    
    	<?php endif; ?>
    
    	<?php do_action( 'template_notices' ); ?>
    
    	<div class="item-list-tabs activity-type-tabs" role="navigation">
    		<ul>
    			<?php do_action( 'bp_before_activity_type_tab_all' ); ?>
    
    			<li class="selected" id="activity-all"><a href="<?php bp_activity_directory_permalink(); ?>" title="<?php esc_attr_e( 'My personal activities and the activities of members you are following on this site.', 'klein' ); ?>"><?php printf( __( 'News Feed <span>%s</span>', 'klein' ), bp_get_total_member_count() ); ?></a></li>
    
    			<?php if ( is_user_logged_in() ) : ?>
    
    				<?php do_action( 'bp_before_activity_type_tab_friends' ); ?>
    
    				<?php if ( bp_is_active( 'friends' ) ) : ?>
    
    					<?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
    
    						<li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/'; ?>" title="<?php esc_attr_e( 'The activity of my friends only.', 'klein' ); ?>"><?php printf( __( 'My Friends <span>%s</span>', 'klein' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
    
    					<?php endif; ?>
    
    				<?php endif; ?>
    
    				<?php do_action( 'bp_before_activity_type_tab_groups' ); ?>
    
    				<?php if ( bp_is_active( 'groups' ) ) : ?>
    
    					<?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
    
    						<li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/'; ?>" title="<?php esc_attr_e( 'The activity of groups I am a member of.', 'klein' ); ?>"><?php printf( __( 'My Groups <span>%s</span>', 'klein' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
    
    					<?php endif; ?>
    
    				<?php endif; ?>
    
    				<?php do_action( 'bp_before_activity_type_tab_favorites' ); ?>
    
    				<?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?>
    
    					<li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/'; ?>" title="<?php esc_attr_e( "The activity I've marked as a favorite.", 'klein' ); ?>"><?php printf( __( 'My Favorites <span>%s</span>', 'klein' ), bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
    
    				<?php endif; ?>
    
    				<?php if ( bp_activity_do_mentions() ) : ?>
    
    					<?php do_action( 'bp_before_activity_type_tab_mentions' ); ?>
    
    					<li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/'; ?>" title="<?php esc_attr_e( 'Activity that I have been mentioned in.', 'klein' ); ?>"><?php _e( 'Mentions', 'klein' ); ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><span><?php printf( _nx( '%s new', '%s new', bp_get_total_mention_count_for_user( bp_loggedin_user_id() ), 'Number of new activity mentions', 'klein' ), bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ); ?></span></strong><?php endif; ?></a></li>
    
    				<?php endif; ?>
    
    			<?php endif; ?>
    
    			<?php do_action( 'bp_activity_type_tabs' ); ?>
    		</ul>
    	</div><!-- .item-list-tabs -->
    
    	<p class="spacer"></p>
    
    	<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
    		<ul>
    			<li class="feed"><a href="<?php bp_sitewide_activity_feed_link(); ?>" title="<?php esc_attr_e( 'RSS Feed', 'klein' ); ?>">
    				<i class="fa fa-rss"></i> <?php _e( 'RSS', 'klein' ); ?></a>
    			</li>
    
    			<?php do_action( 'bp_activity_syndication_options' ); ?>
    
    			<li id="activity-filter-select" class="last">
    				<i class="fa fa-cog"></i>
    				<select id="activity-filter-by">
    					<option value="-1"><?php _e( '&mdash; Everything &mdash;', 'klein' ); ?></option>
    
    					<?php bp_activity_show_filters(); ?>
    
    					<?php do_action( 'bp_activity_filter_options' ); ?>
    
    				</select>
    			</li>
    		</ul>
    	</div><!-- .item-list-tabs -->
    
    	<?php do_action( 'bp_before_directory_activity_list' ); ?>
    
    	<div class="activity" role="main">
    
    		<?php bp_get_template_part( 'activity/activity-loop' ); ?>
    
    	</div><!-- .activity -->
    
    	<?php do_action( 'bp_after_directory_activity_list' ); ?>
    
    	<?php do_action( 'bp_directory_activity_content' ); ?>
    
    	<?php do_action( 'bp_after_directory_activity_content' ); ?>
    
    	<?php do_action( 'bp_after_directory_activity' ); ?>
    
    </div>
     

    Thanks

  • Participant
    Level: Guru
    Posts: 900

    I think I found a solution I got it to work for both members directory page and single members page with this code.

     /**
     * Hide Members Directory and single members page from non members(not logged in users)
     */
    function buddydev_hide_members_directory_for_non_members() {
        if ( bp_is_members_directory() || bp_is_user() ) {
            if (!is_user_logged_in() ) {
                 bp_core_redirect( bp_get_signup_page() );
    exit;
            }
        }
    }
     
    add_action( 'bp_template_redirect', 'buddydev_hide_members_directory_for_non_members' ); 
  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: BuddyPress Member Types Pro Question #20890

    Any feedback on this question thanks

  • Participant
    Level: Guru
    Posts: 900

    Thank you very much I just downloaded the plugin now

  • Participant
    Level: Guru
    Posts: 900

    Any feedback sir thanks

  • Participant
    Level: Guru
    Posts: 900

    Hello brajesh,

    Thank you very much your code worked perfectly, you are a life saver I’m really grateful for your help. I will also like to appreciate the good work you’re doing with buddypress. Your deep contribution has truly transformed buddypress from what it was 5 years ago.

    God bless you

  • Participant
    Level: Guru
    Posts: 900

    OK thanks so much i’m really grateful

  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: [Resolved] Force profile photo upload on a specific page #20704

    Hello,

    This code below is preventing the code you sent from working

     /**
     * Buddydev force follow 6 members function.
     */
    function buddydev_check_or_redirect() {
    	// Force profile photo active?
    	$fp_active = class_exists( 'BD_Force_User_Avatar_Helper' );
    
    	// skip if logged and on non bp page.
    	if ( is_user_logged_in() && ! is_buddypress() ) {
    		if ( $fp_active ) {
    			remove_action( 'bp_template_redirect', array(
    				BD_Force_User_Avatar_Helper::get_instance(),
    				'check_or_redirect',
    			), 1 );
    		}
    
    		return;
    	}
    
    	if ( ! function_exists( 'bp_follow_get_the_following_count' ) || ! is_user_logged_in() || is_super_admin() ) {
    		return;
    	}
    
    	$is_dir = bp_is_members_directory();
    
    	// if we are on directory and force profile is not active
    	// return.
    	if ( $is_dir && ! $fp_active ) {
    		return;
    	}
    
    	$follow_count = bp_follow_get_the_following_count( array( 'object_id' => get_current_user_id() ) );
    
    	if ( $follow_count >= 4 ) {
    		return;
    	}
    
    	if ( $is_dir && $fp_active ) {
    		remove_action( 'bp_template_redirect', array(
    			BD_Force_User_Avatar_Helper::get_instance(),
    			'check_or_redirect',
    		), 1 );
    
    		return;
    	}
    
    	bp_core_add_message( __( 'Please follow 4 or more members to continue.' ), 'error' );
    
    	bp_core_redirect( bp_get_members_directory_permalink() );
    }
    
    add_action( 'bp_template_redirect', 'buddydev_check_or_redirect', 0 ); 
  • Participant
    Level: Guru
    Posts: 900
    Tosin on in reply to: Buddypress blog activity notification #20640

    Any feedback sir, thanks