Skip to:
Content

BuddyPress.org

Changeset 840


Ignore:
Timestamp:
01/13/2009 12:13:56 AM (15 years ago)
Author:
apeatling
Message:

FIxes #308

Location:
trunk
Files:
3 edited

Legend:

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

    r813 r840  
    167167            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    168168
    169         $total_users = $wpdb->get_var( $wpdb->prepare( "SELECT count(user_id) FROM {$wpdb->base_prefix}usermeta um WHERE meta_key = 'total_friend_count' ORDER BY RAND() DESC" ) );
    170         $paged_users = $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$wpdb->base_prefix}usermeta um WHERE meta_key = 'total_friend_count' ORDER BY RAND(){$pag_sql}" ) );
     169        $total_users = $wpdb->get_var( $wpdb->prepare( "SELECT count(user_id) FROM {$wpdb->base_prefix}usermeta um ORDER BY RAND() DESC" ) );
     170        $paged_users = $wpdb->get_results( $wpdb->prepare( "SELECT user_id FROM {$wpdb->base_prefix}usermeta um ORDER BY RAND(){$pag_sql}" ) );
    171171       
    172172        return array( 'users' => $paged_users, 'total' => $total_users );
  • trunk/bp-groups.php

    r832 r840  
    691691
    692692function groups_screen_group_admin_requests() {
    693     global $bp;
     693    global $bp, $group_obj;
    694694   
    695695    if ( $bp['current_component'] == $bp['groups']['slug'] && $bp['action_variables'][0] == 'membership-requests' ) {
    696696       
    697         if ( !$bp['is_item_admin'] )
     697        if ( !$bp['is_item_admin'] || $group_obj->status == 'public' )
    698698            return false;
    699            
     699       
    700700        // Remove any screen notifications
    701701        bp_core_delete_notifications_for_user_by_type( $bp['loggedin_userid'], 'groups', 'new_membership_request' );
  • trunk/bp-groups/bp-groups-classes.php

    r797 r840  
    359359        if ( $limit && $page ) {
    360360            $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    361             $total_requests = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_confirmed = 0", $group_id ) );
    362         }
    363        
    364         $paged_requests = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_confirmed = 0{$pag_sql}", $group_id ) );
     361            $total_requests = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0", $group_id ) );
     362        }
     363       
     364        $paged_requests = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0{$pag_sql}", $group_id ) );
    365365
    366366        return array( 'requests' => $paged_requests, 'total' => $total_requests );
Note: See TracChangeset for help on using the changeset viewer.