Skip to:
Content

BuddyPress.org

Changeset 5341


Ignore:
Timestamp:
11/21/2011 07:49:00 PM (13 years ago)
Author:
djpaul
Message:

See #3660. Activity admin iteration.

  • Activity comment counts now show from non-zero non-root comments
File:
1 edited

Legend:

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

    r5339 r5341  
    826826        // $item is not the root activity (it is probably an activity_comment).
    827827        } else {
    828             echo '<br />';
    829 
    830             // @todo Get comment count from a specific node ($root_activity_id) in the tree, not $root_activity_id's root.
     828            $comment_count = count( BP_Activity_Activity::get_child_comments( $item['id'] ) );
     829
     830            /// If a non-root activity has zero (child) comments, then don't show a zero bubble to keep the UI tidy
     831            if ( 0 == $comment_count ) {
     832                echo '<br />';
     833
     834            } else {
     835                // Display a link to the root activity's permalink, with the current activity's (child) comment count in a speech bubble
     836                printf( '<br /><a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$d</span></a>',  network_admin_url( 'admin.php?page=bp-activity&amp;aid=' . $root_activity_id ), esc_attr( sprintf( __( '%d related activities', 'buddypress' ), $comment_count ) ), $comment_count );
     837            }
    831838        }
    832839
Note: See TracChangeset for help on using the changeset viewer.