Changeset 10253 for trunk/src/bp-activity/bp-activity-notifications.php
- Timestamp:
- 10/12/2015 05:45:14 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-notifications.php
r10077 r10253 7 7 */ 8 8 9 // Exit if accessed directly 9 // Exit if accessed directly. 10 10 defined( 'ABSPATH' ) || exit; 11 11 … … 41 41 function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) { 42 42 43 // Don't leave multiple notifications for the same activity item 43 // Don't leave multiple notifications for the same activity item. 44 44 $notifications = BP_Core_Notification::get_all_for_user( $receiver_user_id, 'all' ); 45 45 … … 56 56 $content = ''; 57 57 58 // Now email the user with the contents of the message (if they have enabled email notifications) 58 // Now email the user with the contents of the message (if they have enabled email notifications). 59 59 if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) { 60 60 $poster_name = bp_core_get_user_displayname( $activity->user_id ); … … 67 67 $content = bp_activity_filter_kses( strip_tags( stripslashes( $activity->content ) ) ); 68 68 69 // Set up and send the message 69 // Set up and send the message. 70 70 $ud = bp_core_get_core_userdata( $receiver_user_id ); 71 71 $to = $ud->user_email; … … 94 94 } 95 95 96 // Only show the disable notifications line if the settings component is enabled 96 // Only show the disable notifications line if the settings component is enabled. 97 97 if ( bp_is_active( 'settings' ) ) { 98 98 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); … … 175 175 * @param int $comment_id The comment id. 176 176 * @param int $commenter_id The ID of the user who posted the comment. 177 * @param array $params {@link bp_activity_new_comment()} 178 * 177 * @param array $params {@link bp_activity_new_comment()}. 179 178 * @return bool 180 179 */ 181 180 function bp_activity_new_comment_notification( $comment_id = 0, $commenter_id = 0, $params = array() ) { 182 181 183 // Set some default parameters 182 // Set some default parameters. 184 183 $activity_id = 0; 185 184 $parent_id = 0; … … 198 197 $content = bp_activity_filter_kses( stripslashes($content) ); 199 198 200 // Set up and send the message 199 // Set up and send the message. 201 200 $ud = bp_core_get_core_userdata( $original_activity->user_id ); 202 201 $to = $ud->user_email; … … 212 211 ', 'buddypress' ), $poster_name, $content, $thread_link ); 213 212 214 // Only show the disable notifications line if the settings component is enabled 213 // Only show the disable notifications line if the settings component is enabled. 215 214 if ( bp_is_active( 'settings' ) ) { 216 215 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); … … 266 265 } 267 266 268 /* **267 /* 269 268 * If this is a reply to another comment, send an email notification to the 270 269 * author of the immediate parent comment. … … 282 281 $settings_link = bp_core_get_user_domain( $parent_comment->user_id ) . $settings_slug . '/notifications/'; 283 282 284 // Set up and send the message 283 // Set up and send the message. 285 284 $ud = bp_core_get_core_userdata( $parent_comment->user_id ); 286 285 $to = $ud->user_email; … … 300 299 ', 'buddypress' ), $poster_name, $content, $thread_link ); 301 300 302 // Only show the disable notifications line if the settings component is enabled 301 // Only show the disable notifications line if the settings component is enabled. 303 302 if ( bp_is_active( 'settings' ) ) { 304 303 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); … … 360 359 * @since 1.9.0 361 360 * 362 * @param int $comment_id 363 * @param array $params 361 * @param int $comment_id ID of the comment being notified about. 362 * @param array $params Parameters to use with notification. 364 363 */ 365 364 function bp_activity_new_comment_notification_helper( $comment_id, $params ) { … … 387 386 * @param int $total_items The total number of notifications to format. 388 387 * @param string $format 'string' to get a BuddyBar-compatible notification, 'array' otherwise. 389 *390 388 * @return string $return Formatted @mention notification. 391 389 */ … … 476 474 * @since 1.9.0 477 475 * 478 * @param object $activity 479 * @param string $subject (not used) 480 * @param string $message (not used) 481 * @param string $content (not used) 482 * @param int $receiver_user_id 476 * @param object $activity Activity object. 477 * @param string $subject (not used) Notification subject. 478 * @param string $message (not used) Notification message. 479 * @param string $content (not used) Notification content. 480 * @param int $receiver_user_id ID of user receiving notification. 483 481 */ 484 482 function bp_activity_at_mention_add_notification( $activity, $subject, $message, $content, $receiver_user_id ) { … … 509 507 } 510 508 511 // Only mark read if you're looking at your own mentions 509 // Only mark read if you're looking at your own mentions. 512 510 if ( ! bp_is_my_profile() ) { 513 511 return; … … 523 521 * @since 2.0.0 524 522 * 525 * @param object BP_Activity_Activity523 * @param BP_Activity_Activity $activity Activity object. 526 524 */ 527 525 function bp_activity_remove_screen_notifications_single_activity_permalink( $activity ) { … … 534 532 } 535 533 536 // Mark as read any notifications for the current user related to this 537 // activity item 534 // Mark as read any notifications for the current user related to this activity item. 538 535 bp_notifications_mark_notifications_by_item_id( bp_loggedin_user_id(), $activity->id, buddypress()->activity->id, 'new_at_mention' ); 539 536 } … … 549 546 function bp_activity_at_mention_delete_notification( $activity_ids_deleted = array() ) { 550 547 // Let's delete all without checking if content contains any mentions 551 // to avoid a query to get the activity 548 // to avoid a query to get the activity. 552 549 if ( bp_is_active( 'notifications' ) && ! empty( $activity_ids_deleted ) ) { 553 550 foreach ( $activity_ids_deleted as $activity_id ) {
Note: See TracChangeset
for help on using the changeset viewer.