Skip to:
Content

BuddyPress.org

Changeset 917


Ignore:
Timestamp:
01/26/2009 08:01:33 PM (16 years ago)
Author:
apeatling
Message:

Fixes #380

File:
1 edited

Legend:

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

    r884 r917  
    653653        // If the user is logged in and viewing their own groups, we can show hidden and private groups
    654654        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 ) );
    660660        }
    661661               
     
    671671        // If the user is logged in and viewing their own groups, we can show hidden and private groups
    672672        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 ) );
    678678        }
    679679       
Note: See TracChangeset for help on using the changeset viewer.