Skip to:
Content

BuddyPress.org

Changeset 2666


Ignore:
Timestamp:
02/11/2010 12:50:00 PM (15 years ago)
Author:
apeatling
Message:

Make sure activity comments are separating their action an content and also being hidden publicly if on a private activity.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r2656 r2666  
    627627        $parent_id = $activity_id;
    628628
    629     /* Insert the "user posted a new activity comment header text" */
    630     $comment_header = '<div class="comment-header">' . sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $user_id ) ) . ' <span class="time-since">%s</span></div> ';
     629    /* Check to see if the parent activity is hidden, and if so, hide this comment publically. */
     630    $activity = new BP_Activity_Activity( $activity_id );
     631    $is_hidden = ( (int)$activity->hide_sitewide ) ? 1 : 0;
    631632
    632633    /* Insert the activity comment */
    633634    $comment_id = bp_activity_add( array(
    634         'content' => apply_filters( 'bp_activity_comment_content', $comment_header . '<div class="activity-inner">' . $content . '</div>' ),
    635         'primary_link' => '',
     635        'action' => apply_filters( 'bp_activity_comment_action', sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $user_id ) ) ),
     636        'content' => apply_filters( 'bp_activity_comment_content', '<div class="activity-inner">' . $content . '</div>' ),
    636637        'component' => $bp->activity->id,
    637638        'type' => 'activity_comment',
    638639        'user_id' => $user_id,
    639640        'item_id' => $activity_id,
    640         'secondary_item_id' => $parent_id
     641        'secondary_item_id' => $parent_id,
     642        'hide_sitewide' => $is_hidden
    641643    ) );
    642644
  • trunk/bp-activity/bp-activity-templatetags.php

    r2616 r2666  
    191191            $display_comments = 'stream';
    192192
     193        $show_hidden = ( $user_id == $bp->loggedin_user->id ) ? 1 : 0;
     194
    193195        if ( $user_id = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->id : $bp->loggedin_user->id ) {
    194196            switch ( $scope ) {
     
    209211                        $object = $bp->groups->id;
    210212                        $primary_id = implode( ',', (array)$groups['groups'] );
    211                         $show_hidden = ( $user_id == $bp->loggedin_user->id ) ? 1 : 0;
     213
    212214                        $user_id = false;
    213215                    }
     
    219221
    220222                    $include = implode( ',', (array)$favs );
    221                     $show_hidden = ( $user_id == $bp->loggedin_user->id ) ? 1 : 0;
    222223                    break;
    223224                case 'mentions':
     
    225226                    $user_login = ( !empty( $bp->displayed_user->id ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;
    226227                    $search_terms = '@' . bp_core_get_username( $user_id, $user_nicename, $user_login );
    227                     $show_hidden = ( $user_id == $bp->loggedin_user->id ) ? 1 : 0;
    228228                    $display_comments = 'stream';
    229229                    $user_id = false;
     
    570570                if ( !$comment->user_fullname )
    571571                    $comment->user_fullname = $comment->display_name;
     572
     573                var_dump($comment->content);
    572574
    573575                $content .= '<li id="acomment-' . $comment->id . '">';
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r2644 r2666  
    194194
    195195                <div class="acomment-content">
    196                     <?php bp_activity_content() ?>
     196                    <?php bp_activity_content_body() ?>
    197197                </div>
    198198            </li>
Note: See TracChangeset for help on using the changeset viewer.