Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2012 09:32:04 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Breathing room for cast variables.

File:
1 edited

Legend:

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

    r5705 r5729  
    125125            $this->activities = bp_activity_get( array( 'display_comments' => $display_comments, 'max' => $max, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'sort' => $sort, 'search_terms' => $search_terms, 'filter' => $filter, 'show_hidden' => $show_hidden, 'exclude' => $exclude, 'in' => $in, 'spam' => $spam ) );
    126126
    127         if ( !$max || $max >= (int)$this->activities['total'] )
    128             $this->total_activity_count = (int)$this->activities['total'];
     127        if ( !$max || $max >= (int) $this->activities['total'] )
     128            $this->total_activity_count = (int) $this->activities['total'];
    129129        else
    130             $this->total_activity_count = (int)$max;
     130            $this->total_activity_count = (int) $max;
    131131
    132132        $this->activities = $this->activities['activities'];
     
    136136                $this->activity_count = count( $this->activities );
    137137            } else {
    138                 $this->activity_count = (int)$max;
     138                $this->activity_count = (int) $max;
    139139            }
    140140        } else {
     
    145145
    146146        // Fetch parent content for activity comments so we do not have to query in the loop
    147         foreach ( (array)$this->activities as $activity ) {
     147        foreach ( (array) $this->activities as $activity ) {
    148148            if ( 'activity_comment' != $activity->type )
    149149                continue;
     
    162162        }
    163163
    164         if ( (int)$this->total_activity_count && (int)$this->pag_num ) {
     164        if ( (int) $this->total_activity_count && (int) $this->pag_num ) {
    165165            $this->pag_links = paginate_links( array(
    166166                'base'      => add_query_arg( 'acpage', '%#%' ),
    167167                'format'    => '',
    168                 'total'     => ceil( (int)$this->total_activity_count / (int)$this->pag_num ),
    169                 'current'   => (int)$this->pag_page,
     168                'total'     => ceil( (int) $this->total_activity_count / (int) $this->pag_num ),
     169                'current'   => (int) $this->pag_page,
    170170                'prev_text' => _x( '←', 'Activity pagination previous text', 'buddypress' ),
    171171                'next_text' => _x( '→', 'Activity pagination next text', 'buddypress' ),
     
    277277
    278278    // The default scope should recognize custom slugs
    279     if ( array_key_exists( $bp->current_action, (array)$bp->loaded_components ) ) {
     279    if ( array_key_exists( $bp->current_action, (array) $bp->loaded_components ) ) {
    280280        $scope = $bp->loaded_components[$bp->current_action];
    281281    }
     
    337337                            return false;
    338338
    339                         $user_id = implode( ',', (array)$friends );
     339                        $user_id = implode( ',', (array) $friends );
    340340                    break;
    341341                case 'groups':
     
    346346
    347347                        $object = $bp->groups->id;
    348                         $primary_id = implode( ',', (array)$groups['groups'] );
     348                        $primary_id = implode( ',', (array) $groups['groups'] );
    349349
    350350                        $user_id = 0;
     
    356356                        return false;
    357357
    358                     $include          = implode( ',', (array)$favs );
     358                    $include          = implode( ',', (array) $favs );
    359359                    $display_comments = true;
    360360                    break;
     
    497497
    498498    $remaining_pages = floor( ( $activities_template->total_activity_count - 1 ) / ( $activities_template->pag_num * $activities_template->pag_page ) );
    499     $has_more_items  = (int)$remaining_pages ? true : false;
     499    $has_more_items  = (int) $remaining_pages ? true : false;
    500500
    501501    return apply_filters( 'bp_activity_has_more_items', $has_more_items );
     
    526526        global $activities_template;
    527527
    528         return apply_filters( 'bp_get_activity_count', (int)$activities_template->activity_count );
     528        return apply_filters( 'bp_get_activity_count', (int) $activities_template->activity_count );
    529529    }
    530530
     
    553553        global $activities_template;
    554554
    555         return apply_filters( 'bp_get_activity_per_page', (int)$activities_template->pag_num );
     555        return apply_filters( 'bp_get_activity_per_page', (int) $activities_template->pag_num );
    556556    }
    557557
     
    13231323        global $activities_template;
    13241324
    1325         return apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array)$activities_template->my_favs ) );
     1325        return apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array) $activities_template->my_favs ) );
    13261326    }
    13271327
     
    13881388
    13891389            echo '<ul>';
    1390             foreach ( (array)$comment->children as $comment_child ) {
     1390            foreach ( (array) $comment->children as $comment_child ) {
    13911391                // Put the comment into the global so it's available to filters
    13921392                $activities_template->activity->current_comment = $comment_child;
     
    16821682        $count = bp_activity_recurse_comment_count( $activities_template->activity );
    16831683
    1684         return apply_filters( 'bp_activity_get_comment_count', (int)$count );
     1684        return apply_filters( 'bp_activity_get_comment_count', (int) $count );
    16851685    }
    16861686
     
    19471947
    19481948        $class = '';
    1949         if ( in_array( $activities_template->activity->type, (array)$mini_activity_actions ) || empty( $activities_template->activity->content ) )
     1949        if ( in_array( $activities_template->activity->type, (array) $mini_activity_actions ) || empty( $activities_template->activity->content ) )
    19501950            $class = ' mini';
    19511951
     
    21582158    $can_comment = true;
    21592159
    2160     if ( false === $activities_template->disable_blogforum_replies || (int)$activities_template->disable_blogforum_replies ) {
     2160    if ( false === $activities_template->disable_blogforum_replies || (int) $activities_template->disable_blogforum_replies ) {
    21612161        if ( 'new_blog_post' == bp_get_activity_action_name() || 'new_blog_comment' == bp_get_activity_action_name() || 'new_forum_topic' == bp_get_activity_action_name() || 'new_forum_post' == bp_get_activity_action_name() )
    21622162            $can_comment = false;
Note: See TracChangeset for help on using the changeset viewer.