Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'private'

Viewing 25 results - 1,401 through 1,425 (of 3,460 total)
  • Author
    Search Results
  • #167335
    bp-help
    Participant

    @maan18
    I am not certain I understand your requirement but you can try:
    https://github.com/bphelp/private_community_for_bp_lite

    #167291

    In reply to: Creating New Plugins

    bp-help
    Participant

    @modemlooper
    This is what I am adding in the loader.php per your advice. I hope it looks good. I have tested it and I get the effect I want so thank you for the advice.

    
    /*** Make sure BuddyPress is loaded ********************************/
    function private_community_for_bp_lite_bp_check() {
        if ( !class_exists( 'BuddyPress' ) ) {
    	add_action( 'admin_notices', 'private_community_for_bp_lite_install_buddypress_notice' );
        }
    }
    
    function private_community_for_bp_lite_install_buddypress_notice() {
    	echo '<div id="message" class="error fade"><p style="line-height: 150%">';
    	_e('<strong>Private Community For BP Lite</strong></a> requires the BuddyPress plugin to work. Please <a href="https://buddypress.org/download">install BuddyPress</a> first, or <a href="plugins.php">deactivate Private Community For BP Lite</a>.');
    	echo '</p></div>';
    }
    
    function private_community_for_bp_lite_init() {
    	require( dirname( __FILE__ ) . '/private-community-for-bp-lite.php' );
    }
    
    add_action('plugins_loaded', 'private_community_for_bp_lite_bp_check', 999);
    add_action( 'bp_include', 'private_community_for_bp_lite_init' );
    
    #167280
    Henry
    Member

    If you add this to your theme’s functions.php it will basically filter the entire button. You’ll then be free to modify whatever you need:

    //filter group button
    function bp_change_group_button( $button ) {
    
    global $groups_template;
    
    		if ( empty( $group ) )
    			$group =& $groups_template->group;
    
    		if ( !is_user_logged_in() || bp_group_is_user_banned( $group ) )
    			return false;
    
    		// Group creation was not completed or status is unknown
    		if ( !$group->status )
    			return false;
    
    		// Already a member
    		if ( isset( $group->is_member ) && $group->is_member ) {
    
    			// Stop sole admins from abandoning their group
    	 		$group_admins = groups_get_group_admins( $group->id );
    		 	if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == bp_loggedin_user_id() )
    				return false;
    
    			$button = array(
    				'id'                => 'leave_group',
    				'component'         => 'groups',
    				'must_be_logged_in' => true,
    				'block_self'        => false,
    				'wrapper_class'     => 'group-button ' . $group->status,
    				'wrapper_id'        => 'groupbutton-' . $group->id,
    				'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ),
    				'link_text'         => __( 'Leave Group', 'buddypress' ),
    				'link_title'        => __( 'Leave Group', 'buddypress' ),
    				'link_class'        => 'group-button leave-group',
    			);
    
    		// Not a member
    		} else {
    
    			// Show different buttons based on group status
    			switch ( $group->status ) {
    				case 'hidden' :
    					return false;
    					break;
    
    				case 'public':
    					$button = array(
    						'id'                => 'join_group',
    						'component'         => 'groups',
    						'must_be_logged_in' => true,
    						'block_self'        => false,
    						'wrapper_class'     => 'group-button ' . $group->status,
    						'wrapper_id'        => 'groupbutton-' . $group->id,
    						'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ),
    						'link_text'         => __( 'Join Group', 'buddypress' ),
    						'link_title'        => __( 'Join Group', 'buddypress' ),
    						'link_class'        => 'group-button join-group',
    					);
    					break;
    
    				case 'private' :
    
    					// Member has not requested membership yet
    					if ( !bp_group_has_requested_membership( $group ) ) {
    						$button = array(
    							'id'                => 'request_membership',
    							'component'         => 'groups',
    							'must_be_logged_in' => true,
    							'block_self'        => false,
    							'wrapper_class'     => 'group-button ' . $group->status,
    							'wrapper_id'        => 'groupbutton-' . $group->id,
    							'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_request_membership' ),
    							'link_text'         => __( 'Request Membership', 'buddypress' ),
    							'link_title'        => __( 'Request Membership', 'buddypress' ),
    							'link_class'        => 'group-button request-membership',
    						);
    
    					// Member has requested membership already
    					} else {
    						$button = array(
    							'id'                => 'membership_requested',
    							'component'         => 'groups',
    							'must_be_logged_in' => true,
    							'block_self'        => false,
    							'wrapper_class'     => 'group-button pending ' . $group->status,
    							'wrapper_id'        => 'groupbutton-' . $group->id,
    							'link_href'         => bp_get_group_permalink( $group ),
    							'link_text'         => __( 'Request Sent', 'buddypress' ),
    							'link_title'        => __( 'Request Sent', 'buddypress' ),
    							'link_class'        => 'group-button pending membership-requested',
    						);
    					}
    
    					break;
    			}
    		}
    
    		return $button;
    
    }
    add_filter( 'bp_get_group_join_button', 'bp_change_group_button' );
    #167243
    bp-help
    Participant

    @darrenmeehan
    Alright, then I will test it out and supply feedback. I have a plugin as well that has been submitted to the repo in the last 4 days that is yet to be approved but I could also use some others testing and supplying feedback. You can get it here: https://github.com/bphelp/private_community_for_bp_lite
    Thanks!

    #167232

    In reply to: Creating New Plugins

    bp-help
    Participant

    @modemlooper
    I have tested the plugin:
    https://github.com/bphelp/private_community_for_bp_lite
    As is it works as expected. If BuddyPress is installed and activated then the notice does not appear, however if you try installing the plugin without BuddyPress installed and activated then the notice appears. Can you test it so you will see what I mean because it simply works!

    #167211

    In reply to: Creating New Plugins

    modemlooper
    Moderator

    Actually just wrap notice check in if class because bp_include won’t run if bp isn’t active.

    add_action( ‘bp_include’, ‘private_community_for_bp_lite_init’ );

    function private_community_for_bp_lite_bp_check() {
        if ( !class_exists( 'BuddyPress' ) ) {
    	add_action( 'admin_notices', 'private_community_for_bp_lite_install_buddypress_notice' );
        }
    }
    add_action('plugins_loaded', 'private_community_for_bp_lite_bp_check', 999);
    #167173

    In reply to: Creating New Plugins

    bp-help
    Participant

    @modemlooper
    What extra file? Are you referring to the loader.php? If that is the case then the example you provided above makes no sense. Why would I require private-community-for-bp-lite.php? Are you suggesting I do away with the loader.php and add the example you provided in the main plugins private-community-for-bp-lite.php file as well as the required plugin header info or am I missing something? This is different than my usual workflow so it seems strange to me. I guess you can require a file from within a file but doesn’t it seem redundant? I really do not see what difference it makes. The plugin works as expected either way. So the hold up with the review panel is kinda tedious. Is this some new way of streamlining plugins for consistency or am I missing something that is required? To me it seems any advantages to this approach you offered are negligible and it apparently still has not made any difference in the approval status. Keep in mind this is the first plugin I have released to the WP repo because I am still new to adding the admin settings but what I have works so far and saves the settings to the database so I don’t see what the problem is! Thanks again!

    #167159

    In reply to: Creating New Plugins

    modemlooper
    Moderator
    /*** Make sure BuddyPress is loaded ********************************/
    if ( class_exists( 'BuddyPress' ) ) {
    	add_action( 'bp_include', 'private_community_for_bp_lite_init' );
    } else {
    	add_action( 'admin_notices', 'private_community_for_bp_lite_install_buddypress_notice' );
    }
    
    function private_community_for_bp_lite_init() {
    	require( dirname( __FILE__ ) . '/private-community-for-bp-lite.php' );
    }
    
    function private_community_for_bp_lite_install_buddypress_notice() {
    	echo '<div id="message" class="error fade"><p style="line-height: 150%">';
    	_e('<strong>Private Community For BP Lite</strong></a> requires the BuddyPress plugin to work. Please <a href="https://buddypress.org/download">install BuddyPress</a> first, or <a href="plugins.php">deactivate Private Community For BP Lite</a>.');
    	echo '</p></div>';
    }
    #167154
    Henry
    Member

    @kizmark

    I’m still scratching my head with this one. It must be my install playing games. In the end I got it working with

    Anyway I thought why not just build the link and throw it directly in the friends template?

    #167153

    In reply to: Creating New Plugins

    bp-help
    Participant

    @hnla @mercime @modemlooper
    I agree there needs sorting out and consistency in how to check for BP etc.
    I just got an email from Mika E one of the plugin reviewers and she says

    But … why?

    BuddyPress has loader actions you can hook into: https://plugins.trac.wordpress.org/browser/buddypress/trunk/bp-core/bp-core-actions.php#L34

    (I’m sitting next to JJJ right now and he pointed this out). So you don’t have to call loader.php, which is slower in the long run, and instead you hook into BP at the appropriate point.

    The whole thing it looks like you’re doing is adding this action:

    add_action( ‘admin_notices’, ‘private_community_for_bp_lite_install_buddypress_notice’ );

    And you want to only add that notice IF BuddyPress is loaded, right? So why not the smaller check? If you do that, you won’t have to call bp-loader, because you’re hooking in after it’s loaded.

    Why would I want my install buddypress notice to display if they have buddypress installed and the requirement for BP is met? That makes no sense. Right now it is setup to display only if someone using wordpress does not have BP installed and activated which is what it does and should do correct?
    I don’t get it! Any of you guys have advice?
    Thanks again!

    #167113
    shanebp
    Moderator

    Messages send is okay.
    Just sent to kizmark and oz_admin

    You have to use the correct name: kiz mark will fail.

    #167111
    kizmark
    Participant

    @Henry, Did you got it solved?

    I’m having the same question.. I want to get the link to have a send private message button

    #167046
    bp-help
    Participant

    @synaptic
    Still waiting for the plugin review before I move it over to the repo but until then you can get it here.
    https://github.com/bphelp/private_community_for_bp_lite

    #167042
    modemlooper
    Moderator

    Don’t think that exists but sounds like a good plugin.

    #166905
    Henry
    Member

    Have you tried searching the WordPress plugin repository for something like ‘buddypress spam messages’?

    A good plugin that will certainly resolve the issue is
    https://wordpress.org/plugins/buddypress-private-message-for-friends-only/

    #166572
    @mercime
    Participant

    @agreenmail @agreenmail I was using the Twenty Twelve theme when I made the tutorial “How to Join a Private Group” around a month ago in this page https://codex.buddypress.org/user/buddypress-components-and-features/groups/how-to-join-a-private-group/

    #166526
    bp-help
    Participant

    @profc
    Hi, sorry so late for getting back to you. My ISP has been strange today. I just updated github Repo to 2.1 to allow up to 10 unblocked public pages. As before read the readme.txt and follow the commented instructions in private-community-for-bp.php
    https://github.com/bphelp/private_community_for_bp

    #166515
    ProfC
    Participant

    @bphelp

    Hi dear, I successfully installed your private community for bp and I edited

    private_community_for_bp-master/private-community-for-bp.php changing ‘test’ with the name of the page I want to be public.

    I cannot figure out how to put more pages available for generic users.
    I tried to copy this string

    $bphelp_my_unblocked_pages = ‘page_name’;

    many times changing the name of the page each time, but it always works only with the last page.
    Can you please tell me how to put more pages?
    Many many thanks,
    Gabriele

    #166504
    agreenmail
    Participant

    Using child theme of twentyTwelve. BP 1.7. WP 3.5. Currently on a localserver.

    Just switched over to buddypress default. No joy. Then switched back to TwentyTwelve. No joy.

    (Should add that I also tried setting up a completely new test site and had the same result. Private group is set.)

    #166502
    @mercime
    Participant

    @agreenmail I see the request membership button in all private group screens. BP/WP versions? What theme are you using? Change to Twenty Twelve theme and check if the request membership button is present in your private group

    #166476
    ProfC
    Participant

    Has someone found a solution to this issue? I also want to deny access to non-logged in users to group and members pages.

    I tried private_community_for_bp but I did not understand how to customize code since I want to leave generic users to vist 3 pages that do not belong to bp installation since, like site homepage

    #166462
    ProfC
    Participant

    dear @bphelp

    I try to explain better: I need 3 pages available to all users. Those three pages are: home, radio-109, contatti (these are the short name of the pages).

    I want to stop users from accessing bp pages like members and groups pages by hot links.

    ‘registrati’ is the slug that stands for ‘register’ page on bp.

    I used private_community_for_bp-master, as you suggested me, and I edited private-community-for-bp.php in this way:

    /* Prevent logged out users from accessing bp pages */
    function bphelp_private_community(){
    global $bp_unfiltered_uri;

    $bphelp_my_unblocked_pages = ‘ ‘; // Replace ‘test’ with the name of the page you would like to make available to logged out visitors EX: ‘activity’

    $bphelp_my_unblocked_pages = ‘radio-109’; // Replace ‘test’ with the name of the page you would like to make available to logged out visitors EX: ‘activity’

    $bphelp_my_unblocked_pages = ‘contatti’; // Replace ‘test’ with the name of the page you would like to make available to logged out visitors EX: ‘activity’

    $bphelp_my_unblocked_pages = ‘registrazione’; // Replace ‘test’ with the name of the page you would like to make available to logged out visitors EX: ‘activity’

    $bphelp_if_I_changed_my_register_slug_it_is = ‘registrazione’; // Replace ‘register’ if you have changed the ‘register’ slug for example to ‘sign-up’

    if ( !is_user_logged_in() && !bp_is_register_page() && !bp_is_activation_page() && ( $bp_unfiltered_uri[0] != $bphelp_my_unblocked_pages ) )
    bp_core_redirect( get_option(‘home’) . ‘/’ . $bphelp_if_I_changed_my_register_slug_it_is );

    }
    add_action( ‘wp’, ‘bphelp_private_community’, 3 );
    /* End Prevent logged out users from accessing bp pages */

    I want that generic users can reach those pages, but at this time they are redirect to the ‘registrazione’ page. Where I wrong? What’s the name of homepage? Is it home, even if it doesn’t appear to the link?

    Thanks for your help!

    #166385
    ProfC
    Participant

    Thanks for your quick answer.

    I read the readme file but I did not understeand whicj commented code I have to edit.

    In my website I have 3 public page: ‘home’ , ‘radio’ , ‘contatti’, so I add these strings:

    $bphelp_my_unblocked_pages = ‘home’;
    $bphelp_my_unblocked_pages = ‘radio’;
    $bphelp_my_unblocked_pages = ‘contatti’;

    and put home in this string, since you can reach register page from home:
    $bphelp_if_I_changed_my_register_slug_it_is = ‘home’; // Replace ‘register’ if you have changed the ‘register’ slug for example to ‘sign-up’

    but those pages are still blocked.
    why?

    #166383

    In reply to: Autosuggest in core?

    mangtimo
    Participant

    Thanks Paul for clarifying.

    I was just wondering if it was just me breaking something again.
    Autosuggest in private message works great.
    Though it tend to be slow for me when looking for usernames.

    #166382

    In reply to: Autosuggest in core?

    Paul Wong-Gibbs
    Keymaster

    Labs is meant to be experiments. Sometimes, experiments go wrong because no-one’s looking after them 😉

    There’s autosuggest in core for the recipient name box on the private message screen, but nowhere else AFAIK.

Viewing 25 results - 1,401 through 1,425 (of 3,460 total)
Skip to toolbar