Changeset 1700
- Timestamp:
- 08/26/2009 01:04:32 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups.php
r1694 r1700 745 745 return false; 746 746 747 if ( !groups_new_wire_post( $bp->groups->current_group->id, $_POST['wire-post-textarea'] ) ) {747 if ( !groups_new_wire_post( $bp->groups->current_group->id, $_POST['wire-post-textarea'] ) ) 748 748 bp_core_add_message( __('Wire message could not be posted.', 'buddypress'), 'error' ); 749 } else {749 else 750 750 bp_core_add_message( __('Wire message successfully posted.', 'buddypress') ); 751 } 752 753 if ( !strpos( $_SERVER['HTTP_REFERER'], $bp->wire->slug ) ) { 751 752 if ( !strpos( $_SERVER['HTTP_REFERER'], $bp->wire->slug ) ) 754 753 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); 755 } else {754 else 756 755 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/' . $bp->wire->slug ); 757 }758 756 759 757 } else if ( 'delete' == $wire_action && groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) { … … 764 762 return false; 765 763 766 if ( !groups_delete_wire_post( $wire_message_id, $bp->groups->table_name_wire ) ) {764 if ( !groups_delete_wire_post( $wire_message_id, $bp->groups->table_name_wire ) ) 767 765 bp_core_add_message( __('There was an error deleting the wire message.', 'buddypress'), 'error' ); 768 } else {766 else 769 767 bp_core_add_message( __('Wire message successfully deleted.', 'buddypress') ); 770 } 771 772 if ( !strpos( $_SERVER['HTTP_REFERER'], $bp->wire->slug ) ) { 768 769 if ( !strpos( $_SERVER['HTTP_REFERER'], $bp->wire->slug ) ) 773 770 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); 774 } else {771 else 775 772 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/' . $bp->wire->slug ); 776 }777 773 778 774 } else if ( ( !$wire_action || 'latest' == $bp->action_variables[1] ) ) { … … 1349 1345 if ( !function_exists( 'bp_activity_add' ) ) 1350 1346 return false; 1351 1347 1348 /* If the group is not public, no recording of activity please. */ 1352 1349 if ( 'public' != $bp->groups->current_group->status ) 1353 1350 return false; … … 1928 1925 1929 1926 if ( $wire_post = bp_wire_new_post( $group_id, $content, 'groups' ) ) { 1927 1928 /* Post an email notification if settings allow */ 1929 require_once ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-notifications.php' ); 1930 groups_notification_new_wire_post( $group_id, $wire_post->id ); 1931 1932 /* Record this in activity streams */ 1930 1933 $activity_content = sprintf( __( '%s wrote on the wire of 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>' ); 1931 1934 $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $content ) ) . '</blockquote>'; … … 1939 1942 ) ); 1940 1943 1941 do_action( 'groups_new_wire_post', $group_id, $wire_post _id );1944 do_action( 'groups_new_wire_post', $group_id, $wire_post->id ); 1942 1945 1943 1946 return true; -
trunk/bp-groups/bp-groups-notifications.php
r1599 r1700 50 50 } 51 51 } 52 add_action( 'groups_new_wire_post', 'groups_notification_new_wire_post', 10, 2 );53 52 54 53 function groups_notification_group_updated( $group_id ) {
Note: See TracChangeset
for help on using the changeset viewer.