Changeset 2383
- Timestamp:
- 01/20/2010 05:43:49 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r2382 r2383 487 487 $content = bp_activity_add_timesince_placeholder( $content ); 488 488 489 /* Remove any images and replace the first image with a thumbnail */490 //$content = bp_activity_thumbnail_images( $content );491 492 489 $activity = new BP_Activity_Activity( $id ); 493 490 … … 710 707 } 711 708 712 function bp_activity_thum bnail_images( $content ) {709 function bp_activity_thumnail_content_images( $content ) { 713 710 preg_match_all( '/<img[^>]*>/Ui', $content, $matches ); 714 711 $content = preg_replace('/<img[^>]*>/Ui', '', $content ); … … 718 715 preg_match( '/<img.*?(src\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $src ); 719 716 717 /* Get the width and height */ 718 preg_match( '/<img.*?(height\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $height ); 719 preg_match( '/<img.*?(width\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $width ); 720 720 721 if ( !empty( $src ) ) { 721 722 $src = substr( substr( str_replace( 'src=', '', $src[1] ), 0, -1 ), 1 ); 722 $pos = strpos( $content, '<blockquote>' ); 723 $before = substr( $content, 0, (int) $pos ); 724 $after = substr( $content, (int) $pos, strlen( $content ) ); 725 726 $content = $before . '<img src="' . esc_attr( $src) . '" width="100" height="100" alt="thumb" class="align-left thumbnail" />' . $after; 723 $height = substr( substr( str_replace( 'height=', '', $height[1] ), 0, -1 ), 1 ); 724 $width = substr( substr( str_replace( 'width=', '', $width[1] ), 0, -1 ), 1 ); 725 726 if ( empty( $width ) || empty( $height ) ) { 727 $width = 100; 728 $height = 100; 729 } 730 731 $ratio = (int)$width / (int)$height; 732 $new_height = 100; 733 $new_width = $new_height * $ratio; 734 735 $content = '<img src="' . esc_attr( $src) . '" width="' . $new_width . '" height="' . $new_height . '" alt="' . __( 'Thumbnail', 'buddypress' ) . '" class="align-left thumbnail" />' . $content; 727 736 } 728 737 } -
trunk/bp-activity/bp-activity-templatetags.php
r2381 r2383 559 559 global $activities_template; 560 560 561 $mini_activity_actions = apply_filters( 'bp_activity_mini_activity_ actions', array(561 $mini_activity_actions = apply_filters( 'bp_activity_mini_activity_types', array( 562 562 'friendship_accepted', 563 563 'friendship_created', … … 569 569 570 570 $class = ''; 571 if ( in_array( $activities_template->activity->type, (array)$mini_activity_actions ) )571 if ( in_array( $activities_template->activity->type, (array)$mini_activity_actions ) || empty( $activities_template->activity->content ) ) 572 572 $class = ' mini'; 573 573 -
trunk/bp-blogs.php
r2381 r2383 260 260 extract( $r, EXTR_SKIP ); 261 261 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 262 269 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 ) ); 263 270 } … … 391 398 392 399 $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; 394 401 395 402 bp_blogs_record_activity( array( … … 429 436 430 437 $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; 432 439 433 440 /* Record this in activity streams */ … … 487 494 $comment_link = bp_post_get_permalink( $comment->post, $wpdb->blogid ) . '#comment-' . $comment_id; 488 495 $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; 490 497 491 498 /* Record this in activity streams */ -
trunk/bp-core/bp-core-templatetags.php
r2378 r2383 1096 1096 return apply_filters( 'bp_create_excerpt', $text ); 1097 1097 } 1098 add_filter( 'bp_create_excerpt', 'wptexturize' );1099 add_filter( 'bp_create_excerpt', 'convert_smilies' );1100 add_filter( 'bp_create_excerpt', 'convert_chars' );1101 add_filter( 'bp_create_excerpt', 'wpautop' );1102 1098 add_filter( 'bp_create_excerpt', 'wp_trim_excerpt' ); 1103 1099 add_filter( 'bp_create_excerpt', 'stripslashes_deep' ); -
trunk/bp-themes/bp-default/_inc/css/default.css
r2381 r2383 1059 1059 padding: 0; 1060 1060 margin: 0; 1061 overflow: auto; 1061 1062 } 1062 1063 … … 1141 1142 .activity-list .activity-content blockquote { 1142 1143 margin: 15px 0 15px 5px; 1144 overflow: auto; 1143 1145 } 1144 1146 body.activity-permalink .activity-content .activity-inner, … … 1146 1148 margin-top: 5px; 1147 1149 } 1150 1151 .activity-list .activity-content img.thumbnail { 1152 float: left; 1153 margin: 0 10px 5px 0; 1154 border: 2px solid #eee; 1155 } 1148 1156 1149 1157 .activity-list li.load-more { … … 1168 1176 div.activity-meta { 1169 1177 margin: 0 0 20px 3px; 1178 clear: left; 1170 1179 } 1171 1180
Note: See TracChangeset
for help on using the changeset viewer.