Skip to:
Content

BuddyPress.org

Changeset 4277


Ignore:
Timestamp:
04/24/2011 12:33:51 PM (15 years ago)
Author:
djpaul
Message:

Fix at-notifications to work when BP_ENABLE_USERNAME_COMPATIBILITY_MODE is not set and user_nicename != user_login

Location:
trunk/bp-activity
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-filters.php

    r4259 r4277  
    117117
    118118        foreach( (array)$usernames as $username ) {
    119                 if ( !$user_id = username_exists( $username ) )
     119                if ( defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) )
     120                        $user_id = username_exists( $username );
     121                else
     122                        $user_id = bp_core_get_userid_from_nicename( $username );
     123
     124                if ( empty( $user_id ) )
    120125                        continue;
    121126
    … …  
    124129                update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 );
    125130
    126                 $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( bp_core_get_userid( $username ) ) . "' rel='nofollow'>@$username</a>", $content );
     131                $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content );
    127132        }
    128133
  • trunk/bp-activity/bp-activity-functions.php

    r4259 r4277  
    4343        if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) {
    4444                foreach( (array)$usernames as $username ) {
    45                         if ( !$user_id = username_exists( $username ) )
     45                        if ( defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) )
     46                                $user_id = username_exists( $username );
     47                        else
     48                                $user_id = bp_core_get_userid_from_nicename( $username );
     49
     50                        if ( empty( $user_id ) )
    4651                                continue;
    4752
  • trunk/bp-activity/bp-activity-notifications.php

    r4144 r4277  
    2121
    2222        foreach( (array)$usernames as $username ) {
    23                 if ( !$receiver_user_id = bp_core_get_userid( $username ) )
     23                if ( defined( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' ) )
     24                        $receiver_user_id = bp_core_get_userid( $username );
     25                else
     26                        $receiver_user_id = bp_core_get_userid_from_nicename( $username );
     27
     28                if ( empty( $receiver_user_id ) )
    2429                        continue;
    2530
Note: See TracChangeset for help on using the changeset viewer.