Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/25/2011 08:58:56 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Rename new 'bp-users' component to 'bp-members' for consistency through-out project.
Core, Messages, and Friends Components now use the BP_Component class.
Split Friends and Messages components into smaller files.
Change references to 'profile' to 'xprofile' through-out project for consistency.
Introduce 'bp_actions' and 'bp_screens' standard hooks to replace the usage of 'wp' through-out project.
Move component loader sequence into bp-core-bootstrap.php,
Move old root_component action into 1.3 deprecated file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-functions.php

    r3903 r3917  
    8585        // Send screen notifications to the recipients
    8686        foreach ( (array)$message->recipients as $recipient )
    87             bp_users_add_notification( $message->id, $recipient->user_id, 'messages', 'new_message' );
     87            bp_members_add_notification( $message->id, $recipient->user_id, 'messages', 'new_message' );
    8888
    8989        // Send email notifications to the recipients
     
    193193}
    194194
     195/*******************************************************************************
     196 * These functions handle the recording, deleting and formatting of activity and
     197 * notifications for the user and for this specific component.
     198 */
     199
     200function messages_format_notifications( $action, $item_id, $secondary_item_id, $total_items ) {
     201    global $bp;
     202
     203    if ( 'new_message' == $action ) {
     204        if ( (int)$total_items > 1 )
     205            return apply_filters( 'bp_messages_multiple_new_message_notification', '<a href="' . $bp->loggedin_user->domain . $bp->messages->slug . '/inbox" title="' . __( 'Inbox', 'buddypress' ) . '">' . sprintf( __('You have %d new messages', 'buddypress' ), (int)$total_items ) . '</a>', $total_items );
     206        else
     207            return apply_filters( 'bp_messages_single_new_message_notification', '<a href="' . $bp->loggedin_user->domain . $bp->messages->slug . '/inbox" title="' . __( 'Inbox', 'buddypress' ) . '">' . sprintf( __('You have %d new message', 'buddypress' ), (int)$total_items ) . '</a>', $total_items );
     208    }
     209
     210    do_action( 'messages_format_notifications', $action, $item_id, $secondary_item_id, $total_items );
     211
     212    return false;
     213}
     214
    195215?>
Note: See TracChangeset for help on using the changeset viewer.