Ticket #3505: 3505.01.patch
File 3505.01.patch, 4.8 KB (added by , 13 years ago) |
---|
-
bp-core/bp-core-template.php
function bp_create_excerpt( $text, $length = 225, $options = array() ) { 482 482 } 483 483 484 484 return apply_filters( 'bp_create_excerpt', $truncate, $original_text, $length, $options ); 485 485 486 } 486 add_filter( 'bp_create_excerpt', 'wp_trim_excerpt' );487 487 add_filter( 'bp_create_excerpt', 'stripslashes_deep' ); 488 488 add_filter( 'bp_create_excerpt', 'force_balance_tags' ); 489 489 -
bp-forums/bp-forums-template.php
function bp_the_topic_time_since_created() { 716 716 return apply_filters( 'bp_get_the_topic_time_since_created', bp_core_time_since( strtotime( $forum_template->topic->topic_start_time ) ) ); 717 717 } 718 718 719 function bp_the_topic_latest_post_excerpt( $args = '') {720 echo bp_get_the_topic_latest_post_excerpt( $args);719 function bp_the_topic_latest_post_excerpt() { 720 echo bp_get_the_topic_latest_post_excerpt(); 721 721 } 722 function bp_get_the_topic_latest_post_excerpt( $args = '') {722 function bp_get_the_topic_latest_post_excerpt() { 723 723 global $forum_template; 724 724 725 $defaults = array(726 'length' => 45727 );728 729 $r = wp_parse_args( $args, $defaults );730 extract( $r, EXTR_SKIP );731 732 725 $post = bp_forums_get_post( $forum_template->topic->topic_last_post_id ); 733 726 $post = bp_create_excerpt( $post->post_text, $length ); 734 727 return apply_filters( 'bp_get_the_topic_latest_post_excerpt', $post ); 735 728 } 736 729 737 730 function bp_the_topic_time_since_last_post() { 738 global $forum_template;739 740 731 echo bp_get_the_topic_time_since_last_post(); 741 732 } 742 733 function bp_get_the_topic_time_since_last_post() { -
bp-groups/bp-groups-template.php
function bp_group_description_excerpt() { 503 503 if ( !$group ) 504 504 $group =& $groups_template->group; 505 505 506 return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description , 20) );506 return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description ) ); 507 507 } 508 508 509 509 -
bp-members/bp-members-template.php
function bp_member_latest_update( $args = '' ) { 570 570 global $bp, $members_template; 571 571 572 572 $defaults = array( 573 'length' => 70,574 573 'view_link' => true 575 574 ); 576 575 577 576 $r = wp_parse_args( $args, $defaults ); 578 extract( $r , EXTR_SKIP);577 extract( $r ); 579 578 580 if ( !isset( $members_template->member->latest_update ) || !$update = maybe_unserialize( $members_template->member->latest_update ) )579 if ( empty( $members_template->member->latest_update ) || !$update = maybe_unserialize( $members_template->member->latest_update ) ) 581 580 return false; 582 581 583 $update_content = apply_filters( 'bp_get_activity_latest_update', sprintf( _x( '- "%s"', 'member latest update in member directory', 'buddypress' ), trim( strip_tags( bp_create_excerpt( $update['content'], $length ) ) ) ) ); 582 $update_content = apply_filters( 'bp_get_activity_latest_update_excerpt', sprintf( _x( '- "%s "', 'member latest update in member directory', 'buddypress' ), trim( strip_tags( bp_create_excerpt( $update['content'] ) ) ) ) ); 583 584 // If $view_link is true and the text returned by bp_create_excerpt() is different from the original text (ie it's 585 // been truncated), add the "View" link. 586 if ( $view_link && ( $update_content != $update['content'] ) ) { 587 $view = __( 'View', 'buddypress' ); 584 588 585 if ( $view_link && !empty( $update['id'] ) && bp_is_active( 'activity' ) )586 $update_content .= ' <a href="' . bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $update['id'] . '">' . __( 'View', 'buddypress' ) . '</a>';589 $update_content .= '<span class="activity-read-more"><a href="' . bp_activity_get_permalink( $update['id'] ) . '" rel="nofollow">' . $view . '</a></span>'; 590 } 587 591 588 592 return apply_filters( 'bp_get_member_latest_update', $update_content ); 589 593 } -
bp-themes/bp-default/members/members-loop.php
48 48 49 49 <?php if ( bp_get_member_latest_update() ) : ?> 50 50 51 <span class="update"> <?php bp_member_latest_update( array( 'length' => 10, 'view_link' => false )); ?></span>51 <span class="update"> <?php bp_member_latest_update(); ?></span> 52 52 53 53 <?php endif; ?> 54 54