Skip to:
Content

BuddyPress.org

Changeset 2339 for trunk/bp-groups.php


Ignore:
Timestamp:
01/18/2010 03:52:16 PM (15 years ago)
Author:
apeatling
Message:

Fixes to group invite interface and template loop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups.php

    r2332 r2339  
    22612261/*** Group Invitations *********************************************************/
    22622262
    2263 function groups_get_invites_for_user( $user_id = false ) {
     2263function groups_get_invites_for_user( $user_id = false, $limit = false, $page = false ) {
    22642264    global $bp;
    22652265
     
    22672267        $user_id = $bp->loggedin_user->id;
    22682268
    2269     return BP_Groups_Member::get_invites( $user_id );
     2269    return BP_Groups_Member::get_invites( $user_id, $limit, $page );
    22702270}
    22712271
     
    22872287        return false;
    22882288
    2289     if ( groups_is_user_member( $user_id, $group_id ) )
    2290         return false;
    2291 
    2292     $invite = new BP_Groups_Member;
    2293     $invite->group_id = $group_id;
    2294     $invite->user_id = $user_id;
    2295     $invite->date_modified = $date_modified;
    2296     $invite->inviter_id = $inviter_id;
    2297     $invite->is_confirmed = $is_confirmed;
    2298 
    2299     if ( !$invite->save() )
    2300         return false;
    2301 
    2302     do_action( 'groups_invite_user', $args );
     2289    if ( !groups_is_user_member( $user_id, $group_id ) && !groups_check_user_has_invite( $user_id, $group_id ) ) {
     2290        $invite = new BP_Groups_Member;
     2291        $invite->group_id = $group_id;
     2292        $invite->user_id = $user_id;
     2293        $invite->date_modified = $date_modified;
     2294        $invite->inviter_id = $inviter_id;
     2295        $invite->is_confirmed = $is_confirmed;
     2296
     2297        if ( !$invite->save() )
     2298            return false;
     2299
     2300        do_action( 'groups_invite_user', $args );
     2301    }
    23032302
    23042303    return true;
Note: See TracChangeset for help on using the changeset viewer.