Changeset 3245 for branches/1.2/bp-core/bp-core-templatetags.php
- Timestamp:
- 09/10/2010 08:12:08 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-core/bp-core-templatetags.php
r3238 r3245 22 22 23 23 $this->pag_page = isset( $_REQUEST['upage'] ) ? intval( $_REQUEST['upage'] ) : $page_number; 24 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;25 $this->type = $type;26 27 if ( isset( $_REQUEST['letter'] ) && '' != $_REQUEST['letter'] ) {24 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 25 $this->type = $type; 26 27 if ( isset( $_REQUEST['letter'] ) && '' != $_REQUEST['letter'] ) 28 28 $this->members = BP_Core_User::get_users_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page, $populate_extras ); 29 } else {29 else 30 30 $this->members = bp_core_get_users( array( 'type' => $this->type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'include' => $include, 'search_terms' => $search_terms, 'populate_extras' => $populate_extras ) ); 31 }32 31 33 32 if ( !$max || $max >= (int)$this->members['total'] ) … … 39 38 40 39 if ( $max ) { 41 if ( $max >= count($this->members) ) 42 $this->member_count = count( $this->members);43 else40 if ( $max >= count($this->members) ) { 41 $this->member_count = count( $this->members ); 42 } else { 44 43 $this->member_count = (int)$max; 44 } 45 45 } else { 46 $this->member_count = count( $this->members);46 $this->member_count = count( $this->members ); 47 47 } 48 48 49 if ( (int) $this->total_member_count && (int)$this->pag_num ) {49 if ( (int)$this->total_member_count && (int)$this->pag_num ) { 50 50 $this->pag_links = paginate_links( array( 51 'base' => add_query_arg( 'upage', '%#%' ),52 'format' => '',53 'total' => ceil( (int) $this->total_member_count / (int)$this->pag_num ),54 'current' => (int)$this->pag_page,51 'base' => add_query_arg( 'upage', '%#%' ), 52 'format' => '', 53 'total' => ceil( (int)$this->total_member_count / (int)$this->pag_num ), 54 'current' => (int)$this->pag_page, 55 55 'prev_text' => '←', 56 56 'next_text' => '→', 57 'mid_size' => 158 ) );57 'mid_size' => 1 58 ) ); 59 59 } 60 60 }
Note: See TracChangeset
for help on using the changeset viewer.