Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/22/2011 08:30:22 PM (15 years ago)
Author:
boonebgorges
Message:

Adds Read More functionality to activity comments. Adds AJAX functionality to activity Read More. Fixes #2635. Fixes bugs with the way that activity comment content and meta links are displayed. Fixes #3168.

File:
1 edited

Legend:

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

    r4229 r4239  
    157157 */
    158158function bp_activity_truncate_entry( $text ) {
     159    global $activities_template;
     160   
    159161    // The full text of the activity update should always show on the single activity screen
    160162    if ( bp_is_single_activity() )
     
    164166    $excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
    165167    $excerpt        = $text;
    166 
     168   
     169    $id     = !empty( $activities_template->activity->current_comment->id ) ? 'acomment-read-more-' . $activities_template->activity->current_comment->id : 'activity-read-more-' . bp_get_activity_id();
     170   
    167171    if ( strlen( $excerpt ) > $excerpt_length )
    168         $excerpt = sprintf( '%1$s<span class="activity-read-more"><a href="%2$s" rel="nofollow">%3$s</a></span>', bp_create_excerpt( $excerpt, $excerpt_length, true, '&hellip;' ), bp_get_activity_thread_permalink(), $append_text );
     172        $excerpt = sprintf( '%1$s<span class="activity-read-more" id="%2$s"><a href="%3$s" rel="nofollow">%4$s</a></span>', bp_create_excerpt( $excerpt, $excerpt_length, true, '&hellip;' ), $id, bp_get_activity_thread_permalink(), $append_text );
    169173   
    170174    return apply_filters( 'bp_activity_truncate_entry', $excerpt, $text, $append_text );
    171175}
    172176add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
     177add_filter( 'bp_get_activity_content', 'bp_activity_truncate_entry', 5 );
    173178?>
Note: See TracChangeset for help on using the changeset viewer.