Changeset 5700 for trunk/bp-members/bp-members-template.php
- Timestamp:
- 02/11/2012 02:29:55 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-members/bp-members-template.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-template.php
r5646 r5700 1 1 <?php 2 2 3 /** 3 4 * BuddyPress Member Template Tags … … 169 170 var $total_member_count; 170 171 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 );173 }174 175 172 function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) { 176 global $bp; 177 178 $this->pag_page = !empty( $_REQUEST['upage'] ) ? intval( $_REQUEST['upage'] ) : (int)$page_number; 179 $this->pag_num = !empty( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : (int)$per_page; 180 $this->type = $type; 173 174 $this->pag_page = !empty( $_REQUEST['upage'] ) ? intval( $_REQUEST['upage'] ) : (int)$page_number; 175 $this->pag_num = !empty( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : (int)$per_page; 176 $this->type = $type; 181 177 182 178 if ( isset( $_REQUEST['letter'] ) && '' != $_REQUEST['letter'] ) … … 250 246 251 247 function the_member() { 252 global $member, $bp;253 248 254 249 $this->in_the_loop = true; 255 $this->member = $this->next_member(); 256 257 if ( 0 == $this->current_member ) // loop has just started 258 do_action('member_loop_start'); 250 $this->member = $this->next_member(); 251 252 // loop has just started 253 if ( 0 == $this->current_member ) 254 do_action( 'member_loop_start' ); 259 255 } 260 256 } … … 267 263 268 264 function bp_has_members( $args = '' ) { 269 global $ bp, $members_template;265 global $members_template; 270 266 271 267 /*** … … 339 335 } 340 336 function bp_get_members_pagination_count() { 341 global $ bp, $members_template;337 global $members_template; 342 338 343 339 if ( empty( $members_template->type ) ) … … 464 460 465 461 function bp_member_is_loggedin_user() { 466 global $ bp, $members_template;462 global $members_template; 467 463 return apply_filters( 'bp_member_is_loggedin_user', bp_loggedin_user_id() == $members_template->member->id ? true : false ); 468 464 } … … 472 468 } 473 469 function bp_get_member_avatar( $args = '' ) { 474 global $ bp, $members_template;470 global $members_template; 475 471 476 472 $fullname = !empty( $members_template->member->fullname ) ? $members_template->member->fullname : $members_template->member->display_name; 477 473 478 474 $defaults = array( 479 'type' => 'thumb',480 'width' => false,475 'type' => 'thumb', 476 'width' => false, 481 477 'height' => false, 482 'class' => 'avatar',483 'id' => false,484 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname )478 'class' => 'avatar', 479 'id' => false, 480 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname ) 485 481 ); 486 482 … … 568 564 } 569 565 function bp_get_member_latest_update( $args = '' ) { 570 global $ bp, $members_template;566 global $members_template; 571 567 572 568 $defaults = array( … … 598 594 } 599 595 function bp_get_member_profile_data( $args = '' ) { 600 global $ bp, $members_template;596 global $members_template; 601 597 602 598 if ( !bp_is_active( 'xprofile' ) ) … … 665 661 666 662 function bp_directory_members_search_form() { 667 global $bp;668 663 669 664 $default_search_value = bp_get_search_default_text( 'members' ); … … 707 702 // Loop through each navigation item 708 703 foreach( (array) $bp->bp_nav as $nav_item ) { 704 705 $selected = ''; 706 709 707 // If the current component matches the nav item id, then add a highlight CSS class. 710 if ( !bp_is_directory() && $bp->active_components[$bp->current_component] == $nav_item['css_id'] ) 708 if ( !bp_is_directory() && $bp->active_components[$bp->current_component] == $nav_item['css_id'] ) { 711 709 $selected = ' class="current selected"'; 712 else713 $selected = ''; 714 715 / * If we are viewing another person (current_userid does not equal loggedin_user->id)716 then check to see if the two users are friends. if they are, add a highlight CSS class717 to the friends nav item if it exists. */710 } 711 712 // If we are viewing another person (current_userid does not equal 713 // loggedin_user->id then check to see if the two users are friends. 714 // if they are, add a highlight CSS class to the friends nav item 715 // if it exists. 718 716 if ( !bp_is_my_profile() && bp_displayed_user_id() ) { 719 717 $selected = ''; … … 721 719 if ( bp_is_active( 'friends' ) ) { 722 720 if ( $nav_item['css_id'] == $bp->friends->id ) { 723 if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) 721 if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) { 724 722 $selected = ' class="current selected"'; 723 } 725 724 } 726 725 } … … 751 750 continue; 752 751 753 if ( $bp->current_component == $user_nav_item['slug'] ) 752 $selected = ''; 753 if ( $bp->current_component == $user_nav_item['slug'] ) { 754 754 $selected = ' class="current selected"'; 755 else 756 $selected = ''; 757 758 if ( $bp->loggedin_user->domain ) 755 } 756 757 if ( $bp->loggedin_user->domain ) { 759 758 $link = str_replace( $bp->loggedin_user->domain, $bp->displayed_user->domain, $user_nav_item['link'] ); 760 else759 } else { 761 760 $link = trailingslashit( $bp->displayed_user->domain . $user_nav_item['link'] ); 761 } 762 762 763 763 echo apply_filters_ref_array( 'bp_get_displayed_user_nav_' . $user_nav_item['css_id'], array( '<li id="' . $user_nav_item['css_id'] . '-personal-li" ' . $selected . '><a id="user-' . $user_nav_item['css_id'] . '" href="' . $link . '">' . $user_nav_item['name'] . '</a></li>', &$user_nav_item ) ); … … 771 771 } 772 772 function bp_get_loggedin_user_avatar( $args = '' ) { 773 global $bp;774 773 775 774 $defaults = array( … … 791 790 } 792 791 function bp_get_displayed_user_avatar( $args = '' ) { 793 global $bp;794 792 795 793 $defaults = array( … … 826 824 } 827 825 function bp_get_last_activity( $user_id = 0 ) { 828 global $bp;829 826 830 827 if ( empty( $user_id ) ) … … 967 964 } 968 965 function bp_get_signup_page() { 969 global $bp;970 966 971 967 if ( bp_has_custom_signup_page() ) {
Note: See TracChangeset
for help on using the changeset viewer.