Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'private'

Viewing 25 results - 676 through 700 (of 3,490 total)
  • Author
    Search Results
  • Brajesh Singh
    Participant

    Please put this code in your bp-custom.php

    
    function buddydev_hide_members_directory_from_all_except_admin() {
    
    	if ( bp_is_members_directory() && ! is_super_admin() ) {
    		//should we add a message too?
    		//bp_core_add_message( 'Private page.', 'error' );
    		bp_core_redirect( site_url('/') );
    	}
    }
    add_action( 'bp_template_redirect', 'buddydev_hide_members_directory_from_all_except_admin' );
    

    That should do it. Hoe it helps.

    danbp
    Participant

    @fearthemoose, @rezbiz,

    Here “the best guarded secret” finally revealed !
    But it’s not a secret, is part of Codex and a multi handled topic subject on this forum.

    What we want to do: remove access possibility.
    Where: on BuddyBar navigation menu (the one below the profile header).
    Specifics: make the activity and forum tabs only visible to the logged in user.

    NOTE: The activity tab is shown by default when you visit a profile.

    As we are going to hide/remove this tab to visitors, we need to define as first another default tab. If we won’t do that, the visitor will get a Page not found error. Which is not exactly the case here, the page exist but the visitor can’t access it.

    Let’s define arbitrary Profile as the new default tab. You can of course define what ever other existing tab on your BuddyBar as default.

    Add this line to bp-custom.php
    define( 'BP_DEFAULT_COMPONENT','profile' );

    Now the mega “open secret” !

    The folowing snippet contains almost any BP menu items you can have on a BuddyBar, and includes also the Forum item, in case you use bbPress.
    You can remove or comment out those you don’t want to use.
    Note also that it is only an example – you have to play with it to fit your need. But at least you have the right syntax to use.
    Note also that some profile menu items are user only, such as message or notice. In other words, these are always private.

    This function goes preferably to bp-custom.php

    function bpfr_hide_tabs() {
    global $bp;
    	 /**
    	 * class_exists() & bp_is_active are recommanded to avoid problems during updates 
    	 * or when Component is deactivated
    	 */
    
    	if( class_exists( 'bbPress' ) || bp_is_active ( 'groups' ) ) :
            
            /** here we fix the conditions. 
            * Are we on a profile page ? | is user site admin ? | is user logged in ?
            */
    	if ( bp_is_user() && !is_super_admin() && !is_user_logged_in() ) {
    
            /* and here we remove our stuff ! */
    		bp_core_remove_nav_item( 'activity' );
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_nav_item( 'groups' );
    		bp_core_remove_nav_item( 'forums' );
    	}
    	endif;
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );

    Some other hints for privacy
    if you want to allow only the profile owner to view some tabs, replace
    !is_user_logged_in by !bp_is_my_profile() – this scenario doesn’t need a check for logged in users as it is made by bp_is_my_profile.

    If you want only to make a profile private, read here.

    If you want to remove a sub-nav item (ie. View on Profile), you use something like:
    bp_core_remove_subnav_item( 'profile', 'view' );

    Many other possibilities for navigation are also available, including for groups. Several examples are given on Codex, here.

    And if not enough, RTFM and search the forum ! πŸ™‚

    Have fun !

    #258761
    tizianopitisci
    Participant

    I would like to have on my website the same solution of buddydev.com. See this examples please:

    BUDDYPRESS: https://buddypress.org/members/tizianopitisci/notifications/
    BUDDYDEV: https://buddydev.com/members/tizianopitisci/notifications/

    In buddydev users:
    1. Recive a notification by email with a link inside;
    2. Follow the link;
    3. Make the log-in;
    4. Access the private area

    I wuold like to have the same solution. Do you think is possible?

    Thanks for your help
    Tiziano

    #258742
    tizianopitisci
    Participant

    Thank you Henry, I’ve just made the following test:
    -no plugin exept Buddypress
    -defauolt wordpress theme “twenty fifteen”

    but we still have the issue. The point is that the message private as well as the notification area return a “not found page” message instead a “log-in required” message. I’m running the last buddypress version (italian located website).

    Is that a bug?

    #258659
    jaumearagay
    Participant

    It’s a PRIVATE group I talk about, not a HIDDEN one. My fault! πŸ˜‰

    #258653
    jaumearagay
    Participant

    Has anyboby tried this, please?
    Can you join a private group either being an admin or not?
    Is this a bug or is this something that affects only my install?

    Thanks for your time! πŸ˜‰

    #258638
    danbp
    Participant

    I’m unable to reproduce your issue on a single install with over 20 plugins active and plenty of custom functions active in bp-custom.php
    I can upload medias without problem with different 3th party themes or Twenty’s

    Try to upload a fresh copy of WordPress and BP and see if it makes a difference.

    Now about the snippet.
    It works more or less, no code error. You commented the action, so it is deactivated if someone copy/paste it without correcting this.

    That said, what is the reason behind using a redirection to login if the site, or at least the buddyPress parts, should be private ?

    Wouldn’t it be more logic to redirect visitors to an anonymous page with some important information, from which the first one could be Sorry, but this site is private ? Followed by some informations how to register or pay a fee or whatever the reason.

    A private site has two type of visitors: those invited to join and the others. Don’t give the opportunity to those who are there by chance to enter the site so easily.

    I let you think about this and eventually create an appropriate page and template.
    Here a code example redirecting to a page called Intranet and the correct calls to slugs for all components (including bbPress).

    function bpfr_guest_redirect() {
    global $bp;
    // enter the slug or component conditional here
    	if ( bp_is_activity_component() || bp_is_groups_component() || bp_is_blogs_component() || bp_is_page( BP_MEMBERS_SLUG ) || is_bbpress() ) {
    	
    // not logged in user are redirected to - comment/uncomment or add/remove to your need
    		if( !is_user_logged_in() ) { 
    			//wp_redirect( get_option('siteurl') ); //back to homepage
    			//wp_redirect( get_option('siteurl') . '/register' ); // back to register page	
    			wp_redirect( get_option('siteurl') . '/intranet' ); // back to whatever page
    		} 
    	}
    }
    add_filter( 'get_header', 'bpfr_guest_redirect', 1 );

    Add it to child-theme’s functions.php

    #258630
    danbp
    Participant

    Hi,

    the logout link is redirected to the same page. If you’re on your profile notifications screen, which is only intended for you, it is normal that when you logout from there, you’re redirected to a page not found message. Notifications is even private and not public.

    The solution is to redirect to an always public part of the site on logout.

    Add this snippet to child-theme’s functions.php

    //* Redirect WordPress Logout to Home Page
    add_action( 'wp_logout', create_function( '', 'wp_redirect( home_url() ); exit();' ) );

    Advice 1: use preferably the login widget, so the user stays on the same page where he attempt to login instead to be redirected to that boring wp-login page.

    Advice 2: on the Home (which is the member directory), you have all BP pages listed at the bottom. Remove them ! You certainly don’t need to give access to account activation or register page to your visitors…

    #258619
    jowyds
    Participant

    hello danbp, thanks for your reply.

    I have tried the suggestion to use define('WP_DEBUG', true); in conjuction with define('WP_DEBUG_LOG', true); with a twenty theme. It works fine when buddypress is not activated. No error or logfile whatsover. Then after I tried to activate buddypress, and test again. The media library still cannot load out. I have tried to check for error log and I can’t seems to find any.

    Nevertheless I found the culprit can be my bp-custom.php in which I put it just under /wp-content/plugins/[here]

    if I remove the file and everything seems works fine again with buddypress activated.

    This is the content for my bp-custom.php

    
    <?php
    // hacks and mods will go here
    
    /**
     * Make a site Private, works with/Without BuddyPress
     * 
     * @author sbrajesh
     * @global string $pagenow
     * 
     */
     
     /*
    function buddydev_private_site() {
        
        //first exclude the wp-login.php
        //register
        //activate
        global $pagenow;
        
        //do not restrict logged in users
        if( is_user_logged_in() ) {
            return ;
        }
        //if we are here, the user is not logged in, so let us check for exclusion
        //we selectively exclude pages from the list
        
        //are we on login page?
        if( $pagenow == 'wp-login.php' ) {
            return ;
        }
        
        //let us exclude the home page
        if( is_front_page() ) {
            return ;
        }
        
        $exclude_pages = array( 'register', 'activate', 'excelportfolio' );//add the slugs here
        
        //is it one of the excluded pages, if yes, we just return and don't care
        if( is_page( $exclude_pages ) ) {
            return ;
        }
        
        $redirect_url = wp_login_url( site_url('/') );//get login url,
        
        wp_safe_redirect( $redirect_url );
        exit( 0 );
    }
    
    */
     
    //add_action( 'template_redirect', 'buddydev_private_site', 0 );
    
    ?>
    
    <style type="text/css">
    
    #wp-admin-bar-bp-login {
    	display:none; /* JOWY: hide login link for buddypress. */
    }
    
    #wp-admin-bar-bp-register {
    	display:none; /* JOWY: hide register link for buddypress. */
    }
    
    #adminloginform {
    	color: #ffffff; /* JOWY: text color on form. */
    }
    
    #wpadminbar {
    	opacity: 0.7; /* JOWY: Opacity for wpadminbar. */
    }
    
    </style>
    

    what can possible went wrong?

    #258503
    jaumearagay
    Participant

    Am I the only one having this problem?!

    Could you make one of your groups private and try to join it to see if you get the same problem, please?

    I want to know if the problem is from BP or something in WordPress messing with BP.

    Thanks in advance! πŸ˜‰

    Jaume.

    FEARtheMoose
    Participant

    I’ve been trying to find a way to make the activity and forum tabs only visible to the logged in user. So for example, if im logged into my profile, i will be able to see/use the activity and forum tabs, however, im the only one who can see them.

    I managed to hide the tabs from users using css, but that only works for people who are logged out. Anyone who is logged into their account can still see those tabs due to there not being a specific css class. However, i would much rather a non CSS way of removing them for obvious reasons.

    Any help would be much appreciated, as i cant seem to find to much on the topic bar removing it with css.

    Cheers

    #258281
    danbp
    Participant

    Hi,

    you can try to remove the private message button from the template or hide it with CSS.
    And add a custom one who leads to admin inbox.

    The link should look like
    http://your-site.com/members/YOU/messages/compose/?r=THE ADMIN&_wpnonce=an_alpha_numeric_value

    See here how you may code this

    Codex and Forum are your friends to search about template customization.

    danbp
    Participant

    Hi !
    How could this have happened ?
    Are you sure you clicked on private message and not on public message ? Or have you checked the option
    This is a notice to all users ?

    But no worry ! To delete this notice, go to your profile, click on Messages > Notices and delete the message from the list.

    #258187
    danbp
    Participant

    According to your specifications:

    1) We would like that user after purchase of one of those services could access to a private page where he can manage what he have purchased.

    2) We would like to have freedom to put personalized content on user private pages.

    3) We need in particular that a user could use a contact form tu send us extra information on services configuration.

    Solution:
    1) woocommerce + some page privacy settings
    2) wordpress configuration
    3) a contact form ?

    I would say you don’t need BuddyPress for that. Confirmed by your statement:
    We don’t need to have interaction between user, like a forum or a social network.

    Read about BuddyPress.

    #258149
    danbp
    Participant

    You’re welcome. πŸ˜‰
    In case of, here’s another trick.

    #258101

    In reply to: New Privacy Plugin

    danbp
    Participant

    We’re cross-posting ! πŸ™‚ Hope you can follow !

    – As non logged visitor, when i’m on a user profile who hasn’t set anything i don’t see Private.
    – If i’m on a profile having a friend privacy setting, i see it.
    – If on a profile set for “only logged in users”, i’m redirected to register.

    #258099

    In reply to: New Privacy Plugin

    Fencer04
    Participant

    Thank you for the clarification. The “Private” tab should not appear unless you are being blocked. I posted an update that resolves that issue as well as some related to the Friends Component not being activated.

    Can you install that and let me know if you still see Private all the time?

    #258098

    In reply to: New Privacy Plugin

    danbp
    Participant

    Is it appearing all the time for you?

    Yes !

    If i see a direct access to a functionality like Add as Friend on the profile header, why would i go to a tab labeled Private to do that ? That’s not very logic imo.

    When i go to a profile, i see the header first and (depending whats used on the site) a more or less long buddynav menu. πŸ˜‰

    No worry about the notice. I don’t activate wp_debug on a production site.

    #258095

    In reply to: New Privacy Plugin

    Fencer04
    Participant

    I really appreciate the review. I’ll look into the error on a fresh install and see what happens. I have a question about the “Private” button.

    This should only appear if the person has selected Friends only. Is it appearing all the time for you?

    Can you explain this comment further:

    – the original BP Add as friend button on profile header or members directory is still there. This means that there is no need to go on Private tab to ask forfriendship.
    This is a little confusing !

    I’m not sure what you mean by this. Why is having the button in two places no good?

    I agree with the location of the settings. That is on my list of changes to make shortly.

    #258094

    In reply to: New Privacy Plugin

    danbp
    Participant

    hi @fencer04,

    thank for sharing your work. Well done, but it needs some revision (sorry).
    At his activation on 2 test sites (one with 4.5.3/bp 2.6.1, other 4.6/bp2.6.2) i got a notice.
    Array to string conversion in buddypress/bp-core/classes/class-bp-core-nav.php on line 279from

    sbpp04_privacy_check( )	..\plugin.php:525
    sbpp04_privacy_redirect( )	..\buddypress-profile-privacy.php:176
    bp_core_remove_nav_item( )	..\buddypress-profile-privacy.php:184
    BP_Core_Nav->delete_nav( )	..\bp-core-buddybar.php:798

    Another point concerning UI/UX is the Private button appearing on buddybar.
    On this tab, a default message says Friends Only.
    USERNAME has chosen to limit profile access to friends only.
    That’s wrong! Because this appear on each profile, even if the owner hasn’t setup anything about his profile privacy.

    So far i understand its fonctionality, this plugin let each member decide to show or not his whole profile page to friends or members only or to everyone (bp default).

    – imo this tab should show “This profile is private” to anybody who is concerned by a privacy setting and should not appear at all if “Everyone” is set.
    – the original BP Add as friend button on profile header or members directory is still there. This means that there is no need to go on Private tab to ask forfriendship.
    This is a little confusing !

    If the plugin is to extend profile settings, it should appear in profile settings only. And as it doesn’t superseed BP, there is no real reason to give him an extra tab on buddybar outside of the settings scope. A template notice could be enough to tell visitors what’s going on on such a profile.

    Just my 2 cents.

    #258056

    In reply to: Custom Profile View

    danbp
    Participant

    No that’s not possible.
    Only Me is very private and visitors or logged in members can’t see the profile in this case.

    #257956
    Zimm
    Participant

    Forums, blog posts, private messages, any comments, etc.

    #257846
    annikathunberg
    Participant

    Private list
    Probably excel or converted to csv

    Thank you for the link!

    Yes, I later found out exactly that – that the users are all in wp. Forgot that. For anyone else new, now this thread might clear up a thing or two!

    #257839
    danbp
    Participant

    Wich file format do you use for your list ? Where is this list taken from: wordpress, private list,… ?

    Pehaps you could use this plugin if you used CSV ?

    For more details, check on WP codex how to achieve this task. BP shares users with WP and is not concerned directly by your question.

    danbp
    Participant

    Try this:

    function mohammad_remove_private_message_button( $button ) {
    $user_id = bp_loggedin_user_id();
    
        if ( $user_id == '37' ) // the user ID
    	$button = '';
    
         return $button;
    }
    add_filter( 'bp_get_send_message_button', 'mohammad_remove_private_message_button', 1 , 1 );

    More details here:

    [Resolved] how hide tab only for user? not remove/disable

Viewing 25 results - 676 through 700 (of 3,490 total)
Skip to toolbar