Skip to:
Content

BuddyPress.org

Changeset 583


Ignore:
Timestamp:
11/26/2008 11:50:58 PM (13 years ago)
Author:
apeatling
Message:

Fixing "member" vs "members" problem on group directory

Location:
trunk/bp-groups
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-classes.php

    r580 r583  
    667667        global $wpdb, $bp;
    668668       
     669        if ( !$user_id )
     670            return false;
     671       
    669672        return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id != 0 AND invite_sent = 1", $user_id, $group_id ) );     
    670673    }
     
    673676        global $wpdb, $bp;
    674677       
     678        if ( !$user_id )
     679            return false;
     680       
    675681        return $wpdb->query( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_admin = 1 AND is_banned = 0", $user_id, $group_id ) );
    676682    }
     
    679685        global $wpdb, $bp;
    680686       
     687        if ( !$user_id )
     688            return false;
     689       
    681690        return $wpdb->query( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_mod = 1 AND is_banned = 0", $user_id, $group_id ) );
    682691    }
     
    685694        global $wpdb, $bp;
    686695       
     696        if ( !$user_id )
     697            return false;
     698       
    687699        return $wpdb->query( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 AND is_banned = 0", $user_id, $group_id ) );
    688700    }
     
    691703        global $wpdb, $bp;
    692704       
     705        if ( !$user_id )
     706            return false;
     707       
    693708        return $wpdb->get_var( $wpdb->prepare( "SELECT is_banned FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d", $user_id, $group_id ) );
    694709    }
     
    696711    function check_for_membership_request( $user_id, $group_id ) {
    697712        global $wpdb, $bp;
     713       
     714        if ( !$user_id )
     715            return false;
    698716       
    699717        return $wpdb->query( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND is_banned = 0 AND inviter_id = 0", $user_id, $group_id ) ); 
  • trunk/bp-groups/directories/bp-groups-directory-groups.php

    r580 r583  
    105105                        <?php bp_group_join_button( $group ) ?>
    106106                        <div class="meta">
    107                             <?php echo ucwords($group->status) ?> <?php _e( 'Group', 'buddypress' ) ?> / <?php _e( sprintf( '%d members', groups_get_groupmeta( $group->id, 'total_member_count' ) ), 'buddypress' ) ?>
     107                            <?php $member_count = groups_get_groupmeta( $group->id, 'total_member_count' ) ?>
     108                            <?php echo ucwords($group->status) ?> <?php _e( 'Group', 'buddypress' ) ?> /
     109                            <?php if ( $member_count == 1 ) : ?>
     110                                <?php _e( sprintf( '%d member', $member_count ), 'buddypress' ) ?>
     111                            <?php else : ?>
     112                                <?php _e( sprintf( '%d members', $member_count ), 'buddypress' ) ?>
     113                            <?php endif; ?>
    108114                        </div>
    109115                    </div>
Note: See TracChangeset for help on using the changeset viewer.