Changeset 917
- Timestamp:
- 01/26/2009 08:01:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r884 r917 653 653 // If the user is logged in and viewing their own groups, we can show hidden and private groups 654 654 if ( bp_is_home() ) { 655 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT group_id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND inviter_id = 0 AND is_banned = 0 ORDER BY date_modified ASC {$pag_sql}", $user_id ) );656 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(group_id) FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND inviter_id = 0 AND is_banned = 0 ORDER BY date_modified ASC", $user_id ) );657 } else { 658 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM " . $bp['groups']['table_name_members'] . " m, " . $bp['groups']['table_name'] . " g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY date_modified ASC {$pag_sql}", $user_id ) );659 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM " . $bp['groups']['table_name_members'] . " m, " . $bp['groups']['table_name'] . " g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY date_modified ASC", $user_id ) );655 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT group_id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND inviter_id = 0 AND is_banned = 0 AND is_confirmed = 1 ORDER BY date_modified ASC {$pag_sql}", $user_id ) ); 656 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(group_id) FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND inviter_id = 0 AND is_banned = 0 AND is_confirmed = 1 ORDER BY date_modified ASC", $user_id ) ); 657 } else { 658 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM " . $bp['groups']['table_name_members'] . " m, " . $bp['groups']['table_name'] . " g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_confirmed = 1 ORDER BY date_modified ASC {$pag_sql}", $user_id ) ); 659 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM " . $bp['groups']['table_name_members'] . " m, " . $bp['groups']['table_name'] . " g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_confirmed = 1 ORDER BY date_modified ASC", $user_id ) ); 660 660 } 661 661 … … 671 671 // If the user is logged in and viewing their own groups, we can show hidden and private groups 672 672 if ( bp_is_home() ) { 673 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM " . $bp['groups']['table_name_members'] . " m, " . $bp['groups']['table_name_groupmeta'] . " gm WHERE m.group_id = gm.group_id AND gm.meta_key = 'total_member_count' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY CONVERT( gm.meta_value, SIGNED ) DESC {$pag_sql}", $user_id ) );674 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM " . $bp['groups']['table_name_members'] . " m, " . $bp['groups']['table_name_groupmeta'] . " gm WHERE m.group_id = gm.group_id AND gm.meta_key = 'total_member_count' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY CONVERT( gm.meta_value, SIGNED ) DESC", $user_id ) );675 } else { 676 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM " . $bp['groups']['table_name_members'] . " m LEFT JOIN " . $bp['groups']['table_name'] . " g ON m.group_id = g.id LEFT JOIN " . $bp['groups']['table_name_groupmeta'] . " gm ON m.group_id = gm.group_id AND gm.meta_key = 'total_member_count' AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY CONVERT( gm.meta_value, SIGNED ) DESC {$pag_sql}", $user_id ) );677 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM " . $bp['groups']['table_name_members'] . " m LEFT JOIN " . $bp['groups']['table_name'] . " g ON m.group_id = g.id LEFT JOIN " . $bp['groups']['table_name_groupmeta'] . " gm ON m.group_id = gm.group_id AND gm.meta_key = 'total_member_count' AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 ORDER BY CONVERT( gm.meta_value, SIGNED ) DESC", $user_id ) );673 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM " . $bp['groups']['table_name_members'] . " m, " . $bp['groups']['table_name_groupmeta'] . " gm WHERE m.group_id = gm.group_id AND gm.meta_key = 'total_member_count' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_confirmed = 1 ORDER BY CONVERT( gm.meta_value, SIGNED ) DESC {$pag_sql}", $user_id ) ); 674 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM " . $bp['groups']['table_name_members'] . " m, " . $bp['groups']['table_name_groupmeta'] . " gm WHERE m.group_id = gm.group_id AND gm.meta_key = 'total_member_count' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_confirmed = 1 ORDER BY CONVERT( gm.meta_value, SIGNED ) DESC", $user_id ) ); 675 } else { 676 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM " . $bp['groups']['table_name_members'] . " m LEFT JOIN " . $bp['groups']['table_name'] . " g ON m.group_id = g.id LEFT JOIN " . $bp['groups']['table_name_groupmeta'] . " gm ON m.group_id = gm.group_id AND gm.meta_key = 'total_member_count' AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_confirmed = 1 ORDER BY CONVERT( gm.meta_value, SIGNED ) DESC {$pag_sql}", $user_id ) ); 677 $total_groups = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(m.group_id) FROM " . $bp['groups']['table_name_members'] . " m LEFT JOIN " . $bp['groups']['table_name'] . " g ON m.group_id = g.id LEFT JOIN " . $bp['groups']['table_name_groupmeta'] . " gm ON m.group_id = gm.group_id AND gm.meta_key = 'total_member_count' AND g.status != 'hidden' AND m.user_id = %d AND m.inviter_id = 0 AND m.is_banned = 0 AND m.is_confirmed = 1 ORDER BY CONVERT( gm.meta_value, SIGNED ) DESC", $user_id ) ); 678 678 } 679 679
Note: See TracChangeset
for help on using the changeset viewer.