Changeset 1763 for trunk/bp-groups.php
- Timestamp:
- 09/02/2009 08:20:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups.php
r1760 r1763 460 460 else if ( 'hidden' == $_POST['group-status'] ) 461 461 $group_status = 'hidden'; 462 463 /* Once we get to the second step, record the group creation in the activity stream. As we now know the actual status of the group */464 groups_record_activity( array(465 'content' => sprintf( __( '%s created the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ),466 'primary_link' => bp_get_group_permalink( $bp->groups->current_group ),467 'component_action' => 'created_group',468 'item_id' => $bp->groups->current_group->id,469 'user_id' => $user_id470 ) );471 462 472 463 if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $bp->groups->new_group_id, 'status' => $group_status, 'enable_wire' => $group_enable_wire, 'enable_forum' => $group_enable_forum ) ) ) { … … 499 490 unset( $bp->groups->current_create_step ); 500 491 unset( $bp->groups->completed_create_steps ); 492 493 /* Once we compelete all steps, record the group creation in the activity stream. */ 494 groups_record_activity( array( 495 'content' => sprintf( __( '%s created the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ), 496 'primary_link' => bp_get_group_permalink( $bp->groups->current_group ), 497 'component_action' => 'created_group', 498 'item_id' => $bp->groups->new_group_id 499 ) ); 501 500 502 501 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); … … 1228 1227 if ( $bp->current_component == $bp->groups->slug && 'delete-group' == $bp->action_variables[0] ) { 1229 1228 1230 if ( !$bp->is_item_admin )1229 if ( !$bp->is_item_admin && !is_site_admin() ) 1231 1230 return false; 1232 1231 … … 1237 1236 1238 1237 // Group admin has deleted the group, now do it. 1239 if ( !groups_delete_group( $_POST['group-id'] ) ) {1238 if ( !groups_delete_group( $_POST['group-id'] ) ) { 1240 1239 bp_core_add_message( __( 'There was an error deleting the group, please try again.', 'buddypress' ), 'error' ); 1241 1240 } else { … … 1420 1419 $r = wp_parse_args( $args, $defaults ); 1421 1420 extract( $r, EXTR_SKIP ); 1422 1421 1423 1422 return bp_activity_add( array( 'user_id' => $user_id, 'content' => $content, 'primary_link' => $primary_link, 'component_name' => $component_name, 'component_action' => $component_action, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 1424 1423 } … … 1688 1687 return false; 1689 1688 1690 /* Delete the activity stream item*/1689 /* Delete all group activity from activity streams */ 1691 1690 if ( function_exists( 'bp_activity_delete_by_item_id' ) ) { 1692 bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component_name' => 'groups', 'component_action' => 'created_group') );1693 } 1691 bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component_name' => $bp->groups->id ) ); 1692 } 1694 1693 1695 1694 // Remove all outstanding invites for this group … … 1989 1988 'primary_link' => bp_get_group_permalink( $bp->groups->current_group ), 1990 1989 'component_action' => 'new_wire_post', 1991 'item_id' => $ wire_post->item_id,1992 'secondary_item_id' => $ bp->groups->current_group->id1990 'item_id' => $bp->groups->current_group->id, 1991 'secondary_item_id' => $wire_post->item_id 1993 1992 ) ); 1994 1993 … … 2050 2049 'primary_link' => bp_get_group_permalink( $bp->groups->current_group ), 2051 2050 'component_action' => 'new_forum_post', 2052 'item_id' => $ topic_id,2051 'item_id' => $bp->groups->current_group->id, 2053 2052 'secondary_item_id' => $forum_post->id 2054 2053 ) ); … … 2076 2075 'primary_link' => bp_get_group_permalink( $bp->groups->current_group ), 2077 2076 'component_action' => 'new_forum_topic', 2078 'item_id' => $ topic->topic_id,2079 'secondary_item_id' => $ bp->groups->current_group->id2077 'item_id' => $bp->groups->current_group->id, 2078 'secondary_item_id' => $topic->topic_id 2080 2079 ) ); 2081 2080 … … 2103 2102 'primary_link' => bp_get_group_permalink( $bp->groups->current_group ), 2104 2103 'component_action' => 'new_forum_topic', 2105 'item_id' => (int)$ topic->topic_id,2104 'item_id' => (int)$bp->groups->current_group->id, 2106 2105 'user_id' => (int)$topic->topic_poster, 2107 'secondary_item_id' => $ bp->groups->current_group->id,2106 'secondary_item_id' => $topic->topic_id, 2108 2107 'recorded_time' => bb_gmtstrtotime( $topic->topic_time ) 2109 2108 ) ); … … 2144 2143 2145 2144 /* Update the activity stream item */ 2146 bp_activity_delete_by_item_id( array( 'item_id' => $ topic_id, 'secondary_item_id' => $post_id, 'component_name' => 'groups', 'component_action' => 'new_forum_post' ) );2145 bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component_name' => 'groups', 'component_action' => 'new_forum_post' ) ); 2147 2146 2148 2147 $activity_content = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '/forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' ); … … 2154 2153 'primary_link' => bp_get_group_permalink( $bp->groups->current_group ), 2155 2154 'component_action' => 'new_forum_post', 2156 'item_id' => $ topic_id,2155 'item_id' => $bp->groups->current_group->id, 2157 2156 'secondary_item_id' => $post_id, 2158 2157 'recorded_time' => bb_gmtstrtotime( $post->post_time ) … … 2561 2560 /*** Group Cleanup Functions ****************************************************/ 2562 2561 2563 function groups_remove_data ( $user_id ) {2562 function groups_remove_data_for_user( $user_id ) { 2564 2563 BP_Groups_Member::delete_all_for_user($user_id); 2565 2564 2566 do_action( 'groups_remove_data ', $user_id );2567 } 2568 add_action( 'wpmu_delete_user', 'groups_remove_data ', 1 );2569 add_action( 'delete_user', 'groups_remove_data ', 1 );2565 do_action( 'groups_remove_data_for_user', $user_id ); 2566 } 2567 add_action( 'wpmu_delete_user', 'groups_remove_data_for_user', 1 ); 2568 add_action( 'delete_user', 'groups_remove_data_for_user', 1 ); 2570 2569 2571 2570 function groups_clear_group_object_cache( $group_id ) {
Note: See TracChangeset
for help on using the changeset viewer.