Skip to:
Content

BuddyPress.org

Changeset 3178


Ignore:
Timestamp:
08/11/2010 11:25:11 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2540 props boonebgorges

Location:
branches/1.2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-groups.php

    r3175 r3178  
    9797    $bp->groups->valid_status = apply_filters( 'groups_valid_status', array( 'public', 'private', 'hidden' ) );
    9898
     99    // Auto join group when non group member performs group activity
     100    $bp->groups->auto_join = defined( 'BP_DISABLE_AUTO_GROUP_JOIN' ) ? false : true;
     101
    99102    do_action( 'groups_setup_globals' );
    100103}
     
    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 ( $bp->groups->auto_join && !is_site_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
    368371                    groups_join_group( $bp->groups->current_group->id, $bp->loggedin_user->id );
    369372
     
    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 ( $bp->groups->auto_join && !is_site_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) )
    546549                    groups_join_group( $bp->groups->current_group->id, $bp->loggedin_user->id );
    547550
  • branches/1.2/bp-groups/bp-groups-templatetags.php

    r3143 r3178  
    559559    echo sprintf( __( 'Viewing group %1$s to %2$s (of %3$s groups)', 'buddypress' ), $from_num, $to_num, $total ); ?>  
    560560    <span class="ajax-loader"></span><?php
     561}
     562
     563function bp_groups_auto_join() {
     564    global $bp;
     565
     566    return (bool)$bp->groups->auto_join;
    561567}
    562568
  • branches/1.2/bp-themes/bp-default/groups/single/forum.php

    r2966 r3178  
    2626                <?php do_action( 'bp_before_group_forum_post_new' ) ?>
    2727
    28                 <?php if ( !bp_group_is_member() ) : ?>
     28                <?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
    2929                    <p><?php _e( 'You will auto join this group when you start a new topic.', 'buddypress' ) ?></p>
    3030                <?php endif; ?>
  • branches/1.2/bp-themes/bp-default/groups/single/forum/topic.php

    r3094 r3178  
    8484                        <p id="post-reply"></p>
    8585
    86                         <?php if ( !bp_group_is_member() ) : ?>
     86                        <?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
    8787                            <p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ) ?></p>
    8888                        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.