Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)

  • Nomi
    Participant

    @naumanahmed19

    update :
    

    I found issue.

    if there is members widget active in sidebar then group invitation button does not appear on that page. I think this is a bug.


    Nomi
    Participant

    @naumanahmed19

    can you please guide me.


    Nomi
    Participant

    @naumanahmed19

    Thanks for reply. I am trying to make my theme buddy press compatible. I am adding only one file which is buddypress/buddypress.php.
    I have checked css buttons are not hidden. If I remove buddypress.php from my theme it displays buttons.

    I am using simple loop in buddypress.php is that ok?

    	<?php while ( have_posts() ) : the_post(); ?>
            <?php the_content(); ?>
           <?php endwhile; // end of the loop. ?>

    Nomi
    Participant

    @naumanahmed19

    I am trying to allow user to join group using enrollment key as you can see here.
    https://buddypress.org/support/topic/join-group-by-key/

    I got it working in core file but i have no idea how to implement in my plugin is there any other way?
    Here is my code

    
    if ($_POST['enrollment-key'] =='xxx'){
     				 groups_join_group($bp->groups->current_group->id , bp_loggedin_user_id() );
     				 bp_core_add_message( __('You have successfully joined this group.', 'buddypress' ) );
     			}else{
     				 groups_join_group($bp->groups->current_group->id , bp_loggedin_user_id() );
     				bp_core_add_message( __( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) );
     			}

    Nomi
    Participant

    @naumanahmed19

    Okay I have created a new enrollment key option in request membership form.

    The problem is that where should I add check if enrollment key is true that user auto join group without asking from admin.

    I have some code for auto join i think it will work but where should I add it.

    if($enrollment_key == 'xxx'){
        if ( bp_groups_auto_join() && bp_current_user_can( 'bp_moderate' ) && 'key' $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(),$bp->groups->current_group->id ) ) {
    	groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() );
    	}
    }

    Nomi
    Participant

    @naumanahmed19

    yes. Some time it appears quickly after making a request and some time it take too much time. Should I send you site details?


    Nomi
    Participant

    @naumanahmed19

    Okay again buttons have disappeared ..

    var_dump() returns NULL


    Nomi
    Participant

    @naumanahmed19

    @shanebp thanks for your help. I don’t know what was the problem but its working now.


    Nomi
    Participant

    @naumanahmed19

    okay i used bp_get_button but still no luck. then I removed requests-loop.php from theme buddypress folder that it can use plugin’s requests-loop.php still its not displaying

Viewing 9 replies - 1 through 9 (of 9 total)
Skip to toolbar