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-forums/bp-forums-template.php

    r5687 r5729  
    133133        $this->topics = apply_filters( 'bp_forums_template_topics', $this->topics, $type, $forum_id, $per_page, $max, $no_stickies );
    134134
    135         if ( !(int)$this->topics ) {
     135        if ( !(int) $this->topics ) {
    136136            $this->topic_count       = 0;
    137137            $this->total_topic_count = 0;
     
    142142                // Group forums
    143143                $topic_count = bp_forums_get_forum( $forum_id );
    144                 $topic_count = (int)$topic_count->topics;
     144                $topic_count = (int) $topic_count->topics;
    145145            } else if ( !empty( $bp->groups->current_group ) ) {
    146146                $topic_count = (int)groups_total_public_forum_topic_count( $type );
     
    164164                $this->total_topic_count = $topic_count;
    165165            } else {
    166                 $this->total_topic_count = (int)$max;
     166                $this->total_topic_count = (int) $max;
    167167            }
    168168
     
    171171                    $this->topic_count = count( $this->topics );
    172172                } else {
    173                     $this->topic_count = (int)$max;
     173                    $this->topic_count = (int) $max;
    174174                }
    175175            } else {
     
    184184        $this->topics = bp_forums_get_topic_extras( $this->topics );
    185185
    186         if ( (int)$this->total_topic_count && (int)$this->pag_num ) {
     186        if ( (int) $this->total_topic_count && (int) $this->pag_num ) {
    187187            $this->pag_links = paginate_links( array(
    188188                'base'      => add_query_arg( array( 'p' => '%#%', 'n' => $this->pag_num ) ),
    189189                'format'    => '',
    190                 'total'     => ceil( (int)$this->total_topic_count / (int)$this->pag_num),
     190                'total'     => ceil( (int) $this->total_topic_count / (int) $this->pag_num),
    191191                'current'   => $this->pag_page,
    192192                'prev_text' => _x( '←', 'Forum topic pagination previous text', 'buddypress' ),
     
    379379                if ( $this_page_stickies ) {
    380380                    // Correct the topic_count
    381                     $forum_template->topic_count += (int)$this_page_stickies;
     381                    $forum_template->topic_count += (int) $this_page_stickies;
    382382
    383383                    // Figure out which stickies need to be included
     
    385385
    386386                    // Merge these topics into the forum template
    387                     $forum_template->topics = array_merge( $this_page_sticky_topics, (array)$forum_template->topics );
     387                    $forum_template->topics = array_merge( $this_page_sticky_topics, (array) $forum_template->topics );
    388388                }
    389389            } else {
     
    404404                'base'      => add_query_arg( array( 'p' => '%#%', 'n' => $forum_template->pag_num ) ),
    405405                'format'    => '',
    406                 'total'     => ceil( (int)$forum_template->total_topic_count / (int)$forum_template->pag_num ),
     406                'total'     => ceil( (int) $forum_template->total_topic_count / (int) $forum_template->pag_num ),
    407407                'current'   => $forum_template->pag_page,
    408408                'prev_text' => _x( '←', 'Forum topic pagination previous text', 'buddypress' ),
     
    466466        global $forum_template;
    467467
    468         $post = bb_get_first_post( (int)$forum_template->topic->topic_id, false );
     468        $post = bb_get_first_post( (int) $forum_template->topic->topic_id, false );
    469469        return apply_filters( 'bp_get_the_topic_text', esc_attr( $post->post_text ) );
    470470    }
     
    796796
    797797        if ( bp_is_item_admin() || bp_is_item_mod() || bp_current_user_can( 'bp_moderate' ) ) {
    798             if ( 0 == (int)$forum_template->topic->topic_sticky )
     798            if ( 0 == (int) $forum_template->topic->topic_sticky )
    799799                $links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'stick', 'bp_forums_stick_topic' ) . '">' . __( 'Sticky Topic', 'buddypress' ) . '</a>';
    800800            else
    801801                $links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'unstick', 'bp_forums_unstick_topic' ) . '">' . __( 'Un-stick Topic', 'buddypress' ) . '</a>';
    802802
    803             if ( 0 == (int)$forum_template->topic->topic_open )
     803            if ( 0 == (int) $forum_template->topic->topic_open )
    804804                $links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'open', 'bp_forums_open_topic' ) . '">' . __( 'Open Topic', 'buddypress' ) . '</a>';
    805805            else
     
    824824            $class .= 'alt';
    825825
    826         if ( isset( $forum_template->topic->topic_sticky ) && 1 == (int)$forum_template->topic->topic_sticky )
     826        if ( isset( $forum_template->topic->topic_sticky ) && 1 == (int) $forum_template->topic->topic_sticky )
    827827            $class .= ' sticky';
    828828
    829         if ( !isset( $forum_template->topic->topic_open ) || 0 == (int)$forum_template->topic->topic_open )
     829        if ( !isset( $forum_template->topic->topic_open ) || 0 == (int) $forum_template->topic->topic_open )
    830830            $class .= ' closed';
    831831
     
    10181018            $this->total_post_count = 0;
    10191019        } else {
    1020             if ( !$max || $max >= (int)$forum_template->topic->topic_posts ) {
    1021                 $this->total_post_count = (int)$forum_template->topic->topic_posts;
     1020            if ( !$max || $max >= (int) $forum_template->topic->topic_posts ) {
     1021                $this->total_post_count = (int) $forum_template->topic->topic_posts;
    10221022            } else {
    1023                 $this->total_post_count = (int)$max;
     1023                $this->total_post_count = (int) $max;
    10241024            }
    10251025
     
    10281028                    $this->post_count = count( $this->posts );
    10291029                } else {
    1030                     $this->post_count = (int)$max;
     1030                    $this->post_count = (int) $max;
    10311031                }
    10321032            } else {
     
    10381038        $this->topic_tags = bb_get_topic_tags( $this->topic_id );
    10391039
    1040         if ( (int)$this->total_post_count && (int)$this->pag_num ) {
     1040        if ( (int) $this->total_post_count && (int) $this->pag_num ) {
    10411041            $this->pag_links = paginate_links( array(
    1042                 'base'      => add_query_arg( array( 'topic_page' => '%#%', 'num' => (int)$this->pag_num ) ),
     1042                'base'      => add_query_arg( array( 'topic_page' => '%#%', 'num' => (int) $this->pag_num ) ),
    10431043                'format'    => '',
    1044                 'total'     => ceil( (int)$this->total_post_count / (int)$this->pag_num ),
     1044                'total'     => ceil( (int) $this->total_post_count / (int) $this->pag_num ),
    10451045                'current'   => $this->pag_page,
    10461046                'prev_text' => _x( '&larr;', 'Forum thread pagination previous text', 'buddypress' ),
     
    10491049            ) );
    10501050
    1051             $this->pag->total_pages = ceil( (int)$this->total_post_count / (int)$this->pag_num );
     1051            $this->pag->total_pages = ceil( (int) $this->total_post_count / (int) $this->pag_num );
    10521052        } else {
    10531053            $this->pag->total_pages = 1;
     
    11731173            $class .= 'alt';
    11741174
    1175         if ( 1 == (int)$topic_template->post->post_status )
     1175        if ( 1 == (int) $topic_template->post->post_status )
    11761176            $class .= ' deleted';
    11771177
    1178         if ( 0 == (int)$topic_template->post->post_status )
     1178        if ( 0 == (int) $topic_template->post->post_status )
    11791179            $class .= ' open';
    11801180
Note: See TracChangeset for help on using the changeset viewer.