Changeset 5891
- Timestamp:
- 03/06/2012 07:15:09 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-template.php
r5758 r5891 105 105 var $full_name; 106 106 107 function __construct( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude = false, $in = false, $spam = 'ham_only' ) {107 function __construct( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude = false, $in = false, $spam = 'ham_only', $page_arg = 'acpage' ) { 108 108 global $bp; 109 109 110 $this->pag_page = isset( $_REQUEST[ 'acpage'] ) ? intval( $_REQUEST['acpage'] ) : $page;110 $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page; 111 111 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 112 112 … … 164 164 if ( (int) $this->total_activity_count && (int) $this->pag_num ) { 165 165 $this->pag_links = paginate_links( array( 166 'base' => add_query_arg( 'acpage', '%#%' ),166 'base' => add_query_arg( $page_arg, '%#%' ), 167 167 'format' => '', 168 168 'total' => ceil( (int) $this->total_activity_count / (int) $this->pag_num ), … … 300 300 'spam' => 'ham_only', // Hide spammed items 301 301 302 'page_arg' => 'acpage', // See https://buddypress.trac.wordpress.org/ticket/3679 303 302 304 // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions) 303 305 'scope' => $scope, … … 388 390 $spam = 'all'; 389 391 390 $activities_template = new BP_Activity_Template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in, $spam );392 $activities_template = new BP_Activity_Template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in, $spam, $page_arg ); 391 393 392 394 return apply_filters( 'bp_has_activities', $activities_template->has_activities(), $activities_template ); … … 897 899 $dn_default = $activities_template->current_comment->display_name; 898 900 } 899 901 900 902 $alt_default = isset( $dn_default ) ? sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name ) : __( 'Profile picture', 'buddypress' ); 901 903 902 904 $defaults = array( 903 905 'alt' => $alt_default, … … 993 995 $object = 'group'; 994 996 $item_id = $activities_template->activity->item_id; 995 997 996 998 if ( empty( $alt ) ) { 997 999 $group = groups_get_group( $item_id ); -
trunk/bp-blogs/bp-blogs-template.php
r5729 r5891 103 103 var $total_blog_count; 104 104 105 function bp_blogs_template( $type, $page, $per_page, $max, $user_id, $search_terms ) { 106 $this->__construct( $type, $page, $per_page, $max, $user_id, $search_terms ); 107 } 108 109 function __construct( $type, $page, $per_page, $max, $user_id, $search_terms ) { 110 111 $this->pag_page = isset( $_REQUEST['bpage'] ) ? intval( $_REQUEST['bpage'] ) : $page; 105 function __construct( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg = 'bpage' ) { 106 107 $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page; 112 108 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 113 109 … … 136 132 if ( (int) $this->total_blog_count && (int) $this->pag_num ) { 137 133 $this->pag_links = paginate_links( array( 138 'base' => add_query_arg( 'bpage', '%#%' ),134 'base' => add_query_arg( $page_arg, '%#%' ), 139 135 'format' => '', 140 136 'total' => ceil( (int) $this->total_blog_count / (int) $this->pag_num ), … … 209 205 $search_terms = null; 210 206 211 / * User filtering */207 // User filtering 212 208 if ( bp_displayed_user_id() ) 213 209 $user_id = bp_displayed_user_id(); … … 219 215 'max' => false, 220 216 221 'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to 222 'search_terms' => $search_terms // Pass search terms to filter on the blog title or description. 217 'page_arg' => 'bpage', // See https://buddypress.trac.wordpress.org/ticket/3679 218 219 'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to 220 'search_terms' => $search_terms // Pass search terms to filter on the blog title or description. 223 221 ); 224 222 … … 239 237 } 240 238 241 $blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms );239 $blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg ); 242 240 return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), $blogs_template ); 243 241 } … … 280 278 function bp_get_blog_avatar( $args = '' ) { 281 279 global $blogs_template; 282 280 283 281 $defaults = array( 284 282 'type' => 'full', … … 528 526 function bp_blogs_get_subdomain_base() { 529 527 global $current_site; 530 528 531 529 return apply_filters( 'bp_blogs_subdomain_base', preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path ); 532 530 } -
trunk/bp-forums/bp-forums-template.php
r5886 r5891 97 97 var $sort_by; 98 98 var $order; 99 100 function BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) {101 $this->__construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset, $number );102 }103 99 104 100 function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) { -
trunk/bp-groups/bp-groups-template.php
r5758 r5891 108 108 var $order; 109 109 110 function bp_groups_template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false ) { 111 $this->__construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $include, $populate_extras, $exclude, $show_hidden ); 112 } 113 114 function __construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false ){ 115 116 $this->pag_page = isset( $_REQUEST['grpage'] ) ? intval( $_REQUEST['grpage'] ) : $page; 110 function __construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false, $page_arg = 'grpage' ){ 111 112 $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page; 117 113 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 118 114 … … 171 167 if ( (int) $this->total_group_count && (int) $this->pag_num ) { 172 168 $this->pag_links = paginate_links( array( 173 'base' => add_query_arg( array( 'grpage'=> '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ),169 'base' => add_query_arg( array( $page_arg => '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ), 174 170 'format' => '', 175 171 'total' => ceil( (int) $this->total_group_count / (int) $this->pag_num ), … … 266 262 'show_hidden' => false, 267 263 264 'page_arg' => 'grpage', // See https://buddypress.trac.wordpress.org/ticket/3679 265 268 266 'user_id' => $user_id, // Pass a user ID to limit to groups this user has joined 269 267 'slug' => $slug, // Pass a group slug to only return that group … … 287 285 } 288 286 289 $groups_template = new BP_Groups_Template( (int) $user_id, $type, (int) $page, (int) $per_page, (int) $max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden );287 $groups_template = new BP_Groups_Template( (int) $user_id, $type, (int) $page, (int) $per_page, (int) $max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden, $page_arg ); 290 288 return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template ); 291 289 } -
trunk/bp-members/bp-members-template.php
r5824 r5891 170 170 var $total_member_count; 171 171 172 function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) {173 174 $this->pag_page = !empty( $_REQUEST[ 'upage'] ) ? intval( $_REQUEST['upage'] ) : (int) $page_number;172 function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg = 'upage' ) { 173 174 $this->pag_page = !empty( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : (int) $page_number; 175 175 $this->pag_num = !empty( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : (int) $per_page; 176 176 $this->type = $type; … … 200 200 if ( (int) $this->total_member_count && (int) $this->pag_num ) { 201 201 $this->pag_links = paginate_links( array( 202 'base' => add_query_arg( 'upage', '%#%' ),202 'base' => add_query_arg( $page_arg, '%#%' ), 203 203 'format' => '', 204 204 'total' => ceil( (int) $this->total_member_count / (int) $this->pag_num ), … … 286 286 'max' => false, 287 287 288 'page_arg' => 'upage', // See https://buddypress.trac.wordpress.org/ticket/3679 289 288 290 'include' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users 289 291 'exclude' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users … … 317 319 return false; 318 320 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 ); 320 322 return apply_filters( 'bp_has_members', $members_template->has_members(), $members_template ); 321 323 } … … 867 869 868 870 function bp_displayed_user_id() { 869 871 870 872 static $id = 0; 871 873 872 874 if ( empty( $id ) ) { 873 875 global $bp; … … 881 883 882 884 static $id = 0; 883 885 884 886 if ( empty( $id ) ) { 885 887 global $bp; -
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.