[buddypress-trac] [BuddyPress] #3452: Long Inserted Image in Post doesn't Render in Activity Stream

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Tue Aug 16 11:29:44 UTC 2011


#3452: Long Inserted Image in Post doesn't Render in Activity Stream
-------------------------+------------------
 Reporter:  nahummadrid  |       Owner:
     Type:  defect       |      Status:  new
 Priority:  normal       |   Milestone:  1.5
Component:  Activity     |     Version:  1.5
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------

Comment (by boonebgorges):

 Instead of making an explicit exception for certain activity types, I went
 with a slightly different method. The check
 {{{ if ( strlen( $excerpt ) > $excerpt_length ) )}}}
 wasn't working right anymore, because the excerpt could contain additional
 characters due to HTML tags that would make this conditional true, even if
 the rendered result (when Read More was clicked) would show content which
 is less than $excerpt_length. So instead, I run *every* item through
 bp_create_excerpt(). If it's too short, then bp_create_excerpt() just
 returns the original string; otherwise it truncates. Then, before
 appending the 'Read More' link, I check to see whether the return value of
 bp_create_excerpt() is equivalent to the original string - a true test of
 whether it's been truncated. It seems much more elegant and efficient now.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3452#comment:16>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list