Skip to:
Content

BuddyPress.org

Ticket #3679: 3679.members.01.diff

File 3679.members.01.diff, 2.8 KB (added by cnorris23, 13 years ago)

Members

  • bp-members/bp-members-template.php

     
    169169        var $pag_links;
    170170        var $total_member_count;
    171171
    172         function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) {
     172        function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg = 'upage' ) {
    173173
    174                 $this->pag_page = !empty( $_REQUEST['upage'] ) ? intval( $_REQUEST['upage'] ) : (int) $page_number;
     174                $this->pag_page = !empty( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : (int) $page_number;
    175175                $this->pag_num  = !empty( $_REQUEST['num'] )   ? intval( $_REQUEST['num'] )   : (int) $per_page;
    176176                $this->type     = $type;
    177177
     
    199199
    200200                if ( (int) $this->total_member_count && (int) $this->pag_num ) {
    201201                        $this->pag_links = paginate_links( array(
    202                                 'base'      => add_query_arg( 'upage', '%#%' ),
     202                                'base'      => add_query_arg( $page_arg, '%#%' ),
    203203                                'format'    => '',
    204204                                'total'     => ceil( (int) $this->total_member_count / (int) $this->pag_num ),
    205205                                'current'   => (int) $this->pag_page,
     
    285285                'per_page'        => 20,
    286286                'max'             => false,
    287287
     288                'page_arg'        => 'upage',       // See https://buddypress.trac.wordpress.org/ticket/3679
     289
    288290                'include'         => false,         // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users
    289291                'exclude'         => false,         // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users
    290292
     
    316318        if ( empty( $include ) && bp_is_friends_component() && bp_is_current_action( 'requests' ) )
    317319                return false;
    318320
    319         $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 );
     321        $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 );
    320322        return apply_filters( 'bp_has_members', $members_template->has_members(), $members_template );
    321323}
    322324
     
    866868        function bp_user_link() { bp_displayed_user_domain(); } // Deprecated.
    867869
    868870function bp_displayed_user_id() {
    869        
     871
    870872        static $id = 0;
    871        
     873
    872874        if ( empty( $id ) ) {
    873875                global $bp;
    874876                $id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0;
     
    880882function bp_loggedin_user_id() {
    881883
    882884        static $id = 0;
    883        
     885
    884886        if ( empty( $id ) ) {
    885887                global $bp;
    886888                $id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0;