[buddypress-trac] [BuddyPress] #2337: Blog post images on activity stream not linking...

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri Apr 23 13:12:44 UTC 2010


#2337: Blog post images on activity stream not linking...
--------------------+-------------------------------------------------------
 Reporter:  floris  |       Owner:     
     Type:  defect  |      Status:  new
 Priority:  normal  |   Milestone:  1.3
Component:  Core    |    Keywords:     
--------------------+-------------------------------------------------------
 Noticed the images are not linked to the parent post properly.

 Rather than using bp_activity_thumbnail_content_images(), I'm trying to
 add the following to entry.php to establish this. Perhaps it's a starting
 point, but am not sure how to get the post ID for the activity blog post.

 Add something like this to entry.php?


 {{{
 if ( $attachments = get_posts( array(
 'numberposts' => 1,
 'orderby' => 'menu_order ID',
 'post_mime_type' => 'image',
 'post_parent' => somethingsomething,
 'post_type' => 'attachment',
 ) ) ) {
 foreach ( $attachments as $attachment ) {
 $link = get_permalink( $attachment->post_parent );
 $source = wp_get_attachment_image_src( $attachment->ID, 'thumbnail' );
 echo '<a href="' . $link . '"><img src="' . $source[0] . '" /></a>';
 }
 }
 }}}


 Best,

 F.

-- 
Ticket URL: <http://trac.buddypress.org/ticket/2337>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list