Skip to:
Content

BuddyPress.org

Ticket #2540: disable_auto_join_constant.patch

File disable_auto_join_constant.patch, 3.1 KB (added by boonebgorges, 16 years ago)
  • bp-themes/bp-default/groups/single/forum/topic.php

     
    8383                                        <div id="post-topic-reply">
    8484                                                <p id="post-reply"></p>
    8585
    86                                                 <?php if ( !bp_group_is_member() ) : ?>
     86                                                <?php if ( !bp_group_is_member() && !BP_DISABLE_AUTO_GROUP_JOIN ) : ?>
    8787                                                        <p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ) ?></p>
    8888                                                <?php endif; ?>
    8989
  • bp-themes/bp-default/groups/single/forum.php

     
    2525
    2626                                <?php do_action( 'bp_before_group_forum_post_new' ) ?>
    2727
    28                                 <?php if ( !bp_group_is_member() ) : ?>
     28                                <?php if ( !bp_group_is_member() && !BP_DISABLE_AUTO_GROUP_JOIN ) : ?>
    2929                                        <p><?php _e( 'You will auto join this group when you start a new topic.', 'buddypress' ) ?></p>
    3030                                <?php endif; ?>
    3131
  • bp-groups.php

     
    66if ( !defined( 'BP_GROUPS_SLUG' ) )
    77        define ( 'BP_GROUPS_SLUG', 'groups' );
    88
     9if ( !defined( 'BP_DISABLE_AUTO_GROUP_JOIN' ) )
     10        define ( 'BP_DISABLE_AUTO_GROUP_JOIN', false );
     11
    912require ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-classes.php' );
    1013require ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-templatetags.php' );
    1114require ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-widgets.php' );
     
    364367                                check_admin_referer( 'bp_forums_new_reply' );
    365368
    366369                                /* Auto join this user if they are not yet a member of this group */
    367                                 if ( !is_site_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
     370                                if ( !is_site_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) && !BP_DISABLE_AUTO_GROUP_JOIN )
    368371                                        groups_join_group( $bp->groups->current_group->id, $bp->loggedin_user->id );
    369372
    370373                                if ( !$post_id = groups_new_group_forum_post( $_POST['reply_text'], $topic_id, $_GET['topic_page'] ) )
     
    542545                                check_admin_referer( 'bp_forums_new_topic' );
    543546
    544547                                /* Auto join this user if they are not yet a member of this group */
    545                                 if ( !is_site_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
     548                                if ( !is_site_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) && !BP_DISABLE_AUTO_GROUP_JOIN )
    546549                                        groups_join_group( $bp->groups->current_group->id, $bp->loggedin_user->id );
    547550
    548551                                if ( !$topic = groups_new_group_forum_topic( $_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id ) )