Changeset 9210 for trunk/src/bp-members/bp-members-template.php
- Timestamp:
- 12/04/2014 01:47:49 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-template.php
r9189 r9210 222 222 * @see BP_User_Query for an in-depth description of parameters. 223 223 * 224 * @param string $type Sort order. 225 * @param int $page_number Page of results. 226 * @param int $per_page Number of results per page. 227 * @param int $max Max number of results to return. 228 * @param int $user_id Limit to friends of a user. 229 * @param string $search_terms Limit to users matching search terms. 230 * @param array $include Limit results by these user IDs. 231 * @param bool $populate_extras Fetch optional extras. 232 * @param array $exclude Exclude these IDs from results. 233 * @param array $meta_key Limit to users with a meta_key. 234 * @param array $meta_value Limit to users with a meta_value (with meta_key). 235 * @param array $page_arg Optional. The string used as a query 236 * parameter in pagination links. Default: 'upage'. 237 */ 238 function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg = 'upage' ) { 224 * @param string $type Sort order. 225 * @param int $page_number Page of results. 226 * @param int $per_page Number of results per page. 227 * @param int $max Max number of results to return. 228 * @param int $user_id Limit to friends of a user. 229 * @param string $search_terms Limit to users matching search terms. 230 * @param array $include Limit results by these user IDs. 231 * @param bool $populate_extras Fetch optional extras. 232 * @param array $exclude Exclude these IDs from results. 233 * @param array $meta_key Limit to users with a meta_key. 234 * @param array $meta_value Limit to users with a meta_value (with meta_key). 235 * @param array $page_arg Optional. The string used as a query parameter in pagination links. 236 * Default: 'upage'. 237 * @param array|string $member_type Array or comma-separated string of member types to limit results to. 238 */ 239 function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg = 'upage', $member_type = '' ) { 239 240 240 241 $this->pag_page = !empty( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : (int) $page_number; … … 245 246 $this->members = BP_Core_User::get_users_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page, $populate_extras, $exclude ); 246 247 else 247 $this->members = bp_core_get_users( array( 'type' => $this->type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'include' => $include, 'search_terms' => $search_terms, 'populate_extras' => $populate_extras, 'exclude' => $exclude, 'meta_key' => $meta_key, 'meta_value' => $meta_value ) );248 $this->members = bp_core_get_users( array( 'type' => $this->type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'include' => $include, 'search_terms' => $search_terms, 'populate_extras' => $populate_extras, 'exclude' => $exclude, 'meta_key' => $meta_key, 'meta_value' => $meta_value, 'member_type' => $member_type ) ); 248 249 249 250 if ( !$max || $max >= (int) $this->members['total'] ) … … 399 400 * string (eg, 'user_id=4&per_page=3'). 400 401 * 401 * @type int $type Sort order.'active', 'random', 'newest', 'popular',402 * 'online', 'alphabetical'. Default: 'active'.403 * @type int|bool $pagePage of results to display. Default: 1.404 * @type int|bool $per_pageNumber of results per page. Default: 20.405 * @type int|bool $max Maximum number of results to return.406 * Default: false (unlimited).407 * @type string $page_arg The string used as a query parameter in408 * pagination links. Default: 'bpage'.409 * @type array|int|string|bool $include Limit results by a list of user410 * IDs. Accepts an array, a single integer, a comma-separated list of411 * IDs, or false (to disable this limiting). Default: false.412 * 'active', 'alphabetical', 'newest', or 'random'.413 * @type array|int|string|bool $exclude Exclude users from results by ID.414 * Accepts an array, a single integer, a comma-separated list of415 * IDs, or false (to disable this limiting). Default: false.416 * @type int $user_id If provided, results are limited to the friends of417 * the specified user. When on a user's Friends page, defaults to418 * the ID of the displayed user. Otherwise defaults to 0.419 * @type string $search_termsLimit results by a search term. Default: null.420 * @type string $meta_keyLimit results by the presence of a usermeta key.402 * @type int $type Sort order. Accepts 'active', 'random', 'newest', 'popular', 403 * 'online', 'alphabetical'. Default: 'active'. 404 * @type int|bool $page Page of results to display. Default: 1. 405 * @type int|bool $per_page Number of results per page. Default: 20. 406 * @type int|bool $max Maximum number of results to return. Default: false (unlimited). 407 * @type string $page_arg The string used as a query parameter in pagination links. 408 * Default: 'bpage'. 409 * @type array|int|string|bool $include Limit results by a list of user IDs. Accepts an array, a 410 * single integer, a comma-separated list of IDs, or false (to 411 * disable this limiting). Accepts 'active', 'alphabetical', 412 * 'newest', or 'random'. Default: false. 413 * @type array|int|string|bool $exclude Exclude users from results by ID. Accepts an array, a single 414 * integer, a comma-separated list of IDs, or false (to disable 415 * this limiting). Default: false. 416 * @type int $user_id If provided, results are limited to the friends of the specified 417 * user. When on a user's Friends page, defaults to the ID of the 418 * displayed user. Otherwise defaults to 0. 419 * @type string|array $member_type Array or comma-separated list of member types to limit results to. 420 * @type string $search_terms Limit results by a search term. Default: null. 421 * @type string $meta_key Limit results by the presence of a usermeta key. 421 422 * Default: false. 422 * @type mixed $meta_valueWhen used with meta_key, limits results by the423 * @type mixed $meta_value When used with meta_key, limits results by the 423 424 * a matching usermeta value. Default: false. 424 * @type bool $populate_extras Whether to fetch optional data, such as425 * @type bool $populate_extras Whether to fetch optional data, such as 425 426 * friend counts. Default: true. 426 427 * } … … 451 452 452 453 'user_id' => $user_id, // Pass a user_id to only show friends of this user 454 'member_type' => '', 453 455 'search_terms' => null, // Pass search_terms to filter users by their profile data 454 456 … … 486 488 $r['meta_key'], 487 489 $r['meta_value'], 488 $r['page_arg'] 490 $r['page_arg'], 491 $r['member_type'] 489 492 ); 490 493
Note: See TracChangeset
for help on using the changeset viewer.