Changeset 6545 for trunk/bp-messages/bp-messages-actions.php
- Timestamp:
- 11/30/2012 11:42:31 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages/bp-messages-actions.php
r6342 r6545 15 15 if ( !defined( 'ABSPATH' ) ) exit; 16 16 17 function messages_action_ view_message() {18 global $thread_id , $bp;17 function messages_action_conversation() { 18 global $thread_id; 19 19 20 20 if ( !bp_is_messages_component() || !bp_is_current_action( 'view' ) ) … … 33 33 34 34 // Send the reply 35 if ( messages_new_message( array( 'thread_id' => $thread_id, 'subject' => ! empty( $_POST['subject'] ) ? $_POST['subject'] : false, 'content' => $_POST['content'] ) ) ) 35 if ( messages_new_message( array( 'thread_id' => $thread_id, 'subject' => ! empty( $_POST['subject'] ) ? $_POST['subject'] : false, 'content' => $_POST['content'] ) ) ) { 36 36 bp_core_add_message( __( 'Your reply was sent successfully', 'buddypress' ) ); 37 else37 } else { 38 38 bp_core_add_message( __( 'There was a problem sending your reply, please try again', 'buddypress' ), 'error' ); 39 } 39 40 40 41 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id . '/' ); … … 44 45 messages_mark_thread_read( $thread_id ); 45 46 46 // Decrease the unread count in the nav before it's rendered 47 $name = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() ); 48 49 $bp->bp_nav[$bp->messages->slug]['name'] = $name; 50 51 do_action( 'messages_action_view_message' ); 52 53 bp_core_new_subnav_item( array( 54 'name' => sprintf( __( 'From: %s', 'buddypress' ), BP_Messages_Thread::get_last_sender( $thread_id ) ), 55 'slug' => 'view', 56 'parent_url' => trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() ), 57 'parent_slug' => bp_get_messages_slug(), 58 'screen_function' => true, 59 'position' => 40, 60 'user_has_access' => bp_is_my_profile(), 61 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . (int) $thread_id ) 62 ) ); 63 64 bp_core_load_template( apply_filters( 'messages_template_view_message', 'members/single/home' ) ); 47 do_action( 'messages_action_conversation' ); 65 48 } 66 add_action( 'bp_actions', 'messages_action_ view_message' );49 add_action( 'bp_actions', 'messages_action_conversation' ); 67 50 68 51 function messages_action_delete_message() {
Note: See TracChangeset
for help on using the changeset viewer.