Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/06/2014 07:58:49 PM (10 years ago)
Author:
boonebgorges
Message:

Replace internals of BP_Group_Membership_Requests_Template with BP_Group_Member_Query

This brings us more in line with the Invites template functions, and is another
step toward centralizing all of our group queries.

The change also allows for true pagination. This changeset also adds the 'page'
parameter to the stack.

See #5440

Props dcavins

File:
1 edited

Legend:

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

    r8061 r8069  
    14551455 * - *Pending and unsent invitations* are entries with is_confirmed = 0 and
    14561456 *   inviter_id != 0 and invite_sent = 0
     1457 * - *Membership requests* are entries with is_confirmed = 0 and
     1458 *   inviter_id = 0 (and invite_sent = 0)
    14571459 *
    14581460 * @since BuddyPress (1.8.0)
     
    17231725
    17241726        $bp     = buddypress();
    1725         $extras = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified, is_banned FROM {$bp->groups->table_name_members} WHERE user_id IN ({$user_ids_sql}) AND group_id = %d", $this->query_vars['group_id'] ) );
     1727        $extras = $wpdb->get_results( $wpdb->prepare( "SELECT id, user_id, date_modified, is_admin, is_mod, comments, user_title, invite_sent, is_confirmed, inviter_id, is_banned FROM {$bp->groups->table_name_members} WHERE user_id IN ({$user_ids_sql}) AND group_id = %d", $this->query_vars['group_id'] ) );
    17261728
    17271729        foreach ( (array) $extras as $extra ) {
     
    17291731                // user_id is provided for backward compatibility
    17301732                $this->results[ $extra->user_id ]->user_id       = (int) $extra->user_id;
     1733                $this->results[ $extra->user_id ]->is_admin      = (int) $extra->is_admin;
     1734                $this->results[ $extra->user_id ]->is_mod        = (int) $extra->is_mod;
    17311735                $this->results[ $extra->user_id ]->is_banned     = (int) $extra->is_banned;
    17321736                $this->results[ $extra->user_id ]->date_modified = $extra->date_modified;
     1737                $this->results[ $extra->user_id ]->user_title    = $extra->user_title;
     1738                $this->results[ $extra->user_id ]->comments      = $extra->comments;
     1739                $this->results[ $extra->user_id ]->invite_sent   = (int) $extra->invite_sent;
     1740                $this->results[ $extra->user_id ]->inviter_id    = (int) $extra->inviter_id;
     1741                $this->results[ $extra->user_id ]->is_confirmed  = (int) $extra->is_confirmed;
     1742                $this->results[ $extra->user_id ]->membership_id = (int) $extra->id;
    17331743            }
    17341744        }
Note: See TracChangeset for help on using the changeset viewer.