Changeset 840
- Timestamp:
- 01/13/2009 12:13:56 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-classes.php
r813 r840 167 167 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 168 168 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}" ) ); 171 171 172 172 return array( 'users' => $paged_users, 'total' => $total_users ); -
trunk/bp-groups.php
r832 r840 691 691 692 692 function groups_screen_group_admin_requests() { 693 global $bp ;693 global $bp, $group_obj; 694 694 695 695 if ( $bp['current_component'] == $bp['groups']['slug'] && $bp['action_variables'][0] == 'membership-requests' ) { 696 696 697 if ( !$bp['is_item_admin'] )697 if ( !$bp['is_item_admin'] || $group_obj->status == 'public' ) 698 698 return false; 699 699 700 700 // Remove any screen notifications 701 701 bp_core_delete_notifications_for_user_by_type( $bp['loggedin_userid'], 'groups', 'new_membership_request' ); -
trunk/bp-groups/bp-groups-classes.php
r797 r840 359 359 if ( $limit && $page ) { 360 360 $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 ) ); 365 365 366 366 return array( 'requests' => $paged_requests, 'total' => $total_requests );
Note: See TracChangeset
for help on using the changeset viewer.