Changeset 3610
- Timestamp:
- 12/29/2010 03:22:44 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-templatetags.php
r3600 r3610 863 863 return false; 864 864 865 $latest_update = '"' . apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 40 ) ) ) ) . '"';865 $latest_update = '"' . apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 180 ) ) ) ) . '"'; 866 866 $latest_update .= ' · <a href="' . $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $update['id'] . '/"> ' . __( 'View', 'buddypress' ) . '</a>'; 867 867 … … 1102 1102 1103 1103 if ( 'activity_update' == $activities_template->activity->type ) 1104 $title .= ': ' . strip_tags( bp_create_excerpt( $activities_template->activity->content, 15) );1104 $title .= ': ' . strip_tags( bp_create_excerpt( $activities_template->activity->content, 70 ) ); 1105 1105 1106 1106 return apply_filters( 'bp_get_activity_feed_item_title', $title ); -
trunk/bp-core/bp-core-templatetags.php
r3607 r3610 375 375 376 376 $defaults = array( 377 'length' => 15377 'length' => 70 378 378 ); 379 379 … … 1116 1116 * @return str The excerpt text 1117 1117 */ 1118 function bp_create_excerpt( $text, $excerpt_length = 55, $filter_shortcodes = true ) { // Fakes an excerpt if needed1118 function bp_create_excerpt( $text, $excerpt_length = 225, $filter_shortcodes = true ) { // Fakes an excerpt if needed 1119 1119 $original_text = $text; 1120 1120 $text = str_replace(']]>', ']]>', $text); … … 1123 1123 $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text ); 1124 1124 1125 $words = preg_split( 1126 "%\s*((?:<[^>]+>)+\S*)\s*|\s+%s", 1127 $text, 1128 $excerpt_length + 1, 1129 PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE 1130 ); 1131 1132 if (count($words) > $excerpt_length) { 1133 array_pop($words); 1134 array_push($words, '[...]'); 1135 $text = implode(' ', $words); 1136 } 1137 1125 preg_match( "%\s*((?:<[^>]+>)+\S*)\s*|\s+%s", $text, $matches, PREG_OFFSET_CAPTURE, $excerpt_length ); 1126 1127 if ( !empty( $matches ) ) { 1128 $pos = array_pop( array_pop( $matches ) ); 1129 $text = substr( $text, 0, $pos ) . ' [...]'; 1130 } 1131 1138 1132 return apply_filters( 'bp_create_excerpt', $text, $original_text ); 1139 1133 } -
trunk/bp-forums/bp-forums-templatetags.php
r3561 r3610 520 520 521 521 $defaults = array( 522 'length' => 10522 'length' => 45 523 523 ); 524 524 -
trunk/bp-messages/bp-messages-templatetags.php
r3592 r3610 214 214 global $messages_template; 215 215 216 return apply_filters( 'bp_get_message_thread_excerpt', strip_tags( bp_create_excerpt( $messages_template->thread->last_message_content, 10) ) );216 return apply_filters( 'bp_get_message_thread_excerpt', strip_tags( bp_create_excerpt( $messages_template->thread->last_message_content, 75 ) ) ); 217 217 } 218 218
Note: See TracChangeset
for help on using the changeset viewer.