Skip to:
Content

BuddyPress.org

Changeset 854 for trunk/bp-xprofile.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-xprofile.php

    r816 r854  
    517517            if ( !$wire_post )
    518518                return false;
    519 
     519           
    520520            if ( ( $wire_post->item_id == $bp['loggedin_userid'] && $wire_post->user_id == $bp['loggedin_userid'] ) || ( $wire_post->item_id == $bp['current_userid'] && $wire_post->user_id == $bp['current_userid'] ) ) {
    521521               
    522                 $content = sprintf( __('%s wrote on their own wire', 'buddypress'), bp_core_get_userlink($wire_post->user_id) ) . ': <span class="time-since">%s</span>';               
     522                $from_user_link = bp_core_get_userlink($wire_post->user_id);
     523                $to_user_link = false;
     524                               
     525                $content = sprintf( __('%s wrote on their own wire', 'buddypress'), $from_user_link ) . ': <span class="time-since">%s</span>';             
    523526                $return_values['primary_link'] = bp_core_get_userlink( $wire_post->user_id, false, true );
    524527           
    525528            } else if ( ( $wire_post->item_id != $bp['loggedin_userid'] && $wire_post->user_id == $bp['loggedin_userid'] ) || ( $wire_post->item_id != $bp['current_userid'] && $wire_post->user_id == $bp['current_userid'] ) ) {
    526529           
    527                 $content = sprintf( __('%s wrote on %s wire', 'buddypress'), bp_core_get_userlink($wire_post->user_id), bp_core_get_userlink( $wire_post->item_id, false, false, true, true ) ) . ': <span class="time-since">%s</span>';           
     530                $from_user_link = bp_core_get_userlink($wire_post->user_id);
     531                $to_user_link = bp_core_get_userlink( $wire_post->item_id, false, false, true, true );
     532               
     533                $content = sprintf( __('%s wrote on %s wire', 'buddypress'), $from_user_link, $to_user_link ) . ': <span class="time-since">%s</span>';         
    528534                $return_values['primary_link'] = bp_core_get_userlink( $wire_post->item_id, false, true );
    529535           
     
    531537           
    532538            if ( $content != '' ) {
    533                 $content .= '<blockquote>' . bp_create_excerpt($wire_post->content) . '</blockquote>';
     539                $post_excerpt = bp_create_excerpt($wire_post->content);
     540               
     541                $content .= '<blockquote>' . $post_excerpt . '</blockquote>';
    534542                $return_values['content'] = $content;
     543               
     544                $return_values['content'] = apply_filters( 'bp_xprofile_new_wire_post_activity', $content, $from_user_link, $to_user_link, $post_excerpt );
     545               
    535546                return $return_values;
    536547            }
     
    544555                return false;
    545556           
     557            $user_link = bp_core_get_userlink($user_id);
     558           
    546559            return array(
    547560                'primary_link' => bp_core_get_userlink( $user_id, false, true ),
    548                 'content' => sprintf( __('%s updated the "%s" information on their profile', 'buddypress'), bp_core_get_userlink($user_id), '<a href="' . $bp['current_domain'] . $bp['profile']['slug'] . '">' . $profile_group->name . '</a>' ) . ' <span class="time-since">%s</span>'
     561                'content' => apply_filters( 'bp_xprofile_updated_profile_activity', sprintf( __('%s updated the "%s" information on their profile', 'buddypress'), $user_link, '<a href="' . $bp['current_domain'] . $bp['profile']['slug'] . '">' . $profile_group->name . '</a>' ) . ' <span class="time-since">%s</span>', $user_link, $profile_group->name )
    549562            );
    550563        break;
     
    572585    if ( $action == 'new_wire_post') {
    573586        if ( (int)$total_items > 1 ) {
    574             return '<a href="' . $bp['loggedin_domain'] . $bp['wire']['slug'] . '" title="Wire">' . sprintf( __('You have %d new posts on your wire'), (int)$total_items ) . '</a>';       
     587            return apply_filters( 'bp_xprofile_multiple_new_wire_post_notification', '<a href="' . $bp['loggedin_domain'] . $bp['wire']['slug'] . '" title="Wire">' . sprintf( __('You have %d new posts on your wire'), (int)$total_items ) . '</a>', $total_items );     
    575588        } else {
    576589            $user_fullname = bp_core_global_user_fullname( $item_id );
    577             return '<a href="' . $bp['loggedin_domain'] . $bp['wire']['slug'] . '" title="Wire">' . sprintf( __('%s posted on your wire'), $user_fullname ) . '</a>';
     590            return apply_filters( 'bp_xprofile_single_new_wire_post_notification', '<a href="' . $bp['loggedin_domain'] . $bp['wire']['slug'] . '" title="Wire">' . sprintf( __('%s posted on your wire'), $user_fullname ) . '</a>', $user_fullname );
    578591        }
    579592    }
Note: See TracChangeset for help on using the changeset viewer.