Changeset 7949
- Timestamp:
- 02/21/2014 02:06:53 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-template.php
r7948 r7949 2029 2029 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 2030 2030 2031 // Assemble the base URL for pagination 2032 $base_url = trailingslashit( bp_get_group_permalink( groups_get_current_group() ) . bp_current_action() ); 2033 if ( bp_action_variable() ) { 2034 $base_url = trailingslashit( $base_url . bp_action_variable() ); 2035 } 2036 2031 2037 $members_args = $r; 2032 2038 … … 2053 2059 2054 2060 $this->pag_links = paginate_links( array( 2055 'base' => add_query_arg( 'mlpage', '%#%'),2061 'base' => add_query_arg( array( 'mlpage' => '%#%' ), $base_url ), 2056 2062 'format' => '', 2057 2063 'total' => !empty( $this->pag_num ) ? ceil( $this->total_member_count / $this->pag_num ) : $this->total_member_count, … … 2133 2139 global $members_template; 2134 2140 2141 $exclude_admins_mods = 1; 2142 2143 if ( bp_is_group_members() ) { 2144 $exclude_admins_mods = 0; 2145 } 2146 2135 2147 $r = wp_parse_args( $args, array( 2136 2148 'group_id' => bp_get_current_group_id(), … … 2139 2151 'max' => false, 2140 2152 'exclude' => false, 2141 'exclude_admins_mods' => 1,2153 'exclude_admins_mods' => $exclude_admins_mods, 2142 2154 'exclude_banned' => 1, 2143 2155 'group_role' => false, … … 2325 2337 } 2326 2338 2339 /** 2340 * Output the Group members template 2341 * 2342 * @since BuddyPress (?) 2343 * 2344 * @return string html output 2345 */ 2346 function bp_groups_members_template_part() { 2347 ?> 2348 <div class="item-list-tabs" id="subnav" role="navigation"> 2349 <ul> 2350 <li class="groups-members-search" role="search"> 2351 <?php bp_directory_members_search_form(); ?> 2352 </li> 2353 2354 <?php bp_groups_members_filter(); ?> 2355 <?php do_action( 'bp_members_directory_member_sub_types' ); ?> 2356 2357 </ul> 2358 </div> 2359 2360 <div id="members-group-list" class="group_members dir-list"> 2361 2362 <?php bp_get_template_part( 'groups/single/members' ); ?> 2363 2364 </div> 2365 <?php 2366 } 2367 2368 /** 2369 * Output the Group members filters 2370 * 2371 * @since BuddyPress (?) 2372 * 2373 * @return string html output 2374 */ 2375 function bp_groups_members_filter() { 2376 ?> 2377 <li id="group_members-order-select" class="last filter"> 2378 <label for="group_members-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label> 2379 <select id="group_members-order-by"> 2380 <option value="last_joined"><?php _e( 'Newest', 'buddypress' ); ?></option> 2381 <option value="first_joined"><?php _e( 'Oldest', 'buddypress' ); ?></option> 2382 <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option> 2383 2384 <?php do_action( 'bp_groups_members_order_options' ); ?> 2385 2386 </select> 2387 </li> 2388 <?php 2389 } 2327 2390 2328 2391 /*************************************************************************** -
trunk/bp-templates/bp-legacy/buddypress-functions.php
r7942 r7949 573 573 bp_update_is_directory( true, bp_current_component() ); 574 574 575 $template_part = $object . '/' . $object . '-loop'; 576 577 // The template part can be overridden by the calling JS function 578 if ( ! empty( $_POST['template'] ) ) { 579 $template_part = sanitize_option( 'upload_path', $_POST['template'] ); 580 } 581 575 582 // Locate the object template 576 bp_get_template_part( "$object/$object-loop");583 bp_get_template_part( $template_part ); 577 584 exit(); 578 585 } -
trunk/bp-templates/bp-legacy/buddypress/groups/single/home.php
r6516 r7949 48 48 49 49 // Otherwise show members 50 elseif ( bp_is_active( 'members' ) ) : bp_g et_template_part( 'groups/single/members');50 elseif ( bp_is_active( 'members' ) ) : bp_groups_members_template_part(); 51 51 52 52 endif; … … 62 62 63 63 // Group Members 64 elseif ( bp_is_group_members() ) : bp_g et_template_part( 'groups/single/members');64 elseif ( bp_is_group_members() ) : bp_groups_members_template_part(); 65 65 66 66 // Group Invitations -
trunk/bp-templates/bp-legacy/buddypress/groups/single/members.php
r6284 r7949 1 <?php if ( bp_group_has_members( 'exclude_admins_mods=0') ) : ?>1 <?php if ( bp_group_has_members( bp_ajax_querystring( 'group_members' ) ) ) : ?> 2 2 3 3 <?php do_action( 'bp_before_group_members_content' ); ?> 4 4 5 <div class="item-list-tabs" id="subnav" role="navigation"> 6 <ul> 7 8 <?php do_action( 'bp_members_directory_member_sub_types' ); ?> 9 10 </ul> 11 </div> 12 13 <div id="pag-top" class="pagination no-ajax"> 5 <div id="pag-top" class="pagination"> 14 6 15 7 <div class="pag-count" id="member-count-top"> … … 64 56 <?php do_action( 'bp_after_group_members_list' ); ?> 65 57 66 <div id="pag-bottom" class="pagination no-ajax">58 <div id="pag-bottom" class="pagination"> 67 59 68 60 <div class="pag-count" id="member-count-bottom"> -
trunk/bp-templates/bp-legacy/css/buddypress.css
r7679 r7949 487 487 margin: -39px 0 0 0; 488 488 } 489 #buddypress div.dir-search input[type=text] { 489 #buddypress div.dir-search input[type=text], 490 #buddypress li.groups-members-search input[type=text] { 490 491 font-size: 90%; 491 492 padding: 1px 3px; … … 582 583 #buddypress .standard-form input[type=password], 583 584 #buddypress .dir-search input[type=search], 584 #buddypress .dir-search input[type=text] { 585 #buddypress .dir-search input[type=text], 586 #buddypress .groups-members-search input[type=search], 587 #buddypress .groups-members-search input[type=text] { 585 588 border: 1px solid #ccc; 586 589 background: #fafafa; -
trunk/bp-templates/bp-legacy/js/buddypress.js
r7946 r7949 18 18 19 19 /* Object filter and scope set. */ 20 var objects = [ 'members', 'groups', 'blogs', 'forums' ];20 var objects = [ 'members', 'groups', 'blogs', 'forums', 'group_members' ]; 21 21 bp_init_objects( objects ); 22 22 … … 666 666 667 667 /* The search form on all directory pages */ 668 jq( '.dir-search').on( 'click', function(event) {668 jq( '.dir-search, .groups-members-search' ).on( 'click', function(event) { 669 669 if ( jq(this).hasClass('no-ajax') ) 670 670 return; … … 675 675 var css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' ); 676 676 var object = css_id[0]; 677 678 bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1, jq.cookie('bp-' + object + '-extras') ); 677 var template = null; 678 679 // The Group Members page specifies its own template 680 if ( 'members' == object && 'groups' == css_id[1] ) { 681 object = 'group_members'; 682 template = 'groups/single/members'; 683 } 684 685 bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1, jq.cookie('bp-' + object + '-extras'), null, template ); 679 686 680 687 return false; … … 720 727 var filter = jq(this).val(); 721 728 var search_terms = false; 729 var template = null; 722 730 723 731 if ( jq('.dir-search input').length ) 724 732 search_terms = jq('.dir-search input').val(); 725 733 734 // The Group Members page has a different selector for its 735 // search terms box 736 var $gm_search = jq( '.groups-members-search input' ); 737 if ( $gm_search.length ) { 738 search_terms = $gm_search.val(); 739 } 740 741 // On the Groups Members page, we specify a template 742 if ( 'members' == object && 'groups' == scope ) { 743 object = 'group_members'; 744 template = 'groups/single/members'; 745 } 746 726 747 if ( 'friends' == object ) 727 748 object = 'members'; 728 749 729 bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') );750 bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras'), null, template ); 730 751 731 752 return false; … … 752 773 var search_terms = false; 753 774 var pagination_id = jq(target).closest('.pagination-links').attr('id'); 775 var template = null; 754 776 755 777 var page_number = target.attr('href').split( '=' ); 756 778 page_number = page_number[1]; 757 779 780 // Search terms 758 781 if ( jq('div.dir-search input').length ) 759 782 search_terms = jq('.dir-search input').val(); 783 784 // The Group Members page has a different selector for 785 // its search terms box 786 var $gm_search = jq( '.groups-members-search input' ); 787 if ( $gm_search.length ) { 788 search_terms = $gm_search.val(); 789 } 790 791 // On the Groups Members page, we specify a template 792 if ( 'members' == object && 'groups' == css_id[1] ) { 793 object = 'group_members'; 794 template = 'groups/single/members'; 795 } 760 796 761 797 if ( pagination_id.indexOf( 'pag-bottom' ) !== -1 ) { … … 765 801 } 766 802 767 bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope'), 'div.' + object, search_terms, page_number, jq.cookie('bp-' + object + '-extras'), caller );803 bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope'), 'div.' + object, search_terms, page_number, jq.cookie('bp-' + object + '-extras'), caller, template ); 768 804 769 805 return false; … … 964 1000 965 1001 /* Add / Remove friendship buttons */ 966 jq( '#members-dir-list').on('click', '.friendship-button a', function() {1002 jq( '#members-dir-list, #members-group-list' ).on('click', '.friendship-button a', function() { 967 1003 jq(this).parent().addClass('loading'); 968 1004 var fid = jq(this).attr('id'); … … 1381 1417 1382 1418 /* Filter the current content list (groups/members/blogs/topics) */ 1383 function bp_filter_request( object, filter, scope, target, search_terms, page, extras, caller ) {1419 function bp_filter_request( object, filter, scope, target, search_terms, page, extras, caller, template ) { 1384 1420 if ( 'activity' == object ) 1385 1421 return false; … … 1410 1446 jq('.item-list-tabs select option[value="' + filter + '"]').prop( 'selected', true ); 1411 1447 1412 if ( 'friends' == object )1448 if ( 'friends' == object || 'group_members' == object ) { 1413 1449 object = 'members'; 1450 } 1414 1451 1415 1452 if ( bp_ajax_request ) … … 1424 1461 'scope': scope, 1425 1462 'page': page, 1426 'extras': extras 1463 'extras': extras, 1464 'template': template 1427 1465 }, 1428 1466 function(response)
Note: See TracChangeset
for help on using the changeset viewer.