Forum Replies Created

Viewing 12 posts - 41 through 52 (of 52 total)
  • Author
  • in reply to: Remove visibility iof admin #48431
     klosurdo
    Participant

    I am really struggling with this one. I searched this site and buddy press and tried every code available with no success. Below is the last code I tried with no success.

    https://buddypress.org/support/topic/hide-admins-activities-from-all-activity-feeds-in-buddypress/

    Any ideas what I am doing incorrectly? This code is inserted in my child themes fuction.php correct?

    I am racking my brain on this one!

    Ken

    COPY CODE
    // deny access to admins profile. User is redirected to the homepage
    
    function bpfr_hide_admins_profile() {
    	global $bp; 
    	if(bp_is_profile && $bp->displayed_user->id == 1 && $bp->loggedin_user->id != 1) :
    	wp_redirect( home_url() );
    	exit;
    	endif;
    }
    add_action( 'wp', 'bpfr_hide_admins_profile', 1 );
    
    // Remove admin from the member directory
    
    function bpdev_exclude_users($qs=false,$object=false){
    	
    	$excluded_user='1'; // Id's to remove, separated by comma
    	
    	if($object != 'members' && $object != 'friends')// hide admin to members & friends 
    	return $qs;
    	
    	$args=wp_parse_args($qs);
    	
    	if(!empty($args['user_id']))
    	return $qs;	
    	
    	if(!empty($args['exclude']))
    	$args['exclude'] = $args['exclude'].','.$excluded_user;
    	else
    	$args['exclude'] = $excluded_user;
    	
    	$qs = build_query($args);
    	
    	return $qs;
    	
    }
    add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
    
    // once admin is removed, we must recount the members !
    
    function bpfr_hide_get_total_filter($count){
    	return $count-1;
    }
    add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter');
    
    // hide admin's activities from all activity feeds
    
    function bpfr_hide_admin_activity( $a, $activities ) {	
    	
    	// ... but allow admin to see his activities!
    	if ( is_site_admin() )	
    	return $activities;	
    	
    	foreach ( $activities->activities as $key => $activity ) {	
    		// ID's to exclude, separated by commas. ID 1 is always the superadmin
    		if ( $activity->user_id == 1  ) {			
    			
    			unset( $activities->activities[$key] );			
    			
    			$activities->activity_count = $activities->activity_count-1;			
    			$activities->total_activity_count = $activities->total_activity_count-1;			
    			$activities->pag_num = $activities->pag_num -1;				
    		}		
    	}		
    	// Renumber the array keys to account for missing items 	
    	$activities_new = array_values( $activities->activities );		
    	$activities->activities = $activities_new;	
    	
    	return $activities;
    	
    }
    add_action( 'bp_has_activities', 'bpfr_hide_admin_activity', 10, 2 );
    in reply to: Remove visibility iof admin #48384
     klosurdo
    Participant

    Thanks Radu,

    Unfortunatey it did not work. Still showing the admins here http://www.cmpg-annex.org/member-galleries/ and elwhere through the site

    in reply to: Remove visibility iof admin #48312
     klosurdo
    Participant

    Am I doing something incorrectly? or is there a better way to do this through a plugin
    ?

    in reply to: Best image size for cover image? #48311
     klosurdo
    Participant

    thanks Laura,

    My image looks much better now!

    in reply to: Profile menu visability #48159
     klosurdo
    Participant

    Thanks,

    I actually found the following code that did exactly what I wanted to do.

    COPY CODE
    function bpfr_hide_top_nav() {	
    	
    	if( !is_user_logged_in() ) {	
    
    // bp topnav items to hide	
    	//	bp_core_remove_nav_item( 'activity' );			
    		bp_core_remove_nav_item( 'profile' );
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_nav_item( 'groups' );
    		bp_core_remove_nav_item( 'forums' );	
    
    //bp subnav (my activities, my groups, etc)
    	//  bp_core_remove_subnav_item( 'activity', 'activity' );
    		bp_core_remove_subnav_item( 'activity', 'friends' ); 
    		bp_core_remove_subnav_item( 'activity', 'favorites' );
    		bp_core_remove_subnav_item( 'activity', 'groups' );
    		bp_core_remove_subnav_item( 'activity', 'mentions' );
    	}
    }
    add_action( 'bp_ready', 'bpfr_hide_top_nav', 10 );

    Added it to my child-theme functions.php

    in reply to: Help please (RT Media Code) #47935
     klosurdo
    Participant
    This reply has been set as private.
    in reply to: Is it possible to customize this message #47124
     klosurdo
    Participant

    Awesome! I can use this for a lot of other things as well! So cool!

    Thanks!

    in reply to: Missing blue online status dot #46814
     klosurdo
    Participant

    Any Ideas?

    in reply to: Profile Cover #46719
     klosurdo
    Participant

    Ok everyone FYI there are two buddy press cover photo plugins out there.

    buddy press cover and buddy press cover photo.

    Make sure you download “buddy press cover photo”

    in reply to: Profile Cover #46716
     klosurdo
    Participant

    Ok I installed the plugin and activated. How do I change the image?

    in reply to: Profile Cover #46715
     klosurdo
    Participant

    Ahhhhh! Did not know there was a plugin for this feature.

    in reply to: Remove "create an account" #46089
     klosurdo
    Participant

    Worked like a charm adding it to the child .css. thanks so much!

    Additionally is there a way to remove from the WordPress menu as well? See photo.

    Attachments:
    You must be logged in to view attached files.
Viewing 12 posts - 41 through 52 (of 52 total)

Log in with your credentials

Forgot your details?