Skip to:
Content

BuddyPress.org

Changeset 854 for trunk/bp-friends.php


Ignore:
Timestamp:
01/16/2009 09:00:46 PM (16 years ago)
Author:
apeatling
Message:

Added filters to all activity and notification formatting functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-friends.php

    r805 r854  
    227227           
    228228            if ( $for_secondary_user ) {
     229               
     230                $user_1 = bp_core_get_userlink( $friendship->initiator_user_id );
     231                $user_2 = bp_core_get_userlink($friendship->friend_user_id, false, false, true);
     232               
    229233                return array(
    230234                    'primary_link' => bp_core_get_userlink( $friendship->friend_user_id, false, true ),
    231                     'content' => sprintf( __( '%s and %s are now friends', 'buddypress' ), bp_core_get_userlink( $friendship->initiator_user_id ), bp_core_get_userlink($friendship->friend_user_id, false, false, true) ) . ' <span class="time-since">%s</span>'
     235                    'content' => apply_filters( 'bp_friends_friendship_accepted_activity', sprintf( __( '%s and %s are now friends', 'buddypress' ), $user_1, $user_2 ) . ' <span class="time-since">%s</span>', $user_1, $user_2 )
    232236                );             
    233237            } else {
     238                $user_1 = bp_core_get_userlink( $friendship->friend_user_id );
     239                $user_2 = bp_core_get_userlink($friendship->initiator_user_id);
     240               
    234241                return array(
    235242                    'primary_link' => bp_core_get_userlink( $friendship->friend_user_id, false, true ),
    236                     'content' => sprintf( __( '%s and %s are now friends', 'buddypress' ), bp_core_get_userlink( $friendship->friend_user_id ), bp_core_get_userlink($friendship->initiator_user_id) ) . ' <span class="time-since">%s</span>'
     243                    'content' => apply_filters( 'bp_friends_friendship_accepted_activity', sprintf( __( '%s and %s are now friends', 'buddypress' ), bp_core_get_userlink( $friendship->friend_user_id ), bp_core_get_userlink($friendship->initiator_user_id) ) . ' <span class="time-since">%s</span>', $user_1, $user_2 )
    237244                );             
    238245            }
     
    250257        case 'friendship_accepted':
    251258            if ( (int)$total_items > 1 ) {
    252                 return '<a href="' . $bp['loggedin_domain'] . $bp['friends']['slug'] . '/my-friends/newest" title="' . __( 'My Friends', 'buddypress' ) . '">' . sprintf( __('%d friends accepted your friendship requests'), (int)$total_items ) . '</a>';     
     259                return apply_filters( 'bp_friends_multiple_friendship_accepted_notification', '<a href="' . $bp['loggedin_domain'] . $bp['friends']['slug'] . '/my-friends/newest" title="' . __( 'My Friends', 'buddypress' ) . '">' . sprintf( __('%d friends accepted your friendship requests'), (int)$total_items ) . '</a>', (int)$total_items );     
    253260            } else {
    254261                $user_fullname = bp_core_global_user_fullname( $item_id );
    255262                $user_url = bp_core_get_userurl( $item_id );
    256                 return '<a href="' . $user_url . '?new" title="' . $user_fullname .'\'s profile">' . sprintf( __('%s accepted your friendship request'), $user_fullname ) . '</a>';
     263                return apply_filters( 'bp_friends_single_friendship_accepted_notification', '<a href="' . $user_url . '?new" title="' . $user_fullname .'\'s profile">' . sprintf( __('%s accepted your friendship request'), $user_fullname ) . '</a>', $user_fullname );
    257264            }   
    258265        break;
     
    260267        case 'friendship_request':
    261268            if ( (int)$total_items > 1 ) {
    262                 return '<a href="' . $bp['loggedin_domain'] . $bp['friends']['slug'] . '/requests" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have %d pending friendship requests'), (int)$total_items ) . '</a>';     
     269                return apply_filters( 'bp_friends_multiple_friendship_request_notification', '<a href="' . $bp['loggedin_domain'] . $bp['friends']['slug'] . '/requests" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have %d pending friendship requests'), (int)$total_items ) . '</a>', $total_items );       
    263270            } else {
    264271                $user_fullname = bp_core_global_user_fullname( $item_id );
    265272                $user_url = bp_core_get_userurl( $item_id );
    266                 return '<a href="' . $bp['loggedin_domain'] . $bp['friends']['slug'] . '/requests" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have a friendship request from %s'), $user_fullname ) . '</a>';
     273                return apply_filters( 'bp_friends_single_friendship_request_notification', '<a href="' . $bp['loggedin_domain'] . $bp['friends']['slug'] . '/requests" title="' . __( 'Friendship requests', 'buddypress' ) . '">' . sprintf( __('You have a friendship request from %s'), $user_fullname ) . '</a>', $user_fullname );
    267274            }   
    268275        break;
Note: See TracChangeset for help on using the changeset viewer.