Changeset 2450
- Timestamp:
- 01/25/2010 02:48:13 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages.php
r2408 r2450 453 453 return false; 454 454 455 $message->recipients = $recipient_ids; 455 /* Format this to match existing recipients */ 456 foreach( $recipient_ids as $i => $recipient_id ) { 457 $message->recipients[$i] = new stdClass; 458 $message->recipients[$i]->user_id = $recipient_id; 459 } 456 460 } 457 461 … … 464 468 465 469 // Send email notifications to the recipients 466 messages_notification_new_message( array( ' item_id' => $message->id, 'recipient_ids' => $message->recipients, 'thread_id' => $message->thread_id, 'component_name' => $bp->messages->slug, 'component_action' => 'message_sent', 'is_private' => 1) );470 messages_notification_new_message( array( 'message_id' => $message->id, 'sender_id' => $message->sender_id, 'subject' => $message->subject, 'content' => $message->message, 'recipients' => $message->recipients, 'thread_id' => $message->thread_id) ); 467 471 468 472 do_action( 'messages_message_sent', &$message ); -
trunk/bp-messages/bp-messages-classes.php
r2408 r2450 295 295 /* Add an recipient entry for all recipients */ 296 296 foreach ( (array)$this->recipients as $recipient ) 297 $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_recipients} ( user_id, thread_id, unread_count ) VALUES ( %d, %d, 1 )", $recipient , $this->thread_id ) );297 $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_recipients} ( user_id, thread_id, unread_count ) VALUES ( %d, %d, 1 )", $recipient->user_id, $this->thread_id ) ); 298 298 299 299 /* Add a sender recipient entry if the sender is not in the list of recipients */ -
trunk/bp-messages/bp-messages-notifications.php
r2408 r2450 5 5 extract($args); 6 6 7 $message = new BP_Messages_Message( $item_id ); 8 9 $sender_name = bp_core_get_user_displayname( $message->sender_id ); 7 $sender_name = bp_core_get_user_displayname( $sender_id ); 10 8 11 9 for ( $i = 0; $i < count($recipients); $i++ ) { 12 if ( $ message->sender_id == $recipients[$i]->user_id || 'no' == get_usermeta( $recipients[$i]->user_id, 'notification_messages_new_message' ) ) continue;10 if ( $sender_id == $recipients[$i]->user_id || 'no' == get_usermeta( $recipients[$i]->user_id, 'notification_messages_new_message' ) ) continue; 13 11 14 12 $ud = get_userdata( $recipients[$i]->user_id ); 15 $message_link = bp_core_get_user_domain( $recipients[$i]->user_id ) . 'messages/view/' . $message ->id;13 $message_link = bp_core_get_user_domain( $recipients[$i]->user_id ) . 'messages/view/' . $message_id; 16 14 $settings_link = bp_core_get_user_domain( $recipients[$i]->user_id ) . 'settings/notifications'; 17 15 18 16 // Set up and send the message 19 17 $to = $ud->user_email; 20 $ subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), stripslashes( $sender_name ) );18 $email_subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), stripslashes( $sender_name ) ); 21 19 22 $ content = sprintf( __(20 $email_content = sprintf( __( 23 21 '%s sent you a new message: 24 22 … … 30 28 31 29 --------------------- 32 ', 'buddypress' ), $sender_name, stripslashes( wp_filter_kses( $ message->subject ) ), stripslashes( wp_filter_kses( $message->message) ), $message_link );30 ', 'buddypress' ), $sender_name, stripslashes( wp_filter_kses( $subject ) ), stripslashes( wp_filter_kses( $content ) ), $message_link ); 33 31 34 32 $content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); 35 33 36 34 // Send it 37 wp_mail( $to, $ subject, $content );35 wp_mail( $to, $email_subject, $email_content ); 38 36 } 39 37 } 40 41 38 42 39 /* This is too expensive to send on normal servers uncomment action at your own risk. */ -
trunk/bp-themes/bp-default/sidebar.php
r2448 r2450 9 9 10 10 <div id="sidebar-me"> 11 <a href="<?php echo bp_loggedin_user_domain() ?>" title="<?php _e( 'My Profile', 'buddypress' ) ?>">11 <a href="<?php echo bp_loggedin_user_domain() ?>"> 12 12 <?php bp_loggedin_user_avatar( 'type=thumb&width=40&height=40' ) ?> 13 13 </a>
Note: See TracChangeset
for help on using the changeset viewer.