Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/22/2009 09:05:31 AM (17 years ago)
Author:
apeatling
Message:

Updating group template loop so that it is far more flexible and can be used on any template page with easy to pass parameters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-templatetags.php

    r1366 r1371  
    768768        global $bp, $bp_the_member_query;
    769769
    770         $this->pag_page = isset( $_REQUEST['page'] ) ? intval( $_REQUEST['page'] ) : 1;
     770        $this->pag_page = isset( $_REQUEST['upage'] ) ? intval( $_REQUEST['upage'] ) : 1;
    771771        $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
    772772               
     
    809809
    810810        $this->members = $this->members['users'];
    811         $this->member_count = count($this->members);
    812 
     811
     812        if ( $max ) {
     813            if ( $max >= count($this->members) )
     814                $this->member_count = count($this->members);
     815            else
     816                $this->member_count = (int)$max;
     817        } else {
     818            $this->member_count = count($this->members);
     819        }
     820       
    813821        $this->pag_links = paginate_links( array(
    814             'base' => add_query_arg( 'page', '%#%' ),
     822            'base' => add_query_arg( 'upage', '%#%' ),
    815823            'format' => '',
    816824            'total' => ceil( (int) $this->total_member_count / (int) $this->pag_num ),
Note: See TracChangeset for help on using the changeset viewer.