Changeset 3592 for trunk/bp-activity.php
- Timestamp:
- 12/27/2010 10:57:31 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r3580 r3592 509 509 * @package BuddyPress Activity 510 510 * @since 1.3 511 * 511 * 512 512 * @param $content The content of the activity, usually found in $activity->content 513 513 * @return array $usernames Array of the found usernames that match existing users … … 516 516 $pattern = '/[@]+([A-Za-z0-9-_\.]+)/'; 517 517 preg_match_all( $pattern, $content, $usernames ); 518 518 519 519 // Make sure there's only one instance of each username 520 520 if ( !$usernames = array_unique( $usernames[1] ) ) 521 521 return false; 522 522 523 523 return $usernames; 524 524 } … … 531 531 * @package BuddyPress Activity 532 532 * @since 1.3 533 * 533 * 534 534 * @param $activity_id The unique id for the activity item 535 535 */ 536 536 function bp_activity_reduce_mention_count( $activity_id ) { 537 537 $activity = new BP_Activity_Activity( $activity_id ); 538 539 if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) { 538 539 if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) { 540 540 include_once( ABSPATH . WPINC . '/registration.php' ); 541 542 foreach( (array)$usernames as $username ) { 541 542 foreach( (array)$usernames as $username ) { 543 543 if ( !$user_id = username_exists( $username ) ) 544 544 continue; 545 545 546 546 // Decrease the number of new @ mentions for the user 547 547 $new_mention_count = (int)get_user_meta( $user_id, 'bp_new_mention_count', true ); … … 578 578 } else { 579 579 $user_fullname = bp_core_get_user_displayname( $poster_user_id ); 580 580 581 581 return apply_filters( 'bp_activity_single_at_mentions_notification', '<a href="' . $at_mention_link . '" title="' . $at_mention_title . '">' . sprintf( __( '%1$s mentioned you in an activity update', 'buddypress' ), $user_fullname ) . '</a>', $at_mention_link, $total_items, $activity_id, $poster_user_id ); 582 582 } … … 999 999 1000 1000 $image = '<img src="' . esc_attr( $src ) . '" width="' . $new_width . '" height="' . $new_height . '" alt="' . __( 'Thumbnail', 'buddypress' ) . '" class="align-left thumbnail" />'; 1001 1001 1002 1002 if ( !empty( $link ) ) { 1003 1003 $image = '<a href="' . $link . '">' . $image . '</a>'; … … 1224 1224 /** 1225 1225 * updates_register_activity_actions() 1226 * 1226 * 1227 1227 * Register the activity stream actions for updates 1228 * 1228 * 1229 1229 * @global array $bp 1230 1230 */
Note: See TracChangeset
for help on using the changeset viewer.