Changeset 3408 for trunk/bp-groups.php
- Timestamp:
- 11/13/2010 11:18:48 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups.php
r3371 r3408 1695 1695 $user_id = $bp->loggedin_user->id; 1696 1696 1697 / * Check if the user has an outstanding invite, is so delete it. */1697 // Check if the user has an outstanding invite, is so delete it. 1698 1698 if ( groups_check_user_has_invite( $user_id, $group_id ) ) 1699 1699 groups_delete_invite( $user_id, $group_id ); 1700 1700 1701 / * Check if the user has an outstanding request, is so delete it. */1701 // Check if the user has an outstanding request, is so delete it. 1702 1702 if ( groups_check_for_membership_request( $user_id, $group_id ) ) 1703 1703 groups_delete_membership_request( $user_id, $group_id ); 1704 1704 1705 / * User is already a member, just return true */1705 // User is already a member, just return true 1706 1706 if ( groups_is_user_member( $user_id, $group_id ) ) 1707 1707 return true; 1708 1709 if ( !$bp->groups->current_group )1710 $bp->groups->current_group = new BP_Groups_Group( $group_id );1711 1708 1712 1709 $new_member = new BP_Groups_Member; … … 1722 1719 return false; 1723 1720 1724 /* Record this in activity streams */ 1721 if ( !isset( $bp->groups->current_group ) || !$bp->groups->current_group || $group_id != $bp->groups->current_group->id ) 1722 $group = new BP_Groups_Group( $group_id ); 1723 else 1724 $group = $bp->groups->current_group; 1725 1726 // Record this in activity streams 1725 1727 groups_record_activity( array( 1726 'action' => apply_filters( 'groups_activity_joined_group', sprintf( __( '%1$s joined the group %2$s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $ bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name) . '</a>' ) ),1728 'action' => apply_filters( 'groups_activity_joined_group', sprintf( __( '%1$s joined the group %2$s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( bp_get_group_name( $group ) ) . '</a>' ) ), 1727 1729 'type' => 'joined_group', 1728 'item_id' => $group_id 1730 'item_id' => $group_id, 1731 'user_id' => $user_id 1729 1732 ) ); 1730 1733 1731 / * Modify group meta */1734 // Modify group meta 1732 1735 groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') + 1 ); 1733 1736 groups_update_groupmeta( $group_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
Note: See TracChangeset
for help on using the changeset viewer.