Skip to:
Content

BuddyPress.org


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

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

File:
1 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 ) ); 
Note: See TracChangeset for help on using the changeset viewer.