Skip to:
Content

BuddyPress.org

Ticket #3679: 3679.01.patch

File 3679.01.patch, 3.1 KB (added by r-a-y, 13 years ago)
  • bp-members/bp-members-template.php

    class BP_Core_Members_Template { 
    168168        var $pag_links;
    169169        var $total_member_count;
    170170
    171         function bp_core_members_template( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) {
    172                 $this->__construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value );
     171        function bp_core_members_template( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg ) {
     172                $this->__construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg );
    173173        }
    174174
    175         function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) {
     175        function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg ) {
    176176                global $bp;
    177177
    178                 $this->pag_page  = !empty( $_REQUEST['upage'] ) ? intval( $_REQUEST['upage'] ) : (int)$page_number;
     178                $this->pag_page  = !empty( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : (int)$page_number;
    179179                $this->pag_num   = !empty( $_REQUEST['num'] )   ? intval( $_REQUEST['num'] )   : (int)$per_page;
    180180                $this->type      = $type;
    181181
    class BP_Core_Members_Template { 
    205205
    206206                if ( (int)$this->total_member_count && (int)$this->pag_num ) {
    207207                        $this->pag_links = paginate_links( array(
    208                                 'base'      => add_query_arg( 'upage', '%#%' ),
     208                                'base'      => add_query_arg( $page_arg, '%#%' ),
    209209                                'format'    => '',
    210210                                'total'     => ceil( (int)$this->total_member_count / (int)$this->pag_num ),
    211211                                'current'   => (int) $this->pag_page,
    function bp_has_members( $args = '' ) { 
    290290                'page'            => $page,
    291291                'per_page'        => 20,
    292292                'max'             => false,
     293                'page_arg'        => 'upage',
    293294
    294295                'include'         => false,         // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users
    295296                'exclude'         => false,         // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users
    function bp_has_members( $args = '' ) { 
    322323        if ( empty( $include ) && bp_is_friends_component() && bp_is_current_action( 'requests' ) )
    323324                return false;
    324325
    325         $members_template = new BP_Core_Members_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $include, (bool)$populate_extras, $exclude, $meta_key, $meta_value );
     326        $members_template = new BP_Core_Members_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $include, (bool)$populate_extras, $exclude, $meta_key, $meta_value, $page_arg );
    326327        return apply_filters( 'bp_has_members', $members_template->has_members(), $members_template );
    327328}