Changeset 5891 for trunk/bp-messages/bp-messages-template.php
- Timestamp:
- 03/06/2012 07:15:09 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages/bp-messages-template.php
r5822 r5891 30 30 var $search_terms; 31 31 32 function bp_messages_box_template( $user_id, $box, $per_page, $max, $type ) { 33 $this->__construct( $user_id, $box, $per_page, $max, $type ); 34 } 35 36 function __construct( $user_id, $box, $per_page, $max, $type, $search_terms ) { 37 $this->pag_page = isset( $_GET['mpage'] ) ? intval( $_GET['mpage'] ) : 1; 32 function __construct( $user_id, $box, $per_page, $max, $type, $search_terms, $page_arg = 'mpage' ) { 33 $this->pag_page = isset( $_GET[$page_arg] ) ? intval( $_GET[$page_arg] ) : 1; 38 34 $this->pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page; 39 35 … … 42 38 $this->type = $type; 43 39 $this->search_terms = $search_terms; 44 40 45 41 if ( 'notices' == $this->box ) { 46 42 $this->threads = BP_Messages_Notice::get_notices(); … … 79 75 if ( (int) $this->total_thread_count && (int) $this->pag_num ) { 80 76 $this->pag_links = paginate_links( array( 81 'base' => add_query_arg( 'mpage', '%#%' ),77 'base' => add_query_arg( $page_arg, '%#%' ), 82 78 'format' => '', 83 79 'total' => ceil( (int) $this->total_thread_count / (int) $this->pag_num ), … … 176 172 'max' => false, 177 173 'type' => 'all', 178 'search_terms' => isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '' 174 'search_terms' => isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '', 175 'page_arg' => 'mpage', // See https://buddypress.trac.wordpress.org/ticket/3679 179 176 ); 180 177 … … 197 194 } 198 195 199 $messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type, $search_terms );196 $messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type, $search_terms, $page_arg ); 200 197 } 201 198 … … 323 320 function bp_get_message_thread_avatar() { 324 321 global $messages_template; 325 322 326 323 return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array( 'item_id' => $messages_template->thread->last_sender_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $messages_template->thread->last_sender_id ) ) ) ) ); 327 324 }
Note: See TracChangeset
for help on using the changeset viewer.