Changeset 4489
- Timestamp:
- 06/12/2011 12:14:45 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-template.php
r4471 r4489 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(); … … 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 ); -
trunk/bp-themes/bp-default/groups/single/admin.php
r3955 r4489 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 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; ?> 173 174 </div> 175 156 176 <?php if ( bp_group_has_moderators() ) : ?> 157 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> 162 163 <?php endif; ?> 200 <?php endif ?> 201 164 202 165 203 <div class="bp-widget">
Note: See TracChangeset
for help on using the changeset viewer.