Skip to:
Content

BuddyPress.org

Ticket #2544: 2544-3.patch

File 2544-3.patch, 1.9 KB (added by DJPaul, 14 years ago)
  • bp-activity/bp-activity-functions.php

     
    669669
    670670        // Check to see if the parent activity is hidden, and if so, hide this comment publically.
    671671        $activity = new BP_Activity_Activity( $activity_id );
    672         $is_hidden = ( (int)$activity->hide_sitewide ) ? 1 : 0;
     672        $is_hidden = ( (int)$activity->hide_sitewide ) ? true : false;
    673673
    674674        // Insert the activity comment
    675675        $comment_id = bp_activity_add( array(
  • bp-activity/bp-activity-template.php

     
    288288
    289289                // are we displaying user specific activity?
    290290                if ( is_numeric( $user_id ) ) {
    291                         $show_hidden = ( $user_id == $bp->loggedin_user->id && $scope != 'friends' ) ? 1 : 0;
     291                        $show_hidden = ( $user_id == $bp->loggedin_user->id && $scope != 'friends' ) ? true : false;
    292292
    293293                        switch ( $scope ) {
    294294                                case 'friends':
  • bp-activity/bp-activity-classes.php

     
    115115                        $sort = 'DESC';
    116116
    117117                // Hide Hidden Items?
    118                 if ( !$show_hidden )
    119                         $where_conditions['hidden_sql'] = "a.hide_sitewide = 0";
     118                if ( !is_bool( $show_hidden ) && !empty( $show_hidden ) )
     119                        $visibility = $show_hidden;
     120                elseif ( !$show_hidden )
     121                        $visibility = '0';
     122                else
     123                        $visibility = '0, 1';
    120124
     125                $where_conditions['hidden_sql'] = "a.hide_sitewide IN ({$visibility})";
     126
    121127                // Exclude specified items
    122128                if ( $exclude )
    123129                        $where_conditions['exclude'] = "a.id NOT IN ({$exclude})";