Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/22/2011 08:30:22 PM (14 years ago)
Author:
boonebgorges
Message:

Adds Read More functionality to activity comments. Adds AJAX functionality to activity Read More. Fixes #2635. Fixes bugs with the way that activity comment content and meta links are displayed. Fixes #3168.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-template.php

    r4216 r4239  
    800800            $content = '<ul>';
    801801            foreach ( (array)$comment->children as $comment_child ) {
     802                // Put the comment into the global so it's available to filters
     803                $activities_template->activity->current_comment = $comment_child;
     804               
    802805                if ( empty( $comment_child->user_fullname ) )
    803806                    $comment_child->user_fullname = $comment_child->display_name;
     
    837840                // hidden when JS is off.
    838841                if ( is_user_logged_in() && bp_activity_can_comment_reply( $comment ) )
    839                     $content .= apply_filters( 'bp_activity_comment_reply_link', '<span class="acomment-replylink"> &middot; <a href="#acomment-' . $comment->id . '" class="acomment-reply" id="acomment-reply-' . $activities_template->activity->id . '">' . __( 'Reply', 'buddypress' ) . '</a></span>', $comment );
     842                    $content .= apply_filters( 'bp_activity_comment_reply_link', '<span class="acomment-replylink"> &middot; <a href="#acomment-' . $comment_child->id . '" class="acomment-reply" id="acomment-reply-' . $comment->id . '">' . __( 'Reply', 'buddypress' ) . '</a></span>', $comment_child );
    840843
    841844                // Delete link
    842845                if ( $bp->loggedin_user->is_super_admin || $bp->loggedin_user->id == $comment->user_id ) {
    843                     $delete_url = wp_nonce_url( bp_get_root_domain() . '/' . $bp->activity->slug . '/delete/?cid=' . $comment->id, 'bp_activity_delete_link' );
    844                     $content .= apply_filters( 'bp_activity_comment_delete_link', ' &middot; <a href="' . $delete_url . '" class="delete acomment-delete" rel="nofollow">' . __( 'Delete', 'buddypress' ) . '</a>', $comment, $delete_url );
     846                    $delete_url = wp_nonce_url( bp_get_root_domain() . '/' . $bp->activity->slug . '/delete/?cid=' . $comment_child->id, 'bp_activity_delete_link' );
     847                    $content .= apply_filters( 'bp_activity_comment_delete_link', ' &middot; <a href="' . $delete_url . '" class="delete acomment-delete" rel="nofollow">' . __( 'Delete', 'buddypress' ) . '</a>', $comment_child, $delete_url );
    845848                }
    846849
    847850                $content .= '</div>';
    848                 $content .= '<div class="acomment-content">' . apply_filters( 'bp_get_activity_content', $comment->content ) . '</div>';
     851                $content .= '<div class="acomment-content">' . apply_filters( 'bp_get_activity_content', $comment_child->content ) . '</div>';
    849852
    850853                $content .= bp_activity_recurse_comments( $comment_child );
    851854                $content .= '</li>';
     855               
     856                // Unset in the global in case of the last iteration
     857                unset( $activities_template->activity->current_comment );
    852858            }
    853859            $content .= '</ul>';
Note: See TracChangeset for help on using the changeset viewer.