Changeset 5729 for trunk/bp-groups/bp-groups-template.php
- Timestamp:
- 02/11/2012 09:32:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-template.php
r5714 r5729 141 141 142 142 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']; 145 145 $this->groups = $this->groups['groups']; 146 146 } else if ( 'single-group' == $type ) { … … 149 149 $this->group_count = 1; 150 150 } 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']; 153 153 } else { 154 $this->total_group_count = (int) $max;154 $this->total_group_count = (int) $max; 155 155 } 156 156 … … 161 161 $this->group_count = count( $this->groups ); 162 162 } else { 163 $this->group_count = (int) $max;163 $this->group_count = (int) $max; 164 164 } 165 165 } else { … … 169 169 170 170 // 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 ) { 172 172 $this->pag_links = paginate_links( array( 173 173 'base' => add_query_arg( array( 'grpage' => '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ), 174 174 '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 ), 176 176 'current' => $this->pag_page, 177 177 'prev_text' => _x( '←', 'Group pagination previous text', 'buddypress' ), … … 287 287 } 288 288 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 ); 290 290 return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template ); 291 291 } … … 568 568 if ( !empty( $group->admins ) ) { ?> 569 569 <ul id="group-admins"> 570 <?php foreach( (array) $group->admins as $admin ) { ?>570 <?php foreach( (array) $group->admins as $admin ) { ?> 571 571 <li> 572 572 <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> … … 590 590 <ul id="group-mods"> 591 591 592 <?php foreach( (array) $group->mods as $mod ) { ?>592 <?php foreach( (array) $group->mods as $mod ) { ?> 593 593 594 594 <li> … … 797 797 798 798 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 ); 800 800 801 801 if ( (bool) $showtext ) { … … 831 831 832 832 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 ); 834 834 835 835 if ( (bool) $showtext ) { … … 1024 1024 <ul id="admins-list" class="item-list<?php if ( !empty( $admin_list ) ) : ?> single-line<?php endif; ?>"> 1025 1025 1026 <?php foreach ( (array) $admins as $admin ) { ?>1026 <?php foreach ( (array) $admins as $admin ) { ?> 1027 1027 1028 1028 <?php if ( !empty( $admin_list ) ) : ?> … … 1089 1089 <ul id="mods-list" class="item-list<?php if ( $admin_list ) { ?> single-line<?php } ?>"> 1090 1090 1091 <?php foreach ( (array) $group_mods as $mod ) { ?>1091 <?php foreach ( (array) $group_mods as $mod ) { ?> 1092 1092 1093 1093 <?php if ( !empty( $admin_list ) ) { ?> … … 1697 1697 $this->members = BP_Groups_Member::get_all_for_group( $group_id, $this->pag_num, $this->pag_page, $exclude_admins_mods, $exclude_banned, $exclude ); 1698 1698 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']; 1701 1701 else 1702 $this->total_member_count = (int) $max;1702 $this->total_member_count = (int) $max; 1703 1703 1704 1704 $this->members = $this->members['members']; … … 1708 1708 $this->member_count = count($this->members); 1709 1709 else 1710 $this->member_count = (int) $max;1710 $this->member_count = (int) $max; 1711 1711 } else { 1712 1712 $this->member_count = count($this->members); … … 1783 1783 extract( $r, EXTR_SKIP ); 1784 1784 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 ); 1786 1786 return apply_filters( 'bp_group_has_members', $members_template->has_members(), $members_template ); 1787 1787 } … … 2005 2005 $counter = 1; 2006 2006 2007 foreach ( (array) $bp->groups->group_creation_steps as $slug => $step ) {2007 foreach ( (array) $bp->groups->group_creation_steps as $slug => $step ) { 2008 2008 $is_enabled = bp_are_previous_group_creation_steps_complete( $slug ); ?> 2009 2009 … … 2068 2068 $found = true; 2069 2069 2070 foreach ( (array) $step_slugs as $step_slug ) {2070 foreach ( (array) $step_slugs as $step_slug ) { 2071 2071 if ( !in_array( $step_slug, $bp->groups->completed_create_steps ) ) 2072 2072 $found = false; … … 2092 2092 2093 2093 /* 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 ) { 2095 2095 if ( $slug == $step_slug ) 2096 2096 break; … … 2188 2188 global $bp; 2189 2189 2190 foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) {2190 foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) { 2191 2191 if ( bp_is_action_variable( $slug ) ) 2192 2192 break; … … 2256 2256 2257 2257 if ( !empty( $items ) ) 2258 return implode( "\n", (array) $items );2258 return implode( "\n", (array) $items ); 2259 2259 2260 2260 return false; … … 2421 2421 $this->requests = BP_Groups_Group::get_membership_requests( $group_id, $this->pag_num, $this->pag_page ); 2422 2422 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']; 2425 2425 else 2426 $this->total_request_count = (int) $max;2426 $this->total_request_count = (int) $max; 2427 2427 2428 2428 $this->requests = $this->requests['requests']; … … 2432 2432 $this->request_count = count($this->requests); 2433 2433 else 2434 $this->request_count = (int) $max;2434 $this->request_count = (int) $max; 2435 2435 } else { 2436 2436 $this->request_count = count($this->requests); … … 2770 2770 $current_group = groups_get_current_group(); 2771 2771 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; 2773 2773 2774 2774 return apply_filters( 'bp_get_current_group_id', $current_group_id, $current_group );
Note: See TracChangeset
for help on using the changeset viewer.