Ticket #3271: 3271.2.patch
File 3271.2.patch, 5.0 KB (added by , 13 years ago) |
---|
-
bp-groups/bp-groups-template.php
function bp_group_list_mods( $group = false ) { 578 578 579 579 } 580 580 581 /** 582 * Return a list of user_ids for a group's admins 583 * 584 * @package BuddyPress 585 * @since 1.3 586 * 587 * @param obj $group (optional) The group being queried. Defaults to the current group in the loop 588 * @param str $format 'string' to get a comma-separated string, 'array' to get an array 589 * @return mixed $admin_ids A string or array of user_ids 590 */ 591 function bp_group_admin_ids( $group = false, $format = 'string' ) { 592 global $groups_template; 593 594 if ( !$group ) 595 $group =& $groups_template->group; 596 597 $admin_ids = array(); 598 599 if ( $group->admins ) { 600 foreach( $group->admins as $admin ) { 601 $admin_ids[] = $admin->user_id; 602 } 603 } 604 605 if ( 'string' == $format ) 606 $admin_ids = implode( ',', $admin_ids ); 607 608 return apply_filters( 'bp_group_admin_ids', $admin_ids ); 609 } 610 611 /** 612 * Return a list of user_ids for a group's moderators 613 * 614 * @package BuddyPress 615 * @since 1.3 616 * 617 * @param obj $group (optional) The group being queried. Defaults to the current group in the loop 618 * @param str $format 'string' to get a comma-separated string, 'array' to get an array 619 * @return mixed $mod_ids A string or array of user_ids 620 */ 621 function bp_group_mod_ids( $group = false, $format = 'string' ) { 622 global $groups_template; 623 624 if ( !$group ) 625 $group =& $groups_template->group; 626 627 $mod_ids = array(); 628 629 if ( $group->mods ) { 630 foreach( $group->mods as $mod ) { 631 $mod_ids[] = $mod->user_id; 632 } 633 } 634 635 if ( 'string' == $format ) 636 $mod_ids = implode( ',', $mod_ids ); 637 638 return apply_filters( 'bp_group_mod_ids', $mod_ids ); 639 } 640 581 641 function bp_group_all_members_permalink() { 582 642 echo bp_get_group_all_members_permalink(); 583 643 } … … function bp_group_member_promote_admin_link( $args = '' ) { 959 1019 global $members_template, $groups_template, $bp; 960 1020 961 1021 $defaults = array( 962 'user_id' => $members_template->member->user_id,1022 'user_id' => !empty( $members_template->member->user_id ) ? $members_template->member->user_id : false, 963 1023 'group' => &$groups_template->group 964 1024 ); 965 1025 -
bp-themes/bp-default/groups/single/admin.php
147 147 <?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?> 148 148 149 149 <?php do_action( 'bp_before_group_manage_members_admin' ); ?> 150 150 151 151 <div class="bp-widget"> 152 152 <h4><?php _e( 'Administrators', 'buddypress' ); ?></h4> 153 <?php bp_group_admin_memberlist( true ) ?>154 </div>155 153 156 <?php if ( bp_group_has_moderators() ) : ?> 154 <?php if ( bp_has_members( '&include='. bp_group_admin_ids() ) ) : ?> 155 156 <ul id="admins-list" class="item-list single-line>"> 157 158 <?php while ( bp_members() ) : bp_the_member(); ?> 159 <li> 160 <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?> 161 <h5> 162 <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a> 163 <span class="small"> 164 <a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ) ?>"><?php _e( 'Demote to Member', 'buddypress' ) ?></a> 165 </span> 166 </h5> 167 </li> 168 <?php endwhile; ?> 169 170 </ul> 171 172 <?php endif; ?> 157 173 174 </div> 175 176 <?php if ( bp_group_has_moderators() ) : ?> 158 177 <div class="bp-widget"> 159 <h4><?php _e( 'Moderators', 'buddypress' ) ?></h4> 160 <?php bp_group_mod_memberlist( true ) ?> 178 <h4><?php _e( 'Moderators', 'buddypress' ) ?></h4> 179 180 <?php if ( bp_has_members( '&include=' . bp_group_mod_ids() ) ) : ?> 181 <ul id="mods-list" class="item-list"> 182 183 <?php while ( bp_members() ) : bp_the_member(); ?> 184 <li> 185 <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => __( 'Profile picture of %s', 'buddypress' ) ) ) ?> 186 <h5> 187 <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a> 188 <span class="small"> 189 <a href="<?php bp_group_member_promote_admin_link( array( 'user_id' => bp_get_member_user_id() ) ) ?>" class="button confirm mod-promote-to-admin" title="<?php _e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a> 190 <a class="button confirm mod-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ) ?>"><?php _e( 'Demote to Member', 'buddypress' ) ?></a> 191 </span> 192 </h5> 193 </li> 194 <?php endwhile; ?> 195 196 </ul> 197 198 <?php endif; ?> 161 199 </div> 200 <?php endif ?> 162 201 163 <?php endif; ?>164 202 165 203 <div class="bp-widget"> 166 204 <h4><?php _e("Members", "buddypress"); ?></h4>