Skip to:
Content

BuddyPress.org

Changeset 1700


Ignore:
Timestamp:
08/26/2009 01:04:32 AM (17 years ago)
Author:
apeatling
Message:

Fixes #837 props DJPaul

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups.php

    r1694 r1700  
    745745                                return false;
    746746               
    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'] ) )
    748748                                bp_core_add_message( __('Wire message could not be posted.', 'buddypress'), 'error' );
    749                         } else {
     749                        else
    750750                                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 ) )
    754753                                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
    755                         } else {
     754                        else
    756755                                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/' . $bp->wire->slug );
    757                         }
    758756       
    759757                } else if ( 'delete' == $wire_action && groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
    … …  
    764762                                return false;
    765763               
    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 ) )
    767765                                bp_core_add_message( __('There was an error deleting the wire message.', 'buddypress'), 'error' );
    768                         } else {
     766                        else
    769767                                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 ) )
    773770                                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
    774                         } else {
     771                        else
    775772                                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/' . $bp->wire->slug );
    776                         }
    777773               
    778774                } else if ( ( !$wire_action || 'latest' == $bp->action_variables[1] ) ) {
    … …  
    13491345        if ( !function_exists( 'bp_activity_add' ) )
    13501346                return false;
    1351                
     1347       
     1348        /* If the group is not public, no recording of activity please. */
    13521349        if ( 'public' != $bp->groups->current_group->status )   
    13531350                return false;
    … …  
    19281925       
    19291926        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 */
    19301933                $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>' );
    19311934                $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $content ) ) . '</blockquote>';
    … …  
    19391942                ) );
    19401943
    1941                 do_action( 'groups_new_wire_post', $group_id, $wire_post_id );
     1944                do_action( 'groups_new_wire_post', $group_id, $wire_post->id );
    19421945               
    19431946                return true;
  • trunk/bp-groups/bp-groups-notifications.php

    r1599 r1700  
    5050        }
    5151}
    52 add_action( 'groups_new_wire_post', 'groups_notification_new_wire_post', 10, 2 );
    5352
    5453function groups_notification_group_updated( $group_id ) {
Note: See TracChangeset for help on using the changeset viewer.