Skip to:
Content

BuddyPress.org

Changeset 2383 for trunk/bp-blogs.php


Ignore:
Timestamp:
01/20/2010 05:43:49 PM (15 years ago)
Author:
apeatling
Message:

Auto thumbnail the first image in a blog post and display it on the activity stream. This stops huge images in blogs posts from displaying on the stream and messing with the design. Fixes #1620

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r2381 r2383  
    260260    extract( $r, EXTR_SKIP );
    261261
     262    /* Remove large images and replace them with just one image thumbnail */
     263    if ( function_exists( 'bp_activity_thumnail_content_images' ) && !empty( $content ) )
     264        $content = bp_activity_thumnail_content_images( $content );
     265
     266    $action = apply_filters( 'bp_blogs_record_activity_action', $action );
     267    $content = apply_filters( 'bp_blogs_record_activity_content', "<blockquote>" . bp_create_excerpt( $content ) . "</blockquote>" );
     268
    262269    return bp_activity_add( array( 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );
    263270}
     
    391398
    392399                $activity_action = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
    393                 $activity_content = "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>";
     400                $activity_content = $post->post_content;
    394401
    395402                bp_blogs_record_activity( array(
     
    429436
    430437            $activity_action = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
    431             $activity_content = "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>";
     438            $activity_content = $post->post_content;
    432439
    433440            /* Record this in activity streams */
     
    487494        $comment_link = bp_post_get_permalink( $comment->post, $wpdb->blogid ) . '#comment-' . $comment_id;
    488495        $activity_action = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' );
    489         $activity_content = '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>';
     496        $activity_content = $comment->comment_content;
    490497
    491498        /* Record this in activity streams */
Note: See TracChangeset for help on using the changeset viewer.