Skip to:
Content

BuddyPress.org


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

Breathing room for cast variables.

File:
1 edited

Legend:

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

    r5714 r5729  
    141141
    142142        if ( 'invites' == $type ) {
    143             $this->total_group_count = (int)$this->groups['total'];
    144             $this->group_count       = (int)$this->groups['total'];
     143            $this->total_group_count = (int) $this->groups['total'];
     144            $this->group_count       = (int) $this->groups['total'];
    145145            $this->groups            = $this->groups['groups'];
    146146        } else if ( 'single-group' == $type ) {
     
    149149            $this->group_count       = 1;
    150150        } else {
    151             if ( empty( $max ) || $max >= (int)$this->groups['total'] ) {
    152                 $this->total_group_count = (int)$this->groups['total'];
     151            if ( empty( $max ) || $max >= (int) $this->groups['total'] ) {
     152                $this->total_group_count = (int) $this->groups['total'];
    153153            } else {
    154                 $this->total_group_count = (int)$max;
     154                $this->total_group_count = (int) $max;
    155155            }
    156156
     
    161161                    $this->group_count = count( $this->groups );
    162162                } else {
    163                     $this->group_count = (int)$max;
     163                    $this->group_count = (int) $max;
    164164                }
    165165            } else {
     
    169169
    170170        // Build pagination links
    171         if ( (int) $this->total_group_count && (int)$this->pag_num ) {
     171        if ( (int) $this->total_group_count && (int) $this->pag_num ) {
    172172            $this->pag_links = paginate_links( array(
    173173                'base'      => add_query_arg( array( 'grpage' => '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ),
    174174                'format'    => '',
    175                 'total'     => ceil( (int)$this->total_group_count / (int)$this->pag_num ),
     175                'total'     => ceil( (int) $this->total_group_count / (int) $this->pag_num ),
    176176                'current'   => $this->pag_page,
    177177                'prev_text' => _x( '←', 'Group pagination previous text', 'buddypress' ),
     
    287287    }
    288288
    289     $groups_template = new BP_Groups_Template( (int)$user_id, $type, (int)$page, (int)$per_page, (int)$max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden );
     289    $groups_template = new BP_Groups_Template( (int) $user_id, $type, (int) $page, (int) $per_page, (int) $max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden );
    290290    return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template );
    291291}
     
    568568    if ( !empty( $group->admins ) ) { ?>
    569569        <ul id="group-admins">
    570             <?php foreach( (array)$group->admins as $admin ) { ?>
     570            <?php foreach( (array) $group->admins as $admin ) { ?>
    571571                <li>
    572572                    <a href="<?php echo bp_core_get_user_domain( $admin->user_id, $admin->user_nicename, $admin->user_login ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'email' => $admin->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $admin->user_id ) ) ) ) ?></a>
     
    590590        <ul id="group-mods">
    591591
    592             <?php foreach( (array)$group->mods as $mod ) { ?>
     592            <?php foreach( (array) $group->mods as $mod ) { ?>
    593593
    594594                <li>
     
    797797
    798798        if ( !$groups_template->group->forum_counts )
    799             $groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int)$forum_id );
     799            $groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int) $forum_id );
    800800
    801801        if ( (bool) $showtext ) {
     
    831831
    832832        if ( !$groups_template->group->forum_counts )
    833             $groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int)$forum_id );
     833            $groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int) $forum_id );
    834834
    835835        if ( (bool) $showtext ) {
     
    10241024        <ul id="admins-list" class="item-list<?php if ( !empty( $admin_list ) ) : ?> single-line<?php endif; ?>">
    10251025
    1026         <?php foreach ( (array)$admins as $admin ) { ?>
     1026        <?php foreach ( (array) $admins as $admin ) { ?>
    10271027
    10281028            <?php if ( !empty( $admin_list ) ) : ?>
     
    10891089        <ul id="mods-list" class="item-list<?php if ( $admin_list ) { ?> single-line<?php } ?>">
    10901090
    1091         <?php foreach ( (array)$group_mods as $mod ) { ?>
     1091        <?php foreach ( (array) $group_mods as $mod ) { ?>
    10921092
    10931093            <?php if ( !empty( $admin_list ) ) { ?>
     
    16971697        $this->members  = BP_Groups_Member::get_all_for_group( $group_id, $this->pag_num, $this->pag_page, $exclude_admins_mods, $exclude_banned, $exclude );
    16981698
    1699         if ( !$max || $max >= (int)$this->members['count'] )
    1700             $this->total_member_count = (int)$this->members['count'];
     1699        if ( !$max || $max >= (int) $this->members['count'] )
     1700            $this->total_member_count = (int) $this->members['count'];
    17011701        else
    1702             $this->total_member_count = (int)$max;
     1702            $this->total_member_count = (int) $max;
    17031703
    17041704        $this->members = $this->members['members'];
     
    17081708                $this->member_count = count($this->members);
    17091709            else
    1710                 $this->member_count = (int)$max;
     1710                $this->member_count = (int) $max;
    17111711        } else {
    17121712            $this->member_count = count($this->members);
     
    17831783    extract( $r, EXTR_SKIP );
    17841784
    1785     $members_template = new BP_Groups_Group_Members_Template( $group_id, $per_page, $max, (int)$exclude_admins_mods, (int)$exclude_banned, $exclude );
     1785    $members_template = new BP_Groups_Group_Members_Template( $group_id, $per_page, $max, (int) $exclude_admins_mods, (int) $exclude_banned, $exclude );
    17861786    return apply_filters( 'bp_group_has_members', $members_template->has_members(), $members_template );
    17871787}
     
    20052005    $counter = 1;
    20062006
    2007     foreach ( (array)$bp->groups->group_creation_steps as $slug => $step ) {
     2007    foreach ( (array) $bp->groups->group_creation_steps as $slug => $step ) {
    20082008        $is_enabled = bp_are_previous_group_creation_steps_complete( $slug ); ?>
    20092009
     
    20682068        $found = true;
    20692069
    2070         foreach ( (array)$step_slugs as $step_slug ) {
     2070        foreach ( (array) $step_slugs as $step_slug ) {
    20712071            if ( !in_array( $step_slug, $bp->groups->completed_create_steps ) )
    20722072                $found = false;
     
    20922092
    20932093    /* Get previous steps */
    2094     foreach ( (array)$bp->groups->group_creation_steps as $slug => $name ) {
     2094    foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) {
    20952095        if ( $slug == $step_slug )
    20962096            break;
     
    21882188        global $bp;
    21892189
    2190         foreach ( (array)$bp->groups->group_creation_steps as $slug => $name ) {
     2190        foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) {
    21912191            if ( bp_is_action_variable( $slug ) )
    21922192                break;
     
    22562256
    22572257        if ( !empty( $items ) )
    2258             return implode( "\n", (array)$items );
     2258            return implode( "\n", (array) $items );
    22592259
    22602260        return false;
     
    24212421        $this->requests = BP_Groups_Group::get_membership_requests( $group_id, $this->pag_num, $this->pag_page );
    24222422
    2423         if ( !$max || $max >= (int)$this->requests['total'] )
    2424             $this->total_request_count = (int)$this->requests['total'];
     2423        if ( !$max || $max >= (int) $this->requests['total'] )
     2424            $this->total_request_count = (int) $this->requests['total'];
    24252425        else
    2426             $this->total_request_count = (int)$max;
     2426            $this->total_request_count = (int) $max;
    24272427
    24282428        $this->requests = $this->requests['requests'];
     
    24322432                $this->request_count = count($this->requests);
    24332433            else
    2434                 $this->request_count = (int)$max;
     2434                $this->request_count = (int) $max;
    24352435        } else {
    24362436            $this->request_count = count($this->requests);
     
    27702770        $current_group = groups_get_current_group();
    27712771
    2772         $current_group_id = isset( $current_group->id ) ? (int)$current_group->id : 0;
     2772        $current_group_id = isset( $current_group->id ) ? (int) $current_group->id : 0;
    27732773
    27742774        return apply_filters( 'bp_get_current_group_id', $current_group_id, $current_group );
Note: See TracChangeset for help on using the changeset viewer.